Create group of motion sensors in groups.yaml
https://www.home-assistant.io/integrations/group/
cellar_motion:
name: Cellar Presence
icon: mdi:motion-sensor
entities:
- binary_sensor.bewegungsmelder_xxx_ias_zone
- binary_sensor.bewegungsmelder_xxx_ias_zone
Next, if you have more than one light you’d like to control, create a group of lights in your configuration.yaml
https://www.home-assistant.io/integrations/light.group/
# Light Groups
light:
- platform: group
name: Cellar Lights
entities:
- light.ikea_of_sweden_tradfri_bulb_e27_ww_806lm_xxx_level_on_off
- light.ikea_of_sweden_tradfri_bulb_e27_ww_806lm_xxx_level_on_off
And finally use both in an automation
alias: My motion activated lights
description: Turn on a light when motion is detected.
trigger:
- platform: state
entity_id: group.cellar_motion
from: 'off'
to: 'on'
condition: []
action:
- service: light.turn_on
target:
entity_id: light.cellar_lights
data: {}
- wait_for_trigger:
platform: state
entity_id: group.cellar_motion
from: 'on'
to: 'off'
- delay: 120
- service: light.turn_off
target:
entity_id: light.cellar_lights
data: {}
mode: restart
max_exceeded: silent # https://www.home-assistant.io/docs/automation/modes/