I have over 100 wired motion sensors directly connected to an Elk M1 alarm panel.
I have over 100 Zooz z-wave switches for automating lights.
I have 17 in-ceiling voice assistants with mmWave sensors.
I was hoping that I could use label or area generically and build a single motion activated light automation but it doesn’t appear that automations support labels/areas (sample code)
‘
alias: Motion → Lights ON (ELK + Timers)
description: ""
triggers:
- event_type: state_changed
trigger: event
conditions: - condition: template
value_template: >
{% set e = trigger.event.data.entity_id %} {% set n =
trigger.event.data.new_state %} {{
e is not none
and e.startswith('sensor.elkm1_zone_')
and n is not none
and n.state == 'violated'
}}
actions: - target:
entity_id: "{{ timers }}"
action: timer.cancel - target:
entity_id: |
{{ lights | select('is_state', 'off') | list }}
action: light.turn_on
mode: parallel
variables:
room_labels: "{{ trigger.event.data.entity_id | labels }}"
lights: |
{{ label_entities(room_labels)
| select('search', '^light.')
| list }}
timers: |
{{ label_entities(room_labels)
| select('search', '^timer.')
| list }}
‘