diff --git a/hosts/manatee/modules/disk-smart/default.nix b/hosts/manatee/modules/disk-smart/default.nix index 6705594..276a207 100644 --- a/hosts/manatee/modules/disk-smart/default.nix +++ b/hosts/manatee/modules/disk-smart/default.nix @@ -107,7 +107,7 @@ ${sectorEntitiesYaml} - condition: template value_template: "{{ trigger.from_state.state | int(-1) >= 0 and trigger.to_state.state | int(0) > trigger.from_state.state | int(0) }}" action: - - service: notify.mobile_app_pixel_9_pro + - service: notify.phones data: title: "Disk SMART warning" message: "{{ trigger.to_state.attributes.friendly_name }} increased from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}" @@ -120,7 +120,7 @@ ${smartPassedEntitiesYaml} - condition: template value_template: "{{ trigger.to_state.state | lower == 'false' }}" action: - - service: notify.mobile_app_pixel_9_pro + - service: notify.phones data: title: "Disk SMART FAILURE" message: "{{ trigger.to_state.attributes.friendly_name }} reports SMART failure — drive is likely failing" diff --git a/hosts/manatee/modules/home-assistant/default.nix b/hosts/manatee/modules/home-assistant/default.nix index abffca6..5eb0cd0 100644 --- a/hosts/manatee/modules/home-assistant/default.nix +++ b/hosts/manatee/modules/home-assistant/default.nix @@ -51,6 +51,23 @@ recorder: system_log: fire_event: true +notify: + # Send notifications to `phones` so they reach every phone + - platform: group + name: phones + services: + - action: mobile_app_pixel_9_pro + - action: mobile_app_iphone + +template: + - binary_sensor: + - name: Galleriet too warm + unique_id: galleriet_too_warm + state: "{{ states('sensor.3rd_temp_och_fuktmatare_temperature') | float(0) > 23 }}" + availability: "{{ has_value('sensor.3rd_temp_och_fuktmatare_temperature') }}" + # Stops a temperature hovering around 23 from re-triggering the alert + delay_off: "00:15:00" + alert: fridge_door: name: Fridge is open @@ -60,7 +77,7 @@ alert: repeat: 2 skip_first: true notifiers: - - mobile_app_pixel_9_pro + - phones kitchen_water_leak: name: Water leak detected in the kitchen @@ -69,12 +86,28 @@ alert: state: "on" repeat: 5 notifiers: - - mobile_app_pixel_9_pro + - phones data: ttl: 0 priority: high # Plays on the alarm stream so it sounds even when the phone is silenced channel: alarm_stream + # iOS equivalent: a critical alert, which bypasses silent mode and Focus + push: + sound: + name: default + critical: 1 + volume: 1.0 + + galleriet_too_warm: + name: Galleriet is above 23°C + message: "Galleriet is {{ states('sensor.3rd_temp_och_fuktmatare_temperature') }}°C" + done_message: Galleriet is below 23°C again + entity_id: binary_sensor.galleriet_too_warm + state: "on" + repeat: 60 + notifiers: + - phones ${cfg.extraConfig}'';