Mode control and time offsets no consistent?

I’m poking around with my new hub, looking to see what’s where and ran across a problem.

In setting up the Mode Manager for Night, At a Specific Time and then entering 10pm, when I switch back the list of all the modes the time shows as 5pm. If I go back in and edit the item, it still has my entered time of 10pm. I happen to be on Eastern Standard Time here (-5 offset) but that wouldn’t explain the shift, as 10pm here is going to be 3am UTC, not 5pm. I’m guessing the code to handle showing me the time isn’t getting it right?

One curious question about modes is how to deal with a mode where only some people (like small kids, or those that turn in early) are asleep and then the ‘not a creature was stirring’ when even the night owls have turned in. Perhaps leading to a Day, Evening, Bedtime, Night sort of collection of modes? I don’t “need this” right now, but it’s been a factor I’ve worked around before and no other systems really handle it well either.

And for those with young kids, oh wouldn’t we LOVE to have a ‘Nap time’ mode that deliberately silences or otherwise ‘dummies up’ ANYTHING that might dare make noise…

Since you have a new hub, let’s try a quick fix. Remove mode manager. Reboot hub. Check for updates in settings, do update if available and then try mode manager again.

I may have another factor, when I look at the Device Events log, I’m seeing a jump in the timestamps from 6pm time ranges to then 10pm. If the list is recent-on-top then my hub may think it’s 10pm when it’s now actually 6pm EST?

I’m removing/rebooting now.

Hmmm, I’m still looking for the Mode manager… but happened to notice Location Events timestamps aren’t quite right either.

sunsetTime 2018-02-25T22:57:00.000Z API 02/24/2018 10:56 PM

We’re not quite the “land of the midnight sun” here in Maryland… so that’s not quite right. Right now sunset here is 5:55pm (according to Alexa, anyway).

Right, couldn’t find Mode Manager at all. When I went back into the Apps page it was an available app to add, but it wasn’t already added. Perhaps when I ran into that 10pm/5pm problem I didn’t actually complete the ‘Add’ sequence, or something. Rebooting anyway.

Are you on the latest version? Hopefully the reboot should fix it. Also check your location info.

When I go into my Location page it does show my proper lat, long, sunrise and sunset info. Right now it’s 6;50pm local time and my mode here on the location page says Day.

I just re-added Mode Manager (and completed the addition) and it appeared to bring back my old settings. So removing the App didn’t also remove the settings. Could be useful, either way, so an option to delete settings would seem useful.

It came back with the same 5pm time. I went in and removed that mode and recreated it. NOW is has the right time on both views.

If I have Mode Manager now configured to trigger Evening at Sunset -30 minutes, and it’s 6:55pm now (an hour after current local sunset) should it have automatically changed the Mode on the Location page?

I hate to rapid-fire the comments here, so don’t get the wrong impression. I’m not looking to be deliberately critical. I’ve used a TON of other systems over the years and know where to look for things that have bitten me in the butt in the past. Getting TIME correct, yeah, that’s kinda important, so I’m poking at that first…

No, it is event driven. You can of course manually change the mode on the Location page. But if it wasn't running at the time the event occurred, nothing happened.

You could do this same thing in Rule Machine, and it would catch the time being 6:55 when you added the rule, and set the mode accordingly. Different logic between Rule Machine and Mode Manager, I should qualify that to say, depending on how you defined the rule in Rule Machine. A trigger just happens as an event; while a rule tests a condition.

Rebooted and the Location page still says Day for the mode.

My Location Events page still has the incorrect 10pm times on it.

Some systems have a ‘roll up’ function for handling power outages and the like. Is Mode Manager’s time of day handling only going to execute when that exact time comes to pass while the hub is active?

Yes, it will only run at the time of day it is set for. It doesn’t look back, nor does it inspect the current time. The events in Location Events are from the past (which in your case looks like it’s in the future).

Here is an example of a rule in Rule Machine that would have caught that it had passed sunset, and still set the mode correctly when it was installed (hitting Done).

Probably should have used something like 11:00 PM for then ending time. But you can get the idea.

One might expect that if the device boots at a certain give that it would at least check to see if it’s within one of the established time ranges. Especially since Rule Machine doesn’t load by default. I’ve not yet gotten to loading RM yet, to see what it loads by default.

Rule Machine doesn’t load anything by default. Read about it here: Rule Machine™ Introduction

Mode Manager is a relatively simple app. It is entirely event driven. It makes no effort to establish context of the time in which it is installed. Certainly, it could do that had the designer implemented that feature. That’s not to say it is not important, it’s just that you install it, and it starts doing it’s thing as events unfold.

Before Mode Manager existed, Rule Machine could be used to create rules or triggers to set modes. What is the difference? A rule tests some conditions under a logical rule to determine if an action should happen. A trigger fires upon an event and an action happens. One could set modes with a trigger: At sunset set the mode to evening. If that trigger were installed ten minutes after sunset, nothing would happen, because it would only do its action at the sunset event. A rule could set modes also, as I posted above. If that rule were installed ten minutes after sunset, it would set the mode to evening because Rule Machine evaluates the logic of a rule when it is installed. The rule would have been true at ten minutes after sunset, so it would have set the mode to evening when installed. From then on, going forward, that rule would be event driven just like the trigger. The next time sunset happens, it would evaluate the rule, which would be true (having become false at then end of the time period specified), and it would again set the mode to evening. Since both the trigger and the rule are effectively just being fired by the event, it’s simpler to just use the trigger. Mode Manager is simple an aggregation of several types of triggers into one UI.

Make sense, thanks for the detail.