# Butterfly EDFA Rack (MOPA) — laser control panel. # Registered in configuration.yaml (lovelace: dashboards: butterfly-rack). # # Entities are auto-discovered over MQTT; the *_mw power sensors are MQTT # template sensors defined in configuration.butterfly.yaml (dBm -> mW). # Styling uses card-mod (installed via HACS). # # Two tabs: # Control — the panel: status strip, output readout, the two # stages, emergency stop. Everything you touch. # Diagnostics & Trends — the history graphs plus network / TEC / error # detail, kept off the control tab so it stays clean. title: Butterfly Rack views: # =================================================================== # TAB 1 — CONTROL PANEL # =================================================================== - title: Control path: control icon: mdi:laser-pointer type: sections # Single column so the sections stack in operating order: # Status -> Output -> Seed -> Booster -> Emergency. max_columns: 1 sections: # ---- Output readout (2 units) + SHUTDOWN (1 unit, square) ------- - type: grid cards: # Big output-power readout. # HA's markdown card strips inline styles, so size/centre via # card-mod piercing the ha-markdown shadow (the three spans are the # value, the " mW" unit, and the "Output power" label). - type: markdown grid_options: columns: 8 rows: 3 content: >
{{ states('sensor.butterfly_edfa_rack_output_power_mw') }} mW
Output power
card_mod: style: .: | ha-card { height: 100%; display: flex; align-items: center; justify-content: center; padding: 12px; } ha-markdown$: | div { text-align: center !important; width: 100%; line-height: 1.05; } div span:nth-of-type(1) { font-size: 3.6rem; font-weight: 700; } div span:nth-of-type(2) { font-size: 1.7rem; font-weight: 600; } div span:nth-of-type(3) { color: var(--secondary-text-color); } # One-tap emergency stop. Runs butterfly_edfa_shutdown: pump-1 to 0, # booster off, then seed off (EDFA first, then seed). No confirmation # so it acts immediately; the action is safe (it only turns things off). - type: button name: SHUTDOWN icon: mdi:alarm-light icon_height: 40px show_state: false grid_options: columns: 4 rows: 3 tap_action: action: call-service service: script.butterfly_edfa_shutdown card_mod: style: | ha-card { background: #c0392b; color: #fff; --primary-text-color: #fff; --paper-item-icon-color: #fff; font-weight: 800; letter-spacing: 0.06em; height: 100%; } # ---- Rack status (full width) ----------------------------------- - type: grid column_span: 2 cards: - type: heading heading: Butterfly EDFA Rack heading_style: title icon: mdi:laser-pointer - type: heading heading: 1550 nm MOPA · Class 4 · invisible 1550 nm — treat output as hazardous heading_style: subtitle - type: glance state_color: true columns: 4 grid_options: columns: 12 # Read-only status lamps. The actual on/off toggles live in the # Seed and Booster stage cards below (tap_action: none here so this # strip does not duplicate those controls). entities: - entity: binary_sensor.butterfly_edfa_rack_seed_link name: Seed link tap_action: action: none - entity: binary_sensor.butterfly_edfa_rack_amp_link name: Amp link tap_action: action: none - entity: binary_sensor.butterfly_edfa_rack_seed_laser_enabled name: Seed tap_action: action: none - entity: switch.butterfly_edfa_rack_amp_pump name: Booster tap_action: action: none - type: tile entity: sensor.butterfly_edfa_rack_amp_warnings name: Status icon: mdi:alert-decagram grid_options: columns: 12 card_mod: style: | ha-card { {% set w = states('sensor.butterfly_edfa_rack_amp_warnings') %} {% if w in ['none','Pump is OFF','unknown','unavailable'] or w == '' %} --tile-color: var(--green-color, #43a047); {% else %} --tile-color: var(--red-color, #e53935); {% endif %} } # ---- Output readout --------------------------------------------- - type: grid column_span: 1 cards: - type: heading heading: Output heading_style: subtitle icon: mdi:arrow-left-bold - type: tile entity: sensor.butterfly_edfa_rack_output_power name: Output dBm icon: mdi:sine-wave grid_options: columns: 6 - type: tile entity: sensor.butterfly_edfa_rack_amp_input_power_mw name: EDFA in icon: mdi:arrow-right-bold grid_options: columns: 6 # ---- Stage 1: seed ---------------------------------------------- - type: grid column_span: 1 cards: - type: heading heading: Seed · Stage 1 (CTL200) heading_style: subtitle icon: mdi:alpha-s-circle-outline - type: entities state_color: true entities: - entity: switch.butterfly_edfa_rack_seed_laser name: Seed laser (ON first) - entity: number.butterfly_edfa_rack_seed_set_current name: Set current (mA) - entity: number.butterfly_edfa_rack_seed_thermistor_setpoint name: Temp setpoint (Ω) - type: tile entity: sensor.butterfly_edfa_rack_seed_current name: Current icon: mdi:current-dc grid_options: columns: 6 - type: tile entity: sensor.butterfly_edfa_rack_seed_temperature name: Seed temp icon: mdi:thermometer grid_options: columns: 6 - type: tile entity: sensor.butterfly_edfa_rack_seed_photodiode_current name: Monitor PD icon: mdi:current-dc grid_options: columns: 6 # ---- Stage 2: booster ------------------------------------------- - type: grid column_span: 1 cards: - type: heading heading: Booster · Stage 2 (M511, ACC) heading_style: subtitle icon: mdi:alpha-b-circle-outline - type: entities state_color: true entities: - entity: switch.butterfly_edfa_rack_amp_pump name: Pump enable - entity: number.butterfly_edfa_rack_amp_pump_current name: Pump-1 set (mA) # Lifts the pump-1 clamp from 4000 mA (1 W) to the 8000 mA max. - entity: switch.butterfly_edfa_rack_amp_pump_limit_override name: Pump limit override (→ 8000 mA) - type: tile entity: sensor.butterfly_edfa_rack_amp_pump_1_current name: Pump-1 current icon: mdi:current-dc grid_options: columns: 6 - type: tile entity: sensor.butterfly_edfa_rack_amp_module_temperature name: Module temp icon: mdi:thermometer grid_options: columns: 6 # =================================================================== # TAB 2 — DIAGNOSTICS & TRENDS # =================================================================== - title: Diagnostics & Trends path: diagnostics icon: mdi:chart-line type: sections max_columns: 3 sections: - type: grid column_span: 2 cards: - type: heading heading: Trends heading_style: subtitle icon: mdi:chart-line - type: history-graph title: Output & pre-amp PD (mW) hours_to_show: 1 entities: - entity: sensor.butterfly_edfa_rack_output_power_mw name: Output PD - entity: sensor.butterfly_edfa_rack_pre_amp_power_mw name: Pre-amp PD - type: history-graph title: EDFA input PD (mW) — seed after attenuators hours_to_show: 1 entities: - entity: sensor.butterfly_edfa_rack_amp_input_power_mw name: EDFA input - type: history-graph title: Seed monitor PD (mA — relative, uncalibrated) hours_to_show: 1 entities: - entity: sensor.butterfly_edfa_rack_seed_photodiode_current name: Seed monitor PD - type: history-graph title: Temperatures (°C) hours_to_show: 1 entities: - entity: sensor.butterfly_edfa_rack_seed_temperature name: Seed - entity: sensor.butterfly_edfa_rack_seed_board_temperature name: Seed board - entity: sensor.butterfly_edfa_rack_amp_module_temperature name: Amp module - entity: sensor.butterfly_edfa_rack_amp_pre_amp_temperature name: Amp pre-amp - type: grid column_span: 1 cards: - type: heading heading: Seed detail heading_style: subtitle icon: mdi:alpha-s-circle-outline - type: entities entities: - entity: sensor.butterfly_edfa_rack_seed_voltage name: Seed voltage - entity: sensor.butterfly_edfa_rack_seed_thermistor name: Thermistor (actual) - entity: sensor.butterfly_edfa_rack_seed_tec_current name: TEC current - entity: sensor.butterfly_edfa_rack_seed_tec_voltage name: TEC voltage - entity: sensor.butterfly_edfa_rack_seed_board_temperature name: Board temp - entity: sensor.butterfly_edfa_rack_seed_error_code name: Error code - type: heading heading: Amp detail heading_style: subtitle icon: mdi:alpha-b-circle-outline - type: entities entities: - entity: sensor.butterfly_edfa_rack_amp_input_power name: Input power (dBm) - entity: sensor.butterfly_edfa_rack_amp_pre_amp_power name: Pre-amp power (dBm) - entity: sensor.butterfly_edfa_rack_amp_pre_amp_current name: Pre-amp current - entity: sensor.butterfly_edfa_rack_amp_pre_amp_temperature name: Pre-amp temp - entity: sensor.butterfly_edfa_rack_amp_tec_current name: TEC current - entity: sensor.butterfly_edfa_rack_amp_warnings name: Warnings - type: heading heading: Bridge (ESP32) heading_style: subtitle icon: mdi:chip - type: entities entities: - entity: sensor.butterfly_edfa_rack_ip_address name: IP address - entity: sensor.butterfly_edfa_rack_wifi_signal name: WiFi signal - entity: sensor.butterfly_edfa_rack_uptime name: Uptime