renemarc/home-assistant-config

View on GitHub
automations/areas/lounge_off.yaml

Summary

Maintainability
Test Coverage
#
# Turn off lounge
#
# Lounge lights should be off when sleeping.
#
# @subscribe input_boolean.night_mode
#
- id: lounge_off
  alias: "Lounge OFF"

  trigger:
    # When night mode is enabled.
    - platform: state
      entity_id: input_boolean.night_mode
      to: 'on'

  action:
    # Turn off binary devices.
    - service: homeassistant.turn_off
      data:
        entity_id:
          - light.lightpack
          - light.rope
          - light.souvenirs
          - light.window

    # Turn off smart lights.
    - service: light.turn_off
      data:
        entity_id:
          - light.aurora
          - light.spotlight
          - light.torchiere
        transition: 10