Advertisement
boelle11

Untitled

Mar 9th, 2021
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. # Example automation using snapshot
  2. - alias: "Window opened"
  3. trigger:
  4. - platform: state
  5. entity_id: binary_sensor.window
  6. from: "off"
  7. to: "on"
  8. condition: []
  9. action:
  10. - service: scene.create
  11. data:
  12. scene_id: before
  13. snapshot_entities:
  14. - climate.ecobee
  15. - light.ceiling_lights
  16. - service: light.turn_off
  17. target:
  18. entity_id: light.ceiling_lights
  19. - service: climate.set_hvac_mode
  20. target:
  21. entity_id: climate.ecobee
  22. data:
  23. hvac_mode: "off"
  24. - alias: "Window closed"
  25. trigger:
  26. - platform: state
  27. entity_id: binary_sensor.window
  28. from: "on"
  29. to: "off"
  30. condition: []
  31. action:
  32. - service: scene.turn_on
  33. target:
  34. entity_id: scene.before
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement