I have multiple temperature sensors at home and also devices that I track.
I have a condition in my automation, for example, any temperature below 65, I get a notification.
Also, for devices, if home for 30 minutes, I get notification. Right now I had to do it for EACH device. I believe this can be accomplished by a simple FOR statement, does anyone have any idea?? I would appreciate any assistance on how to accomplish this.
No for statement needed. Create an automation with multiple triggers, one for each sensor. Then in the action you can use the trigger object to find out which sensor triggered the automation.
Show an example of one of these automations please.
Hi @Burningstone I figured it out using the for statement. I created a group for these sensors and used FOR statement.
{% for state in
states|selectattr('entity_id','in',state_attr('group.leaksensors','entity_id'))|selectattr('state','eq','on')|list
-%}{{state.name'}}{%-
endfor %}