Skip to content

Commit 6137702

Browse files
Add full automation example
1 parent d98511c commit 6137702

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,32 @@ Installation via HACS is recommended, but a manual setup is supported.
4343
</details>
4444

4545
## Tips
46-
To create a notification message listing the entities use the state_attr, replacing the binary sensor with your own.
46+
47+
Use the example below to create a notification automation listing the entities use the state_attr, replace the binary sensor with your own.
48+
I like to have the trigger only activate if a labelled sensor has been unavailable for 5 minutes to avoid any planned restarts falsely triggering the automation.
4749

4850
```
49-
action: persistent_notification.create
50-
metadata: {}
51-
data:
52-
message: >-
53-
Critical sensors are unavailable {{
54-
state_attr('binary_sensor.critical_sensors_unavailable', 'entities') |
55-
join(', ') }}
51+
alias: Critical Sensors Unavailable
52+
description: ""
53+
triggers:
54+
- trigger: state
55+
entity_id:
56+
- binary_sensor.critical_sensor_notification
57+
to: "on"
58+
for:
59+
hours: 0
60+
minutes: 5
61+
seconds: 0
62+
conditions: []
63+
actions:
64+
- action: persistent_notification.create
65+
metadata: {}
66+
data:
67+
message: >-
68+
Critical sensors are unavailable {{
69+
state_attr('binary_sensor.critical_sensor_notification', 'entities') |
70+
join(', ') }}
71+
mode: single
5672
```
5773

5874
### Translations

0 commit comments

Comments
 (0)