#Thanks scottg4898258 for the hint I have

1 messages ยท Page 1 of 1 (latest)

lofty creek
#

FYI, with the magic of #templates-archived you can have a single automation that lists 20 entities in the same trigger, and it'll tell you which one caused the automation to start

#
- service: notify.petunia
  data:
    message: "The {{ trigger.to_state.name }} window is open, you may want to close it"
gloomy shuttle
#

sound exactly what I am looking for ๐Ÿ™‚

#

{{
expand(states.binary_sensor.bad_eg, states.binary_sensor.bad_og, states.binary_sensor.esszimmer)
|selectattr('state', 'eq', 'on')
|map(attribute='name')
|join(',')
}}

lofty creek
#

Yup, and you can do that with groups

#
{{ expand('group.my_exterior_doors')|selectattr('state', 'eq', 'on')|map(attribute='name')|list|join(', ') }}
gloomy shuttle
#

I did this and it works quite fine to see what windows are open, but I somehow fail to reduce it just to the last one so I can send the automation

#

*send the message

lofty creek
#

The #templates-archived channel can likely help with that, you can find out the one that most recently changed state

#

I used to do that, but resorted to "brute force"

gloomy shuttle
#

Oh thats really nice of you sharing this

lofty creek
#

Oh, and you can expand multiple groups in the same command

gloomy shuttle
#

That is going to be step learning curve for me ๐Ÿ™‚

#

Thanks a lot @lofty creek and @midnight pumice for your time and sharing insights

lofty creek
#

I'll be honest, most of my templates are carefully stolen from posts in the #templates-archived channel, or on the forum

#

There's some really smart people over there who do mind blowing stuff with templates - I'm just a hack by comparison ๐Ÿ˜„

gloomy shuttle
#

๐Ÿ™‚ but you are sharing your knowledge and thats all that counts ๐Ÿ™‚