My power went out yesterday for a few seconds. Afterwards, the system ignores the mode changes (set according to times of day), and therefore all the rules for automated lighting are off. I thought the power interruption had affected the location, because the mode this morning was still set to NIGHT instead of DAY (set to 6:00AM); but upon inspecting the location settings in the hub I found they were correct (yet the mode was still set to NIGHT instead of DAY). I rebooted the hub to see if this would fix the issue, but nothing changed, mode was still set to NIGHT even though it was still supposed to be set to DAY. I also tried setting the hub to a different location, saving this setting, and then setting it back to the correct location, but this didn't work either. Anybody else experienced this/know how to fix it?
How do you set modes? With Mode Manager or with Rule Machine?
I use mode manager, set to change based on time of day (which was ignored after the blackout even though the location was still correct).
Ok, a few more questions:
DAY mode was supposed to go active at 6 am.
When was the blackout and when was power restored?
Yesterday afternoon, while the mode was in DAY mode. I also just checked the system events, and discovered that the alarm also failed to arm itself last night, which I have set according to the mode change to NIGHT. The system stayed in DAY mode after the blackout. I was not aware of this until now.
Ok,
the way Mode Manager works with a Time of Day configuration is that it creates scheduled commands, in your case let's say NIGHT was supposed to go active at 7 PM.
- Mode Manager will create a scheduled task for 7 PM.
- If the hub is off, let's say from 6:30 PM and 7:30 PM, it will obviously "miss" the scheduled command for 7PM.
- Once the hub reboots, it won't executed all of the commands that were in the past as this could have a lot of bad side effects (think about turning a AC on and off multiple times in a short period of time, your HVAC company will be happy with all the money you will give them)
Instead, Mode Manager will schedule a new command for the next configured time period.
Mode Manager is very simple when it comes to how it acts, it won't check if you are in between two scheduled events and adjust the mode automatically since you could have also changed the mode manually and it can't tell the difference
Does that make sense? There are of course ways around that, as in using Rule Machine to do simple Mode Manager tasks, however, that will come with other side effects especially if you mix in modes based on presence.
OK, this makes sense. Only problem is the blackout happened yesterday afternoon, around 4 hours before the mode was set to change at 7:00PM. The hub and the system were active during the scheduled mode change. However, I just now tested the system by setting the mode change for NIGHT to an arbitrary time a couple of minutes ago, and the mode changed to NIGHT as scheduled, which follows your explanation of how the mode changes work. It still does not account for the interruption since yesterday (since the blackouts could not have affected it) but at least the system is working properly now. I will set it back to change tonight and report back. Thank you so much for your help!
I can only assume here but one thing we have seen is that after a blackout, the hub boots but the internet connection is not up yet so the hub can't get the current time from the internet and thinks it is at a different time. Routers often take a longer time to boot. That has cause scheduled actions to be missed but it corrected itself when the internet connection came back up.
Again, this is just an assumption though as it is too late to see if that was actually the case
You are correct, however I was online during the "mini blackout" (it lasted literally just a few seconds) and yes, the router did take a few minutes to reboot but it was online and working hours before the mode change. Another thing I noticed was that the simple lighting rules I had set up for my porch light (off at sunrise, on at sunset) were also ignored (light stayed off even after the sunset). The simple lighting rules should not have been affected by the mode change not happening, right?
That almost sounds like the time was wrong on the hub after the blackout. That could cause your issues with Mode Manager and Simple Lighting
I just checked the system events and the logs, and all entries stop at 4:34 PM (the time of the mini blackout). They resume this morning, when I manually had to change the mode to DAY (sometime at around 8:40 AM) when I saw the porch light was still on. Other actions I took last night after 4:34 PM (manually setting the alarm, manually turning on the porch light) do not appear at all. Strange, no?
They also resume I guess because I rebooted the hub this morning thinking that was the issue. Somehow the time was frozen after the blackout?
I think it was just wrong, not frozen. It got an "old" time and you don't see it in the events as the events table is sorted by time.
OK. Everything should be back to normal tonight given the test I performed and the log/events showing activity with the correct time currently. Strange that since obviously the hub had to have rebooted after the blackout this problem persisted, yet the reboot I performed this morning fixed it? Could it be related to the hub rebooting before the router was done establishing an internet connection after the blackout?
On reboot, it would have gotten the correct time.
Yes, that is exactly what I am saying. The hub rebooted while the internet connection was down. It couldn't get the correct time. For this explanation, just assume that it was running with a 1/1/1900 00:00:00 when it rebooted after the blackout. Then you rebooted the hub again when the internet connection was up and the hub was able to get the correct time on boot and everything started to work again as expected
There's another thread around this area and people talking about using a local NTP server to stop this being an issue.
Also I think I read somewhere that the support team had recognised this issue and there may be a fix coming.
N
Knowing me I probably dreamt it though.
In theory, couldn't they add some code to ensure the hub tries to reboot repeatedly until it gets the correct time (up to a limit of cycles to prevent a lockout/freeze)? This suggestion comes from watching The Matrix and THX1138, so take it with a grain of salt!
I would hate that!!!!! Any automatic reboot is a bad solution as the user loses control of the actions of the hub. Better solution is to connect the hub a UPS to survive a brief power outage and not doing the reboot at all
I see. I thought I was addressing a lockout by limiting the number of retries if no connection is detected.
A user is more than welcome to setup an external script (in node-red or other) to reboot their hub any time they want. No need to wait for Hubitat for that...