They are all supposed to be on; but if one (ore multiple) is turned off, notify like Attention! {{ trigger.to_state.friendly_name }} should be on, but is off!.
I cannot actually use trigger.to_state.friendly_name, because the trigger is time_pattern, not any entity.
Currently, I have one automation per entity, then hardcode the notification message. But I’m sure there is a way to do this more elegantly, I just don’t know how. Can you help me solve this?
In this case, I need the time_pattern so that the automation will work even after restarting Home Assistant.
Let’s say I have a plant.bonsai that has an attribute moisture_status; this will change to Low when the plant needs to be watered. But I’d like a constant reminder to do so, until it has been done.
In this case, I’d check every 30 minutes whether the state is like this, and, if so, send a notification. If not, don’t do anything.
If I were to restart Home Assistant, it wouldn’t “remember” when the plant entity has reported Low, so it cannot act on for: minutes: 30.
{% set entities = [
'binary_sensor.test01',
'input_boolean.test02',
'binary_sensor.test_contact'
] %}
Attention!!
The folowing entities should be OFF, but they are ON:
- {{ expand(entities) | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | list | join('
- ')}}