Rules keeps changing the mode setting

I have a couple rules set up that turn certain lights on and off at set times, if I'm not home. The way it's supposed to work is I have a conditional rule that if the mode is set to away to then proceed (turn the light on, or turn it off, etc, a separate rule for each). If the mode is not set to away, it should then ignore the rest of the rule.

I'm finding that for some reason, when the time comes, instead of checking if the mode is set to away, it's changing it to that, then switching the light.

Please share a screen capture image of your rule.

According to the logs, it changes from Home to Away at the same time it runs the rule, in this case 10:02PM (22:02). My phone is the only thing that Hubitat is set to look at to change the mode, and it's been sitting here in the house with me the entire time.

And it did the exact same thing for the other rules to turn lights on or off (two others).

Turn on logging for this rule. Save your changes, then "Run Actions" and post the logs.

Also post a screen shot of the relevant portion of your existing logs that shows the mode changing.

1 Like

I give up.

I went to the rule, and hit Run Actions, to test it, and it still did it. So I went in and turned on logging. Also went to the Mode manager app and set it to allow logging. No other changes to anything, and now it's working like it should. I turned logging back off to see if that might be it for some bizarre reason, and it's still working.

I'll turn logging back on, and see if it does it again.

1 Like

why are you using the mode manager app. if you are not changing the mode with it.. that may be your issue.

I am using it to change the mode.

The way this is supposed to work is Mode Manager changes the mode based on if my phone is home or not. In the mean time, the rules in question all turn certain lights on or off at certain times, but only if the mode is set to away. The problem was that at the designated time, it was running the rule, and the mode was being changed, even though it's not supposed to be, and my phone has not left the house at all.

Looks like it's back to acting up, but no explanation this time, yet.

Looking at the logs below, just so you can follow along, there is a rule about turning on the kitchen lights, another about turning them off, however for the moment, it actually turns the entry way light on and off. That's temporary while I'm still setting everything up. Also, you will see something called Mode Detect. That's a virtual switch that turns on or off depending on the mode, so I can easily see what mode it's in from my phone.

In the log, at 11:34 PM (23:34) it turned on the entry light, and I immediately turned it off. There is no rule that is set to operate anything at that time, however, there is one that if I'm away, when i arrive home, it turns that light on. At 11:55, there is a log entry showing that it properly caught and didn't activate the light. But I'm noticing that at 11:27 it changed the mode to Home, which it should have been already, then at 11:34 it changed it to away. Since my phone is supposed to be the only thing that changes the mode, I'm wondering if it thinks my phone has left he building and returned. So I set a rule to log when my phone leaves and returns, and if it does this again, I'll see if there's a match.

That's something that makes even less sense to me.

Dev30 is a virtual switch that I added, with a couple rules that turn it on when the mode is set to home, and off when it's set to away. The point is that I can look at the state of the switch on the phone app since it's just a device. It seems to be changing the switch right before the mode change.

Since I posted last, the light came on again, and it looks like Hubitat thinks my phone has left and come back. If I really did leave and come back, it would trigger the rule that I'm home and turn on that light. But no idea why it thinks my phone left. But I think that's the key thing to figure out now.

How are you sensing your phone presence? FYI presence sensors (both GPS and Wifi) are very finicky and sometimes flake out. I personally don't trigger anything based on them for that reason.

If you're using the Hubitat Mobile App for geo-presence, then you may want to try Life360 instead. I have found Life360 to be very reliable in contrast the Hubitat Mobile App... Life360 is free, and Hubitat has built-in support for it (i.e. no custom code required.)

1 Like

Could you post the "In Use By" section from the device page for this virtual switch (Dev 30 - Mode detect)? While it is likely that you have run into a mobile app geofencing issue, the abrupt timing of the mode change renders it desirable to eliminate all other possibilities.


I installed Life360 on my phone, and so far, it's working as it should. I think the issue was that, as mentioned, Hubitat doesn't do so well on it's own with using your phone as a presence sensor. I'm migrating over from SmartThings, and had never had the issue there, so that's what was leading me to believe it was the script. But, so far so good.


thats what i was getting at... it probably is not the rule but the app with your phone flip flopping momentarily. phones are not good for presence without tweeking.. ie what happens on a reboot. loss of network temporarly etc.