Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. alias: 'Vacation Lighting On'
  2. trigger:
  3. platform: sun
  4. event: sunset
  5. condition:
  6. condition: state
  7. entity_id: alarm_control_panel.home_alarm
  8. state: 'armed_away'
  9. action:
  10. - delay: '{{ "00:" ~ ((range(5, 25) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  11. - service: notify.pushbullet
  12. data:
  13. message: >-
  14. I noticed you're away, so I started to turn on the lamps.
  15. - service: homeassistant.turn_on
  16. entity_id:
  17. - scene.hall_everyday
  18. - service: homeassistant.turn_on
  19. entity_id:
  20. - group.ef_lights
  21. - delay: '{{ "00:" ~ ((range(0, 1) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  22. - service: homeassistant.turn_on
  23. entity_id:
  24. - scene.extension_everyday
  25. - scene.living_room_everyday
  26. - delay: '{{ "00:" ~ ((range(5, 15) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  27. - service: homeassistant.turn_on
  28. entity_id:
  29. - scene.bedroom_everyday
  30.  
  31. alias: 'Vacation Lighting Off'
  32. trigger:
  33. platform: time
  34. at: "22:30:00"
  35. condition:
  36. condition: state
  37. entity_id: alarm_control_panel.home_alarm
  38. state: 'armed_away'
  39. action:
  40. - delay: '{{ "00:" ~ ((range(5, 25) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  41. - service: notify.pushbullet
  42. data:
  43. message: >-
  44. I noticed you're away, so I started to turn off the lamps.
  45. - service: homeassistant.turn_off
  46. entity_id:
  47. - group.lr_lamps
  48. - delay: "00:00:10"
  49. - service: homeassistant.turn_off
  50. entity_id:
  51. - group.ex_lamps
  52. - delay: '{{ "00:" ~ ((range(0, 1) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  53. - service: homeassistant.turn_off
  54. entity_id:
  55. - group.hw_lamps
  56. - group.ef_lights
  57. - delay: '{{ "00:" ~ ((range(5, 15) | random) | int) ~ ":" ~ ((range(5, 55) | random) | int) }}'
  58. - service: homeassistant.turn_off
  59. entity_id:
  60. - group.mb_lamps
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement