Problem with rule

i have a rule that I can't see to get right. It is supposed to turn on the light if someone comes up our backstairs or drives down the drive ONLY if the mode is night. I have MODE as a switch that I tell Alexa at night to turn on nightmode.

I t runs everytime my dog goes outside.

I cant figure out what is going on. Any help would be appreciated

mode is a built in thing and that rule references that not your distinct mode switch. you would have to change your trigger.

2 Likes

Personally I would remove the "ONLY IF(Mode is Night) from your trigger.
Then in your actions I would go.....
IF
Mode = Night
THEN
yours actions as shown.

1 Like

You could also try changing the trigger to be when either contact opens (remove the only if) and add a required expression of mode is night.

1 Like

Are you saying that you say "Alex turn on nightmode" and it changes the Hub's Mode to Night? Or it turns on a switch named "MODE" or "NIGHTMODE"?

1 Like

My guess is that the ONLY IF is only being applied the back stair trigger and not on the new driveway trigger.

Even if that's not the case, I would take off the ONLY IF and instead put a Required Expression on the rule for Mode is Night.

1 Like

I’ll second this suggestion. a Required Expression would be ideal in this scenario.

3 Likes

is there someway I can see the code laid out like the simple if/then?

You still need to answer are u using the built in mode or one of your own switches

1 Like

Might want to clarify this.

1 Like

Aha! "built in mode". Finally got it.

It’s still not clear how you are getting the mode of the hub to change to night (and change to something other than night when it’s not night time) or if you even are. Assuming you are actually changing the mode of the hub to Night

If you’re having Alexa turn on a switch and the hubs’s mode is not changing then your rule and the above will not work as “Mode” is looking at the hub’s mode. But you could change the “required expression” to the switch you are turning on and off via Alexa

I have a virtual switch called night. when I am ready to go to sleep, I tell alexa to turn the night on. It changes the mode in hubitat. the code shows the night mode is false

So I am guessing that you have a rule or something that changes the hub mode to night when the virtual switch turns on?
If you going into settings/modes and active night (click on the check mark) does the rule still show false?

the mode part works great. I deleted the old rule and made a new one with REQUIRED . Rught now that seems to at least node turn all the light on every time the dog goes out! Ill try changing the mode to night and see if it triggers.
Thanks for the help!

1 Like