Files
butterfly-edfa-rack-homeass…/ui-lovelace-butterfly.yaml
T
James Bateman (hp-laptop)andClaude Opus 4.8 f9ce61ba33 Dashboard: stack Control view in operating order (single column)
Switch the Control view to a single column so the sections render top to
bottom in operating order: Status -> Output -> Seed (Stage 1) ->
Booster (Stage 2) -> Emergency, instead of the 2-column masonry that put
Seed beside Output and Booster below.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-02 16:02:39 +01:00

338 lines
13 KiB
YAML

# 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:
# ---- 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_mw
name: Output power
icon: mdi:arrow-left-bold
grid_options:
columns: 12
card_mod:
style: |
ha-card { --tile-color: var(--cyan-color, #00acc1); }
- 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
# ---- Emergency (full width) -------------------------------------
- type: grid
column_span: 2
cards:
- type: heading
heading: Emergency
heading_style: subtitle
icon: mdi:alarm-light
- type: horizontal-stack
cards:
- type: button
name: PUMP OFF
icon: mdi:power-off
icon_height: 44px
show_state: false
tap_action:
action: call-service
service: switch.turn_off
target:
entity_id: switch.butterfly_edfa_rack_amp_pump
card_mod: &estop_amber
style: |
ha-card {
background: #e67e22;
color: #fff;
--primary-text-color: #fff;
--paper-item-icon-color: #fff;
font-weight: 700;
letter-spacing: 0.04em;
}
- type: button
name: SEED OFF
icon: mdi:power-off
icon_height: 44px
show_state: false
tap_action:
action: call-service
service: switch.turn_off
target:
entity_id: switch.butterfly_edfa_rack_seed_laser
card_mod: *estop_amber
- type: button
name: SHUTDOWN
icon: mdi:alarm-light
icon_height: 44px
show_state: false
tap_action:
action: call-service
service: script.butterfly_edfa_shutdown
confirmation:
text: Ramp pump to 0, disable booster, then seed?
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;
}
# ===================================================================
# 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