Resume Scheduled Mode

After looking into modes, I tried to make the switch but came into one main issue. I’m willing to change my workflow if there’s something better, but ultimately for this attempt, I ended up reverting back because I couldn’t get past this issue. Any/all help would be greatly appreciated!

Currently, I have two very simple rules that manage devices based on mode.

  1. When mode changes to away, turn off all lights and turn on inside cameras.
  2. When mode changes to home, turn on a few inside lights and turn off inside cameras.
    (I also have a basic rule for if mode changes to home and it’s night time, turn on flood lights)

The inside cameras are on smart plugs that activate based on the mode changes. The mode changes solely based on presence of 'all gone' or 'any present.'

I want to have a few modes like early morning, daytime, evening, and night. Currently I switched back to only home and away modes. The reason for the switch was the transition between away and whatever mode would have been scheduled. I understand there is a return from away based on time which I believe would solve the scheduling issue. The issue I ran into beyond that, was that devices would activate based on mode change even if we were present.

What I would like to happen is something like this:

  • Away Mode - Turn off lights and turn on cameras
  • Home (go to the proper mode) - Off cameras. IF no one was home, turn on some inside lights.
  • Home (go to the proper mode) - IF dark turn on flood lights with any presence.

Morning - start on extended motion - end around 0830 (945 at latest probably saturday morning)
Daytime - start on multi light and motion activity - end at 2000
Evening - start at 2000 - end at bed (all lights off)
Night - start at bed - end on extended motion

Based on this, I'm going to say I can't really use mode manager to switch modes except for the evening mode (since it's a specific time).


  1. I'm assuming that the mode switching would have to be a rule machine thing since there are conditions that have to be met when switching modes?

  2. How many different rules would I need to accomplish something like this and how would I write something like the "go back to the mode you would have been if we had been home" rule?

  3. The any/no one present thing has somewhat baffled me from the beginning. How can I distinguish between when someone arrives/no one was home and someone arrives/someone already present?

I'm probably overcomplicating it. I can see portions of it (like iF present, turn on flood lights - sunset/sunrise restriction) but I can't get the "full picture" in my head.

Do you not want to change modes at all, or do you just not want to react to the mode changes in a certain way unless the mode transition is (or isn't) a specific one, e.g., mode becomes X but only if more was (or wasn't) just previously Y? You can always take a hybrid approach and use Mode Manager to handle most mode changes but Rule 5.x with a required expression to do things only in response to certain transitions (personally, I don't have Mode Manager do anything for me except the scheduled mode changes; not sure what your actual or desired setup is).

I think I would like to change modes. At least that is what I'm thinking. I've written in two variable switches right now for asleep and pre-morning. During night, the motion lighting is disabled. During Pre-Morning, the motion lighting is dimmed. This works 'most' of the time but is somewhat unreliable (like this morning). The pre morning is set to only switch between 0530 - 0830 but the rule triggered at 0945 and turned it on (despite the required expression being false). I'm thinking modes would be a more solid/reliable fix for this rather than a virtual switch.

I'm thinking I would probably have to run similar to you with mode manager not switching anything but one definite time. Rule machine would probably supplement the rest of the changes.

Please show the rule you are using to do this. Unreliable isn't really a thing, or should I say, that if there is something unreliable we'd like to know what it is so we can correct it.

I'll try to get a log. This morning the log wouldn't go back that far. It was only a few hours, but I guess I had a bunch of activity this morning. Another instance triggered overnight around 1am. By that morning the log was out again. My wife wakes up around 0545 - 0600 so the extended motion happens between those times. I usually sleep later unless I have to go into the office so I would normally get up around 0730 - 0800.

This is a screenshot of the rule. It works most mornings. Maybe I have something that's throwing it off?

A couple of things with your rule.

First you don't really need the IF statement, it doesn't hurt anything but the trigger is the motion sensors going active so it would not be executing the rule unless one of them were active.

I think your wait is backwards. You want to wait for your one of your sensor to stay active for 5 minutes? SO you want to know if motions stays active for 5 minutes. That would seem problematic. I don't know what kind of sensors you have but for one of the three to always be active for 5 minutes could be a long wait. Duration means the rule has to stay true for 5 minutes, before it will continue.

Another potential issue is a wait for event at a certain time. Would have to see the logs but if the wait lasted beyond 8:30 then the rule would be held up at the wait for event, until the next day.

Download the Hubitat app