# Home Assistant automations — SUPERVISORY layer only (HA 2024.10+ syntax). # Hard protection lives in the hardwired coil chain and on the ESPHome node. # Entity IDs are examples. number.mining_fleet_power_target is whatever your # miner/EMS integration exposes for the fleet power limit (W). - alias: "Mining – power target follows SOC (0 W ≤65 %, ramps to full at 80 %)" mode: restart triggers: - trigger: state entity_id: sensor.bess_state_of_charge actions: - action: number.set_value target: entity_id: number.mining_fleet_power_target data: value: > {% set soc = states('sensor.bess_state_of_charge') | float(0) %} {{ (11000 * ([0, (soc - 65) / 15, 1] | sort)[1]) | round(0) }} - alias: "Mining – hard shed below 40 % SOC (backs up the hardwired contact)" triggers: - trigger: numeric_state entity_id: sensor.bess_state_of_charge below: 40 actions: - action: switch.turn_off target: entity_id: switch.thermal_node_01_mining_bus_enable - action: notify.engineering_alert data: message: "Mining bus shed: BESS SOC {{ states('sensor.bess_state_of_charge') }} %" - alias: "Mining – re-enable at ≥75 % SOC with solar surplus" triggers: - trigger: numeric_state entity_id: sensor.bess_state_of_charge above: 75 for: "00:10:00" conditions: - condition: state entity_id: binary_sensor.thermal_node_01_mining_interlock_fault state: "off" - condition: numeric_state entity_id: sensor.pv_surplus_kw above: 2 actions: - action: switch.turn_on target: entity_id: switch.thermal_node_01_mining_bus_enable - alias: "GPU batch (T2) – graceful park below 50 % SOC" triggers: - trigger: numeric_state entity_id: sensor.bess_state_of_charge below: 50 actions: - action: script.gpu_checkpoint_and_shutdown # IPMI/Redfish soft-off after job checkpoint - action: notify.engineering_alert data: message: "T2 GPU node parked at SOC {{ states('sensor.bess_state_of_charge') }} %" - alias: "Heat routing – send heat to the load when there is demand" triggers: - trigger: numeric_state entity_id: sensor.secondary_loop_return_temp # °C below: 40.5 # 105 °F → load is drawing heat for: "00:02:00" conditions: - condition: state entity_id: binary_sensor.thermal_node_01_loop_supply_high_temp_warning state: "off" actions: - action: number.set_value target: entity_id: number.thermal_node_01_diverter_valve_to_dry_cooler data: value: 0 - alias: "Leak detected – isolate RDHx and alert" triggers: - trigger: state entity_id: binary_sensor.rack_leak_rope to: "on" actions: - action: valve.close_valve target: entity_id: valve.rdhx_isolation - action: notify.engineering_alert data: message: "LEAK at IT rack — RDHx isolated"