Advertisement
marine88

Untitled

Sep 9th, 2017
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.97 KB | None | 0 0
  1. automation:
  2.  #turn on bedroom after 20 PM with movement
  3.   - alias: Turn on bedroom light after 20 PM with movement
  4.     initial_state: 'on'
  5.     trigger:
  6.       - platform: state
  7.         entity_id: binary_sensor.motion_sensor_158d00010ef41a
  8.         to: 'on'
  9.     condition:
  10.       - condition: time
  11.         # At least one of the following is required.
  12.         after: '08:00:00'
  13.         before: '07:00:00'
  14.     action:
  15.       - service: light.turn_on
  16.         data:
  17.           entity_id: light.yeelight_rgb_f0b429b7deef
  18.           color_temp: 154
  19.           brightness: 50
  20.  
  21.   #turn off bedroom light when after 3 minutes was no movemnt
  22.   - alias: Turn off bedroom light no movement
  23.     initial_state: 'on'
  24.     trigger:
  25.       - platform: state
  26.         entity_id: binary_sensor.motion_sensor_158d00010ef41a
  27.         to: 'off'
  28.         for:
  29.           minutes: 3
  30.     action:
  31.       - service: light.turn_off
  32.         data:
  33.           entity_id: light.yeelight_rgb_f0b429b7deef
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement