Created
November 16, 2025 19:59
-
-
Save SkeLLLa/46c514fde7a86e5977c3e5b170bfe9a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Grid Outage Warning | |
| description: Sends notification 10 minutes before grid outage | |
| triggers: | |
| - trigger: numeric_state | |
| entity_id: | |
| - sensor.time_to_grid_outage // uses custom hour based sensor, but you can use one integration provides in minuts | |
| below: 0.18 | |
| conditions: | |
| - condition: state | |
| entity_id: binary_sensor.grid_power | |
| state: "on" | |
| - condition: state | |
| entity_id: input_boolean.grid_outage_warning_notification // prevents multiple sends | |
| state: | |
| - "off" | |
| - unavailable | |
| - unknown | |
| actions: | |
| - action: telegram_bot.send_message | |
| metadata: {} | |
| data: | |
| config_entry_id: 01JZRDMX3ZH8APPQVNWV0BFYV0 // replace with own TG integration entity | |
| title: ⚠️ Grid Outage Warning | |
| message: > | |
| 🚨 *Grid power outage in 10 minutes\!* | |
| {% if states('sensor.next_outage') != 'unavailable' and | |
| states('sensor.next_outage') != 'unknown' %} Expected outage time: *{{ | |
| as_timestamp(states('sensor.next_outage')) | timestamp_custom('%H:%M') | |
| }}* {% endif %} | |
| {% if states('sensor.next_grid_connection') != 'unavailable' and | |
| states('sensor.next_grid_connection') != 'unknown' %} Expected | |
| restoration: *{{ as_timestamp(states('sensor.next_grid_connection')) | | |
| timestamp_custom('%H:%M') }}* {% endif %} | |
| target: | |
| - "<telegram chat id>" | |
| parse_mode: markdownv2 | |
| - action: input_boolean.turn_on | |
| metadata: {} | |
| data: {} | |
| target: | |
| entity_id: input_boolean.grid_outage_warning_notification | |
| - delay: | |
| hours: 0 | |
| minutes: 20 | |
| seconds: 0 | |
| milliseconds: 0 | |
| - action: input_boolean.turn_off | |
| metadata: {} | |
| data: {} | |
| target: | |
| entity_id: input_boolean.grid_outage_warning_notification | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment