Skip to content

Instantly share code, notes, and snippets.

@smarthomehobby
Created July 29, 2018 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarthomehobby/afeaf09706928918eaff4c3fd89679e8 to your computer and use it in GitHub Desktop.
Save smarthomehobby/afeaf09706928918eaff4c3fd89679e8 to your computer and use it in GitHub Desktop.
# This part goes in automations.yaml
- id: night_living_room
alias: Nighttime Living Room
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d0001e59f8e
from: 'off'
to: 'on'
action:
service: homeassistant.turn_on
entity_id:
- script.living_room_night
# This part goes in scripts.yaml
living_room_night:
alias: Living Room Night
sequence:
- service: homeassistant.turn_on
entity_id: light.lamp
data:
brightness_pct: 15
color_temp: 310
- wait_template: "{{is_state('binary_sensor.door_window_sensor_158d0001e59f8e', 'off')}}"
- service: homeassistant.turn_off
entity_id:
- light.lamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment