home-assistant-configuration/config/scripts/lights.yaml

68 lines
1.6 KiB
YAML
Executable File

#########################################
#
# Light Based Scripts
#
#########################################
# Turn on Living Room Lights if sun is down or cloud coverage is above 70%
livingroom_lamps_on:
sequence:
- condition: or
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- service: scene.turn_on
entity_id: scene.normal_livingroom_lighting
# Turn off Living Room Lights if sun is up and cloud coverage is below 70%
livingroom_lamps_off:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- service: group.turn_off
entity_id: group.livingroom_lamps
good_night_loft:
sequence:
- condition: state
entity_id: media_player.pn60e550_pn60e550
state: "off"
- service: switch.turn_off
entity_id: switch.croft_fan
- service: switch.turn_off
entity_id: switch.croft_light
kitchen_lights_on:
sequence:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '05:30:00'
before: '22:30:00'
- service: scene.turn_on
entity_id: scene.normal_kitchen_lighting
kitchen_lights_night:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '22:30:00'
before: '05:30:00'
- service: scene.turn_on
entity_id: scene.diminished_kitchen_lighting
- delay:
minutes: 18
- service: light.turn_off
entity_id: light.kitchen_cabinets