Motion Lighting issue, not obeying switch to disable on

On occasion, say once a week, the app ignores the state of the 'diable on' switch.

In my case the disable on switch (OtherDullFlag) is set according to lux level tested against a variable threshold by another app.

The disable switch is definitely off but the lounge lights are still switched on when motion is detected.

Cycling the OtherDullFlag on then off again manually, seems to cure the issue.

Enable logging generstes vast amounts of logs.

Any suggestions as to fixing the issue please.

1 Like

Welcome to my life... I've been grappling with this conundrum in various forms for some time, not just in HE or motion lighting...

Anyway, enough grumbling from me...

Some logs may help decipher what is happening... Do you have any screenshots of those? From the ML app?

Also, what controls the OtherDullFlag switch normally? Is it another rule...?

Yes an RM app, attached.

I have several ML apps that use the same flag and they are mostly working fine but occasionally have the same issue. My best guess is that ML misses the transition from on to off sometimes.

Thanks for your reply.

Hmmm... I have a few theories.... but can't be sure... I am feeling like you should break up the rule into one for the Porch and one for the Kitchen.... and remove the conditions on the "dull" switches.... but I'll need to think about it and describe it a bit better than that...

One theory would be that the "dull" switch is not updating when it should. I would suggest checking the Events for the switch to see when it moved from on to off to on, etc. You can see this by opening the Devices page, clicking on the switch and clicking the Event button at the top of the page.

I have been meaning to get back to utilising my exterior Hue motion sensors for illuminance detection, so am slightly more interested than normal in how best to construct a rule such as this. Problem for me is I am East/West facing, so the Sun comes up and goes down at either end of the house, so I need to factor that into the equations....

I put the OtherDullFlag test into the Illuminace app to try to prevent it being set/reset unecessarily.

The attached event log suggest that the flag is set as expected, effectively at dawn and dusk.

Happy to make any suggested changes to test.

You're right, that does look ok, if not a little odd down here :wink: But definitely quite consistent....

I get where you were heading, and I would probably have attempted something similar, though perhaps in a different way, but ultimately the outcome for you should produce a consistent motion lighting outcome... time to move on to the ML setup....

Your comment about other ML apps using the same switch intrigues me... in the sense that I wonder if there is something wrong with the instance of ML app itself. Try opening and saving the ML app that is affected and see if that fixes the issue.

Unfortunately not something quick to test I imagine....

I will give that a go and monitor the situation.

Thanks for your help.

1 Like

Perhaps a silly question, but is the "OtherDullFlag" device a Virtual Switch (using the built-in VS driver), or a physical switch(ed device) of some kind using some other, notably a custom, driver?

Reason I ask is that I have tried using, say, a Hue bulb as a trigger or condition in test rules only to find that this device sometimes fails to report (or greatly delays reporting) its "Off" or "On" states, even if I use the "On" and "Off" paddles from its own Edit page. Same goes for a Fibaro RGBW controller elsewhere in my home; it can appear "On" according to "Current State" yet be totally "Off" IRL.

Figured I'd throw that concept into the mix, just in case. (If I'm way off-base, I'll come remove this comment.)

1 Like

How dare you offer a reasonable and useful suggestion... if not for this circumstance then for others who may stumble across it... :wink: :rofl: :rofl:

1 Like

Ha, my own commentary got me to thinking... how much more practical a (Boolean) Hub Variable might be for general use as a "switch" in these circumstances.

Of course, that adds an administrative layer of correctly setting TRUE or FALSE, none of which helps if all you're after is, "Just don't turn on the damn lights when this other light switch is down!" :slight_smile:

I want to get to that point as well, if the lights are on, don't activate the motion lighting, but need to still work out what the settings interpret as "on".... More my problem than anything else... I'm sure the features are all there...

1 Like

OtherDullFlag is a virtual switch.

On the In Use By section for the OtherDullFlag device what other apps use the device?

In Use by other ML apps and Illuminance

Hmmm... My inclination initially is to check each of those to find out where they update the switch and see if one of those could be affecting it's setting. I am thinking, I expect like you, that this not likely to produce a useful outcome... but worth ruling out, if nothing else... Other than that... I may need to leave you in the capable hands of those up North... :wink:

I truly believe the answer lies not-so-hidden in the Logs. Not sure why logging events on just that one virtual switch should produce an inordinate number of entries (that in itself may tell you something), but at least if some unexpected entity is turning the switch back "On" when you assume it should be "Off", then there's your problem.

The other ML apps are virtually clones of ML Lounge and do not change OtherDullFlag.

Illuminance does set on off as per code.

Maker APi is for Android Dashboard and I am able to set on/off from the dashboard, PIN protected.

I will log OtherDullFlag but the events shown previously don't suggest that it changes very often.

Thanks for the advice.

Download the Hubitat app