This is an evolution of something that used to work rock solid maybe up until some months ago. Since then, I’ve had to correct more and more things, and unfortunately my understanding of the HA yaml is very weak.
Anyways, this seems to work perfectly, for some period of time. But it always fails before about 12 hours.
Can anyone suggest what’s happening? Or even, what’s a good way to troubleshoot this? Ideally I’d like to log triggers and actions, something like that? Here’s my automation yaml. This works after a restart for some period of time, but then fails by the next day.
thanks for any tips
Since the code block doesn’t seem to work very well here’s a pastebin: http://pastebin.com/7Gv7ZuvT
automation:
- alias: "Set dim level dusk"
trigger:
- platform: time
after: "18:45:00" #instantaneously at 8pm only, not 'after'
- platform: state #implicit OR betwen the two conditions
entity_id: light.kitchen
from: 'off'
to: 'on'
- platform: sun
event: sunset # can be sunrise
offset: "-00:30:00"
condition:
condition: and
conditions:
- condition: state
entity_id: light.kitchen
state: 'on'
- condition: time #implicit AND
after: "18:00:00"
before: "21:59:00"
action:
service: light.turn_on
entity_id: light.kitchen
data:
brightness: 50
- alias: "Set dim level 10pm"
trigger:
- platform: time
after: "22:00:00" #instantaneously at 8pm only, not 'after'
- platform: state #implicit OR betwen the two conditions
entity_id: light.kitchen
from: 'off'
to: 'on'
# - platform: sun
# event: sunset # can be sunrise
# offset: "-00:30:00"
condition:
condition: and
conditions:
- condition: state
entity_id: light.kitchen
state: 'on'
- condition: time #implicit AND
after: "22:00:00"
before: "23:59:00"
action:
service: light.turn_on
entity_id: light.kitchen
data:
brightness: 25
- alias: "Set dim level midnight"
trigger:
- platform: time
after: "00:01:00" #instantaneously at 8pm only, not 'after'
- platform: state #implicit OR betwen the two conditions
entity_id: light.kitchen
from: 'off'
to: 'on'
# - platform: sun
# event: sunset # can be sunrise
# offset: "-00:30:00"
condition:
condition: and
conditions:
- condition: state
entity_id: light.kitchen
state: 'on'
- condition: time #implicit AND
after: "00:01:00"
before: "05:45:00"
action:
service: light.turn_on
entity_id: light.kitchen
data:
brightness: 15
- alias: "Set dim level daytime"
trigger:
- platform: time
after: "06:30:00" #instantaneously at 8pm only, not 'after'
- platform: state #implicit OR betwen the two conditions
entity_id: light.kitchen
from: 'off'
to: 'on'
# - platform: sun
# event: sunset # can be sunrise
# offset: "-00:30:00"
condition:
condition: and
conditions:
- condition: state
entity_id: light.kitchen
state: 'on'
- condition: time #implicit AND
after: "06:30:00"
before: "16:30:00"
action:
service: light.turn_on
entity_id: light.kitchen
data:
brightness: 255