living_room_lights.yaml 1022 B

123456789101112131415161718192021
  1. # Require: https://github.com/jmgiaever/home-assistant-blueprints/blob/master/automation/motion_detected_lights.yaml
  2. automation:
  3. - id: 'living_room_motion_active_lights'
  4. alias: 'Living room: Motion active lights'
  5. use_blueprint:
  6. path: motion_detected_lights.yaml
  7. input:
  8. trigger_sensors:
  9. - binary_sensor.living_room_motion_sensor_home_security_motion_detection
  10. synced_lights:
  11. - light.living_room_chandelier_light
  12. - light.living_room_piano_light
  13. #illuminance_sensors:
  14. # - sensor.living_room_motion_sensor_illuminance
  15. #illuminance_threshold: 10
  16. after_wait_actions:
  17. - wait_template: "{{ is_state('input_boolean.housekeeping_mode', 'off') }}"
  18. wait_actions_before_dim:
  19. # Our living rooms are «open» between. Wait until motion in both are off to turn off the lights
  20. - wait_template: "{{ is_state_attr('automation.inner_living_room_motion_active_lights', 'current', 0) }}"
  21. delay: 15