- id: pfv_plant_ups_on_battery alias: PFV plant - UPS on battery triggers: - trigger: state entity_id: - sensor.tsys1_ups_status - sensor.tsys9_ups_status conditions: - condition: template value_template: '{{ ''On Battery'' in states(trigger.entity_id) }}' actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: POWER OUTAGE message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} lost utility power and is ON BATTERY at {{ states(''sensor.'' ~ trigger.entity_id.split(''.'')[1] | replace(''_status'', ''_battery_charge'')) }}% charge.' mode: single - id: pfv_plant_ups_battery_low alias: PFV plant - UPS battery low triggers: - trigger: numeric_state entity_id: - sensor.tsys1_ups_battery_charge below: 40 conditions: - condition: template value_template: '{{ ''On Battery'' in states(trigger.entity_id | replace(''_battery_charge'', ''_status'')) }}' actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: UPS BATTERY LOW message: '{{ trigger.entity_id }} at {{ states(trigger.entity_id) }}% while on battery. Start graceful shutdown of VMs before hypervisors (#455 ordering).' mode: single - id: pfv_plant_ups_comm_lost alias: PFV plant - UPS communication lost triggers: - trigger: state entity_id: - sensor.tsys1_ups_status - sensor.tsys9_ups_status to: unavailable for: 00:05:00 actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: UPS COMMS LOST message: '{{ trigger.entity_id }} unreachable for 5 minutes (nut-server or network path down; tsys1 also hosts pfv-bms itself).' mode: single - id: pfv_plant_ups_runtime_low alias: PFV plant - UPS runtime low while on battery description: On battery and runtime burned below 10 min — the graceful shutdown window is closing. VMs before hypervisors per #455. triggers: - trigger: numeric_state entity_id: sensor.pfv_ups_runtime_minutes below: 10 conditions: - condition: template value_template: "{{ states('sensor.tsys1_ups_status') not in ['Online', 'unknown', 'unavailable'] }}" actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: UPS RUNTIME LOW message: On battery {{ states('sensor.pfv_ups_runtime_minutes') }} min left — start graceful shutdown now (#455 ordering). mode: single - id: pfv_plant_ups_power_restored alias: PFV plant - utility power restored triggers: - trigger: state entity_id: - sensor.tsys1_ups_status - sensor.tsys9_ups_status conditions: - condition: template value_template: "{{ trigger.from_state is not none and 'On Battery' in trigger.from_state.state\n \ and 'On Battery' not in states(trigger.entity_id) }}" actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: Power restored message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} is back ONLINE.' mode: single - id: pfv_plant_high_temperature alias: PFV plant - high temperature triggers: - trigger: numeric_state entity_id: - sensor.pfv_tsys3_nvme_temperature - sensor.pfv_tsys5_nvme_temperature above: 150 - trigger: numeric_state entity_id: - sensor.pfv_tsys4_dimm_18_temperature - sensor.pfv_tsys4_dimm_19_temperature - sensor.pfv_tsys4_dimm_1a_temperature - sensor.pfv_tsys4_dimm_1b_temperature above: 140 - trigger: numeric_state entity_id: - sensor.pfv_tsys1_drive_temperature - sensor.pfv_tsys4_drive_0_0_temperature - sensor.pfv_tsys4_drive_0_10_temperature - sensor.pfv_tsys4_drive_1_0_temperature - sensor.pfv_tsys4_drive_1_10_temperature - sensor.pfv_tsys5_drive_1_0_temperature - sensor.pfv_tsys5_drive_4_10_temperature - sensor.pfv_tsys5_drive_4_20_temperature - sensor.pfv_tsys5_drive_4_30_temperature - sensor.pfv_tsys9_drive_temperature above: 140 - trigger: numeric_state entity_id: - sensor.pfv_tsys3_gpu_temperature - sensor.pfv_jetson_gpu_temperature above: 185 - trigger: numeric_state entity_id: - sensor.pfv_tsys3_pch_temperature - sensor.pfv_tsys9_pch_temperature above: 160 - trigger: numeric_state entity_id: - sensor.pfv_artroom_temperature - sensor.pfv_garage_temperature - sensor.pfv_tsys1_rack_temperature - sensor.pfv_tsys3_cpu_temperature - sensor.pfv_tsys4_ambient_temperature - sensor.pfv_tsys5_ambient_temperature - sensor.pfv_tsys6_cpu_temperature - sensor.pfv_tsys7_cpu_temperature - sensor.pfv_tsys9_cpu_temperature - sensor.pfv_jetson_temperature - sensor.pfv_svrpi_temperature - sensor.pfv_subopi3_temperature - sensor.pfv_subopi_dev_3_temperature - sensor.pfv_subopi_dev_4_temperature - sensor.pfv_tsys6_drac_ambient - sensor.pfv_tsys7_drac_inlet - sensor.pfv_tsys7_drac_exhaust - sensor.pfv_tsys7_drac_cpu1 - sensor.pfv_tsys7_drac_cpu2 above: 104 actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: HIGH TEMPERATURE message: '{{ trigger.entity_id }} is {{ states(trigger.entity_id) }}°F (class threshold exceeded). Check cooling/airflow.' mode: single - id: pfv_plant_sensor_watchdog alias: PFV plant - sensor watchdog (unavailable sensors) description: HA is the environmental brain (#344) — a silent sensor is an outage. Re-alert suppressed by 4h cooldown via last_notified input_text if present. triggers: - trigger: time_pattern minutes: /30 actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: SENSOR WATCHDOG message: >- {% set fleet = states.sensor | selectattr('entity_id', 'match', 'sensor\.pfv_') | list %} {% set dead = fleet | selectattr('state', 'in', ['unavailable', 'unknown']) | list %} {% if dead | length > 0 %} {{ dead | length }} of {{ fleet | length }} fleet sensors silent: {{ dead | map(attribute='entity_id') | join(', ') }} {% else %} all {{ fleet | length }} fleet sensors OK {% endif %} mode: single - id: pfv_plant_temp_rising_fast alias: PFV plant - temperature rising fast (rate-of-change) description: Catches dead AC minutes before the 104F threshold trips. triggers: - trigger: state entity_id: - binary_sensor.server_room_temp_rising - binary_sensor.tsys6_ambient_rising - binary_sensor.tsys7_inlet_rising - binary_sensor.garage_temp_rising to: "on" for: minutes: 2 actions: - action: notify.send_message target: entity_id: - notify.ultix_sidecar_new - notify.allthes_ipad data: title: TEMP RISING FAST message: '{{ trigger.entity_id }} climbing ~10F/15min — check cooling before the 104F threshold. (rate-of-change early warning)' mode: single