Hi guys,
I like to generate an automation with a template trigger for every device with a battery when one becomes unavailable.
This should fire a notification with the name of the device
Any ideas to solve this?
I started with this, to generate the trigger.
{{ states.sensor | selectattr('state', 'eq', 'unavailable')
| selectattr('entity_id', 'match', '.*battery*')
| map(attribute='entity_id')
| list }}