Lights Turned On. Rule False

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

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"
	}
}
2 Likes

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.

@bobbles 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.

Did it change to true or was the rule already true? The rule being true does not mean the that lights should turn on as the rule will only execute the true action when it changes from true to false and only execute the false actions when it changes from true to false. So, just looking at the rule at any one time doesn't mean that it would have necessarily just fired.

Can you show the log of the rule events?

See above. I have posted some snapshots here along with exactly what I want to happen and what happened. But as you can see in the Events above, the lights went off at 9:26pm but turned on again at 12:00am. Then I turned them off at 7:33am because they didn't turn off at sunrise -20.

And as I asked...can you post the events from the RULE. That is telling us what is happening but not what is causing it.

I went back to my original 2 pistons (which I combined into one and had the issue) which have the days as a restriction as opposed to a condition.
There must be some sort of bug lurking that caused this.
Without going back through the posts does your rule have separate days in the conditions?
Mine did and the lights would turn on at midnight even though the rule was false.

image

Yes, it does have certain days in the conditions! @Ryan780 my RM Rule doesn't show anything in the Rule Events:

And here is a pic of Scheduled Jobs. Notice the 12:00 schedule but I don't have anything setup for that time.

Have you not updated to 2.0.1 yet?

Wait...when did you take this screenshot? The rule should be true right now.

Do you have the timezone set correctly for your hub?

Hi @bravenel
Just thought I'd copy you into this thread in case there may be a bug lurking. Looks like 2 of us have had an issue.
Without having to read all the thread, I have a rule with various conditions within parenthesises.
It looks like if you have, in this case anyway, one condition with three days and another with 4, the rule seems to become true for some reason at midnight. probably when the day changes. If I split this into 2 rules with the days as restrictions then there is not an issue. Perhaps you can try to reproduce or there is a basic floor in my logic.
I have posted the rule again for reference.
image

I got a notice to update this morning, so I did the update. If you look at the other thread, I had also posted the list of bug fixes in that update and I wondered if the 5th and 8th would possible help with the issues I am having with these pistons. I just took that screen shot but it is only 3:50pm here so it should be false.

These two are causing me issues. Same as @bobbles but also issues with sunrise, sunset.

@bobbles how do you post just the piston?

I use a snipping tool or PicPick.
PicPick is probably better as you can do more with it.


I use the freebie.

If you're in chrome, I use Nimbus screenshot extension. It allows for Select and Scroll so you don't need multiple screenshots for a longer chrome window.

I would recommend updating and see if that fixes it.

Short of that, you might want to take the day of the week our of the condition and make it a restriction and see if that fixes it. Also, why are you "Refreshing" your undercabinet lights before turning them to 100%? What kind of lights are these?

I put in the Refresh because it didn't seem to be getting accurate status of the switch. It is a Leviton DZPA1-2BW Decora Smart Plug with the undercabinet lights plugged into the plug. It is using the Generic z-wave switch device.

Because the lights weren't turning on with the sunset -20. But maybe it was a bug. I did the update and this should fire in about 10 minutes so I will start the log and see what happens.

That's actually a z-wave plus device according to the website. You should be using the generic z-wave smart switch instead of the generic z-wave switch.

Sorry, yes I am using the Generic z-wave dimmer. I will change it to the Generic z-wave Smart Dimmer. I was watching the logs and it looks like it has turned the lights on but I am not home at the moment to actually verify. When I get home I will report back. I will take the Refresh out of that piston. So hopefully the sunrise, sunset bug has been fixed.