The following state will evaluate to true in the template editor if I go change the value of sensors.time in the states. {{ states.sensor.time.state == states.sensor.wakeup_alarm_start_time.state }}
However, the automations don’t get triggered. Looking through the log book, the Time state is updated at really random intervals.
Here is my current code. I’ve consolidated a lot of the time calculations into a couple of template sensors to make the comparison operation in the trigger value_template a bit quicker. However, again, changing the time doesn’t fire off the automation. Hell, even the minutes: '/1' automation isn’t going off every minute.
Can anyone help me figure out what is going on here?
Yeah, I just wasn’t sure if you were using internet time which has a slightly different interval. Anyways, On to your issue. Can you verify the state of states.sensor.wakeup_alarm_start_time.state and states.sensor.time.state? If they both have the “%H:%M” format, then I would look towards your condition.
Also, I would avoid using the ‘/1’ time trigger because it can bog down your system.
EDIT: What I mean when I say ‘look towards your condition’, I mean: Verify that the binary workday sensor is working as expected.
Here’s a test you could perform live, Try making a template sensor with the same code that you’d use for the template trigger. See if it responds when you change the input datetime to match the current time. It should respond immediately. If that works, then it should also work for your triggers.
Now the logical operation is true.
Something I also noticed was that the operation would evaluate false if the time were set to “4:30” without the leading zero. So, I double-checked my logbook, and the times are 00:00 formatted.
I’m in UTC-6, though. So, if it were going back to UTC, it would be 10:30. And just for safe measure, I checked the date on the system itself, and it’s got the correct time. (Mon Jun 11 14:32:16 CDT 2018 when I ran date.)
Which is fine. I keep all of my clocks in that format anyways. the 14.5 and 4.5 values are what threw me off. It looks like those values still came out right.
Are you sure that the root of your problems is that automation? Have you checked your logs for errors. Not the log page, but the home assistant logs text file
I’m glad you reminded me of that. I’ve got Home Assistant feeding into Splunk with the Home Assistant Splunk App. I’m not entirely sure how useful the output will be, but it’s one more source of data for troubleshooting.
I’ve noticed a lot of ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending! errors in the log file. Any ideas?
The Hue has been having issues for a while now. It just pops on and offline. Not sure what it’s deal is. I’ve got to do an RF scan in my house to see if there’s some sort of Zigbee/Wifi interference and if I need to change channels for stuff. Even if the Hue was offline, the automation still would have triggered, and my TV would have come on.
The automation was supposed to fire at 04:30, but there’s not even an error at that time. Which tells me that it didn’t get get triggered.
I think you should turn debugging on in the logs to see all logs. Set the alarm to a close time and see what events fire in the log. They may actually be on the ‘info’ log level to be honest, i don’t remember.