hello, i’ve an automation made with the web ui that will send a notification via telegram if the group.door_sensors is on, that mean if at least one door is open it will send a generic notification, i would like to update this with the list of the sensors that are on, do you have any suggestion on how to change this automation to loop throu all the sensors in the group door_sensors and save the list of sensors with state open and append it to a telegram message?
thank you so much, i’ve edited your code like this:
- data:
message: >
hai lasciato aperto: {% for item in expand('group.door_sensors') %}{% if
item.state == 'on' %}{{ item.name}}, {% endif %}{% endfor %}
service: notify.telegram
and it seems pretty ok, i have added > in the mssage to be able to have spaces, unfortunatelly i can not format the code better otherwise i have new line or other spaces in it.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.