add main power off notification

This commit is contained in:
Pierre committed 2026-11-05 22:33:40 +01:00
1 parent 2c87c6a6f3
commit 42ae8f4bc4
3 files changed
+16 -1

No files matched your search

+13
View File
@@ -38,3 +38,16 @@ notifications_manager:
title: Pluie prévue sur votre trajet title: Pluie prévue sur votre trajet
content: "Il va pleuvoir dans {sensor.commut_rain_minutes_until_rain} minutes" content: "Il va pleuvoir dans {sensor.commut_rain_minutes_until_rain} minutes"
power_off_notification:
recipients:
all:
services:
- notify/mobile_app_iphone_de_pierre
- notify/mobile_app_mae
conditions: binary_sensor.main_power_off and not binary_sensor.someone_home
message:
title: Coupure de courant
content: Le courant a été coupé
auto_clear: true
+2
View File
@@ -82,6 +82,8 @@ virtual_sensors:
event_data: event_data:
entity_id: sensor.shelly_button_red_signal_strength entity_id: sensor.shelly_button_red_signal_strength
binary_sensor.main_power_off: sensor.ups_code_d_etat != 'OL'
# living room sensors # living room sensors
value_selector.living_room_ambiance_light: value_selector.living_room_ambiance_light:
values: values:
+1 -1
View File
@@ -3,7 +3,7 @@ import appdaemon.exceptions as ad_exception
import ad_toolbox.smartcondition as SmartCondition import ad_toolbox.smartcondition as SmartCondition
import re import re
import uuid import uuid
from expressionparser import ParsingException from ad_toolbox.expressionparser import ParsingException
class Notification: class Notification:
ENTITY_PLACEHOLDER_PATTERN = re.compile(r"\{([^{}]+)\}") ENTITY_PLACEHOLDER_PATTERN = re.compile(r"\{([^{}]+)\}")