ext_lights_automation.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. input_boolean:
  2. exterior_lights_wanted_state:
  3. name: Exterior lights, wanted state
  4. icon: mdi:lightbulb
  5. ext_light_on_done:
  6. name: Bool switch, Ext light turned ON
  7. icon: mdi:car
  8. ext_light_off_done:
  9. name: Bool switch, Ext light turned OFF
  10. icon: mdi:car
  11. automation:
  12. - alias: Exterior lights ON in evening
  13. description: In the evening, turn the lights ON
  14. trigger:
  15. - platform: numeric_state
  16. entity_id: sensor.lux_outside_the_garage
  17. below: 100
  18. condition:
  19. condition: and
  20. conditions:
  21. - condition: state
  22. entity_id: input_boolean.ext_light_on_done
  23. state: 'off'
  24. - condition: state
  25. entity_id: input_boolean.exterior_lights_wanted_state
  26. state: 'off'
  27. action:
  28. - service: input_boolean.turn_on
  29. data: {}
  30. entity_id: input_boolean.exterior_lights_wanted_state
  31. - service: input_boolean.turn_on
  32. data: {}
  33. entity_id: input_boolean.ext_light_on_done
  34. mode: single
  35. - alias: Exterior lights OFF in morning
  36. description: ''
  37. trigger:
  38. - platform: numeric_state
  39. entity_id: sensor.lux_outside_the_garage
  40. above: 50
  41. condition:
  42. condition: and
  43. conditions:
  44. - condition: state
  45. entity_id: input_boolean.ext_light_off_done
  46. state: 'off'
  47. - condition: state
  48. entity_id: light.exterior_lights
  49. state: 'on'
  50. action:
  51. - service: input_boolean.turn_off
  52. data: {}
  53. entity_id: input_boolean.exterior_lights_wanted_state
  54. - service: input_boolean.turn_on
  55. data: {}
  56. entity_id: input_boolean.ext_light_off_done
  57. mode: single
  58. - alias: Turn boolean switches off at midnight
  59. description: ''
  60. trigger:
  61. - platform: time
  62. at: 00:05:00
  63. condition: []
  64. action:
  65. - service: input_boolean.turn_off
  66. data: {}
  67. entity_id: input_boolean.ext_light_off_done
  68. - service: input_boolean.turn_off
  69. data: {}
  70. entity_id: input_boolean.ext_light_on_done
  71. mode: single