Lights Turned On. Rule False


#1

I have 3 rules similar to the one I have posted below that control my downstairs light.
Last night at Midnight all of them triggered and turned lights on.
When I look at the rules I can see scheduled jobs for midnight.
I don't know if these are to turn the lights on but if you look at the rules there is nothing in them to schedule an activity at midnight.
Any ideas anybody?
Here is the rule.


image
Here are the schedules jobs.
Note the jobs for midnight are the ones I'm querying. The others make sense.
image


#2

Remember that in the absence of triggers, conditions become triggers and cause the rule to be evaluated. I think the midnight schedules are due to your use of day as a condition. You have every day of the week in there, so it would set up a schedule for every day at midnight. If the other conditions are true when the new day starts, the actions are going to run.


#3

Thanks for the reasoning for the midnight evaluation. Makes sense.
The problem is, the lights were off, and the rule was false. Nothing should have turned on.
The events for the lights show them turning off at the scheduled time by the rules and then turning on at midnight. If the rule was false, which it should have been as the lights had turned off as per the rule, I see no reason for them to turn on.
Perhaps it was a glitch of some kind but I'm not convinced.


#4

Did you check the past logs around that time to see what happened?


#5

Yes but unfortunately they do not go back that far.
Think I'm going to have to leave live logging on tonight in case it happens again.
It is the first time it has happened. I think.
I also have a 'failsafe' rule that checks every night at 00:15 that if any of the lights in the 3 rules are on and all the motion sensors in the rooms are inactive, then wait 15 minutes and turn them off.
They were only spotted last night when my wife got up for some water just after midnight.


#6

Check your events page for the motion sensor just to see if it happened to be active at that time. Other than that I agree about leaving logging open.


#7

Sorry to break in but your plan for monitoring has me confused.

I agree about leaving logging open.

I thought the "show past Logs" feature would preclude the need to keep the logs "open" in a browser. Am I missing something.
Thanks


#8

With RM I very much subscribe to the KISS principle.
WebCore made it very easy to visually get a complete overview and data trace flow of what is happening.

RM, not so much.

To this end, with a complex rule as posted above, I break them down into individual separate rules, with each rule doing one thing only.

Yes, it is a LOT more work. But I know exactly which rule fired when and caused a certain result.

J


#9

Once they're full, they purge the oldest events. If he's still running webCoRE (don't know if you are or not Bob), that will fill the logs very fast.


#10

It happened in 3 seperate rooms that use 3 different rules that are of this type of configuration.
I checked the motion sensor in one of the rooms that the lights came on in and you can see that last motion was detected when we went to bed and nothing until the morning. (I turned the lights off using the dashboard on my phone from my bed!!!!!!!!).
So it definitely wasn't the poltergeist running around downstairs and the cat died years ago. :wink:


#11

I've been having problems with my hub gradually slowing down and finally stopping so I have disabled all webCoRE rules to see if this was causing it.
My past logs still only go back about 2 hours though.


#12

Thanks, Looking at the time stamps I see what you mean. I guess I was thinking it was similar to the Events page. BTW before "show past logs" I would open the logs page in MS Edge (which I don't use). I did this because I kept on inadvertently closing the Chrome (my browser of choice) page that was capturing the logs.

@bobgodbold, again sorry for breaking in here.

John


#13

No problem. Feel free. If you can add anything or trigger one of my few brain cells into checking something, its all good.


#14

Must be a lot of stuff logging. I can say though, that mine are only showing back to 3am, but I've got a lot of warnings that show up because of VLC Thing not having a connection to Google Home. It's a problem that self-corrects every time there's something for it to send and then the issue returns 5 minutes later when Google Home automatically closes the connection. A self-inflicted issue, not Hubitat's fault.


#15

Could well be. Think I will go through my devices, rules etc. and check to see what is logging and turn off what isn't necessary.


#16

Hubitat's own Device Drivers have a 30 min timer on Debug logs. You turn on debug, the driver turns it off 30 mins later. Meaning, you should only have to look at devices that are using Custom Drivers... that might reduce the burden. :slight_smile:


#17

Really love that feature. Is it available to developers to add to custom drivers as well?


#18

Yes, of course. I got the code from Hubitat's github repository.

preferences {
//standard logging options
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}
}

def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("logEnable",[value:"false",type:"bool"])
}

def updated() {
log.trace "Updated()"
log.warn "debug logging is: ${logEnable == true}"
if (logEnable) runIn(1800,logsOff)
}

I've seen "logEnable" used two ways:

if (logEnable) log.debug("on")

Where you add the if in front of all the log.debug...
and then others, do a global replace of log.debug with "logDebug" and add the method.

private logDebug(msg) {
	if (settings?.logEnable || settings?.logEnable== null) {
		log.debug "$msg"
	}
}

#19

It's really a lot more simple than that. It's not like webCoRE. The actions happen when it changes from True To False or False to True. That's when the actions defined for each state will execute.


#20

@bobgodbold did you ever get this sorted out. I am actually having the same issues. Last night my lights all went off with Good Night Routine at about 9:30pm then at 3:00am I got up and noticed that the lights were on again. When I looked in the events it showed a Physical switch ON at 12:00am. Normally it says Digital On Off. However, everybody was asleep. I have also been having difficulty with lights not coming on or going off when the RM is TRUE. Lights were supposed to go off at sunrise -20 and I watched as it was TRUE and nothing happened. I finally turned them off myself.