updates
This commit is contained in:
31
packages/light/light_night_automation.yaml
Executable file
31
packages/light/light_night_automation.yaml
Executable file
@ -0,0 +1,31 @@
|
||||
input_boolean:
|
||||
lights_needed:
|
||||
name: Lights needed
|
||||
initial: false
|
||||
|
||||
|
||||
automation:
|
||||
- alias: lights_needed
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: time_pattern
|
||||
minutes: "10"
|
||||
action:
|
||||
- if:
|
||||
# Resets at midnight -> OR instead of AND
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: sun
|
||||
after: sunset
|
||||
after_offset: "-01:00"
|
||||
- condition: sun
|
||||
before: sunrise
|
||||
before_offset: "+01:00"
|
||||
then:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.lights_needed
|
||||
else:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.lights_needed
|
Reference in New Issue
Block a user