home-assistant.io/source/cookbook/automation_sun.markdown
Paulus Schoutsen 67adc41bf9 Add cookbook
2015-10-09 09:34:13 -07:00

855 B

layout, title, description, date, sidebar, comments, sharing, footer
layout title description date sidebar comments sharing footer
page Automation examples using the sun Automation examples that use the sun. 2015-10-08 19:05 false false true true

Turn on the living room lights 45 minutes before sunset if anyone home

automation:
  trigger:
    platform: sun
    event: sunset
    offset: "-00:45:00"
  condition:
    platform: state
    entity_id: group.all_devices
    state: home
  action:
    service: homeassistant.turn_on
    entity_id: group.living_room_lights

Natural wake up light

Note, Philips Hue is currently the only light platform that support transitions.

automation:
  trigger:
    platform: time
    after: "07:15:00"
  action:
    service: light.turn_on
    entity_id: light.bedroom
    data:
      # 900 seconds = 15 minutes
      transition: 900