# Require: https://github.com/jmgiaever/home-assistant-blueprints/blob/master/automation/motion_detected_lights.yaml automation: - id: 'inner_living_room_motion_active_lights' alias: 'Inner living room: Motion active lights' use_blueprint: path: motion_detected_lights.yaml input: trigger_sensors: - binary_sensor.inner_living_room_motion_sensor_home_security_motion_detection synced_lights: - light.inner_living_room_chandelier_light illuminance_sensors: - sensor.inner_living_room_motion_sensor_illuminance illuminance_threshold: 10 after_wait_actions: - wait_template: "{{ is_state('input_boolean.housekeeping_mode', 'off') }}" # Our living rooms are «open» between. Wait until motion in both are off to turn off the lights - wait_template: "{{ is_state('binary_sensor.living_room_motion_sensor_home_security_motion_detection', 'off') }}" wait_actions_before_dim: false delay: 15