Door Contact - Force Light to Stay ON

Question 1 (Yes or No):
Is it possible to create a Hubitat rule such that:

  • When the garage door contact sensor reports “open”, light (Z-Wave switch) “X” is forced ON
  • While the contact sensor remains open, any attempt to manually turn switch “X” OFF is overridden and the switch is immediately turned back ON
  • Once the contact sensor reports “closed”, manual control of switch “X” is restored, allowing it to be turned OFF
    Just to put it simply:

Is it possible to create a rule where:

  • When the garage door contact opens, light switch “X” turns on and stays on
  • The light cannot be turned off while the garage door is open
  • Once the garage door contact closes, I am then able to turn light switch “X” off manually

(This is strictly a yes or no question. If it is possible, I will handle the implementation.)


Question 2:
Is Hubitat currently developing, or does it already provide, a built-in application or driver that supports the following behavior:

  • Contact open → turn light ON
  • Contact closed → turn light OFF

Question 1 - Yes

Question 2 - Yes, Basic Rules. Simply write two rules, one for on, one for off.

thanks

[quote="johnwill1, post:2, topic:159728"]
Question 1 - Yes
[/quote

I think the answer is Yes with a caveat. If OP is using a standard Zigbee or Z-Wave switch, won't it turn off manually then have to have a rule that immediately turns it back on? Only if the switch is a scene controller can manual control be blocked and won't cause target light to flash. Or am I missing something?

It is a Z-Wave switch, I just want to make sure I NEVER go to bed, leave the house with this door open. I do have notifications set for this door. If I can get the Z-wave light switch working this would be best for me.

It should be possible. My caveat was going to be that the switch may need to support 'switched on/off [physical]'. Two Basic Rules for Q2. An RM rule for Q1:

Trigger - Switch turns off 'physical'. Conditional trigger 'door is open'
Actions - Turn switch on, wait for event 'door closes', turn off switch.

As is usual with these posts, there will be multiple ways of achieving the desired result.

Over the years I've realised that when the question is 'is there a way of doing this with Hubitat/Rule Machine', the answer is invariably 'yes'. I've yet to find something that's not possible with the right devices and some lateral thinking.

1 Like

Some switches have “detached relay mode” a.k.a. “Smart bulb mode” which turns the switch paddle essentially into a remote. Then only the hub can turn the light on/off based on the paddle events (or ignore them).

2 Likes

Inovelli switches also have an option to disable physical input. Others might have the same.

2 Likes

So do Zooz switches apparently.

For the benefit of those new to this kind of feature: physical actuation of the switch is disabled, but typically not the paddle actions, in the sense that those paddle actions are still forwarded to the controller as button events even when the switch is not actuated.

2 Likes

Will have to be multiple rules one to turn on and another to prevent turning off while open. I have something similar with my attic lights where they turn on when the stairs are pulled down but if they are up/closed this rule prevents the lights from being turned on:

What am I doing wrong?? I want the light to stay on when the contact is open.


Thanks Randy

Turning on the light when the contact opens, is likely the most basic rule possible in Hubitat. See sample below.

I cannot think of a way to keep the light on if someone turns it off, either by physically operating the switch, or by commanding it off in Hubitat. But the following rule will turn it on again immediately. Certainly it will be off for such a brief time that you won't fall asleep during that time period.

Be aware that some older Zwave switches do not update the Hub when they are turned off physically. If you have these older switches you will need to also install a polling or refreshing app to keep the Hub aware of these physical changes.

========

1 Like

You do that yourself, like in the first basic rule in my last post.

1 Like

ritchierich

Your rule works perfect for keeping the light OFF. I just want to reverse it. I tried it different ways.

Yes, I have a BR for the ON and a BR rule for the OFF

I am trying to figure it out but I am stuck I thought this is where you go if you get stuck?

You replied to me, but since you mentioned @ritchierich, I assume your comments were directed to the rule he offered.

@ritchierich did not create that rule specifically to solve your problem. He stated that he had something similar that was intended to keep his lights off. So no surprise that's what it did when you copied it verbatim.

All you have to do is substitute his components with your own.

Replace "Attic Stairs Contact" with "Large Slider Door Contact"

Replace Attic Lights" with "Dining Room"

In other words...

Replace Required Expression = "Attic Stairs Contact Is Closed" with "Large Slider Door Contact is Open"

Replace trigger ="Attic Lights Turn On" with "Dining Turns Off"

Replace action="Off:Attic Lights" with "On:Dining Room"

In other words, just like the rule I presented.

2 Likes

Please see thread #11

In post #11 you asked what you were doing wrong.

In that post you had screenshots of 2 rules.

In both rules you said
"If the dining room turns on, then turn it on again"

Your first rule will only turn on the light if the door is open, and the second rule will only turn on the light if the door is closed.

So the bottom line is if anyone turns on the light, whether the door is opened or closed, Hubitat will send the "on" command again, making doubly sure the light is on

But didn't you only want the light turned back on whenever it was turned off, and to only do that when the door was left open? That is the scenario that I created my example rule for.

1 Like

Yes, sir you are correct. However I thought that was what you where telling me to do in your last post.

Thank you for all your time. I will figure it out.

You are right when the Door is OPEN light is to stay ON.

FYI I did not give all my screenshots I tried all different ways and I could still turn the light OFF.

With ritchierichRegular
it keeps the lights OFF. When I do just as he has it I can not turn the lights ON. Just thought I could reverse things and have it do what I want.

Thanks again for your help.