From 36655ac1532fe214cec93504331d0362a2be4345 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Wed, 11 Nov 2026 08:57:11 +0000 Subject: [PATCH] =?UTF-8?q?manatee:=20Alert=20when=20Galleriet=20is=20abov?= =?UTF-8?q?e=2023=C2=B0C=20and=20notify=20both=20phones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a `binary_sensor.galleriet_too_warm` template sensor and an alert that repeats hourly while it's on. Send all Home Assistant notifications through a `phones` notify group so they reach both the Pixel and the iPhone, with a critical alert on iOS for water leaks. --- hosts/manatee/modules/disk-smart/default.nix | 4 +- .../modules/home-assistant/default.nix | 37 ++++++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) 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}'';