#Way to exclude lights from automation

1 messages · Page 1 of 1 (latest)

quiet hull
#

I've been experimenting with automations in automation, and recently started making a "reset" automation which turns off all the lights downstairs at a certain time in the evening.

However, my garage light (which has its own automation) is on a motion sensor. This has been causing issues because if I'm working in the garage when the "reset time" hits, I'm left in the dark.

Is there a clean way to exclude a single light from an automation when targeting devices using the "area"? Or is there a better way to accomplish what I'm trying to do in general?

lost lance
#

how many devices are there in your area? Why not just add each individual entity in your automation instead and omit that one device?

rigid current
#

In the future there will hopefully be some functionality added to the UI to do what you want. But until then, there are templates.


action: light.turn_off
target:
  entity_id: >
    {% set garage_lights = area_entities('Garage') | select('match', '^light.') %}
    {% set reject_list = ['light.motion_light'] %} 
    {{ difference(garage_lights, reject_list) }}

Copy the template portion and paste it into developer tools -> templates and play with it until you get the result you want. Then try the code out in developer tools -> actions and make sure it works

quiet hull
quiet hull
brave scroll
#

I'm switching off the lights per room myself, usually there won't be many new rooms coming per year. 🙂