Notify for entities ON if I leave home

Hello there,
I’m trying to ideate an automation that notifies me if I leave some appliances on when I leave home.
Is there a way to check all lights/switches entities without using groups? Otherwise, I’ll have to manually add lights/switches to a group.
Also, how can I list the appliances ON in the notification service? For ex. a Telegram message reporting all the devices ON.

Thanks for the suggestions!

Copy-paste this into the Template Editor and experiment with it.

{{ expand(states.light, states.switch)
   | selectattr('state', 'eq', 'on')
   | map(attribute='name') 
   | list | join(', ') }}

It can be used in an automation or Template Sensor.

1 Like