Latch a switch to ON

I have a switch that is programmed as part of a set of rules. This switch controls an outdoor light. I would like to temporarily "latch" that switch to ON, regardless of any rules that are triggered. This would allow me to keep it on without having to remove it from all the rules, only to add it back at a later time.

Is there a way to do this?

The first thing that came to mind was putting conditionals in all the rules that affect this light, but that would probably be a bit messy.

There may be an easier way using room lighting. You'll need a room lighting automation and a virtual switch.

Create a virtual switch called "Latch Outdoor Light"

Create a new room lighting automation. Add the outdoor light to the automation. Do not add any means to activate or deactivate, but in "Turn off light options" under "Means to turn off lights" select "Don't turn off when switches are on" and select "Latch Outdoor Light" as the switch. Add a name in the "Command with activator device" field. For example "Outdoor Light RL Device"

Now, in each rule that turns "Outdoor light" off, replace the "Outdoor Light" device with "Outdoor Light RL Device".

When you turn on the virtual "Latch Outdoor Light" switch, the lights will not turn off when a rule tries to turn off the Room Lighting device.

1 Like

That seems like more work than just removing the switch from the rules OR making a virtual placeholder switch and putting that into a rules.

Nice idea, but I think it's too complicated of a solution. Seems like there ought to be a global override or priority controller.

My solution to this: I created virtual switches for each room (zone), (Rm).LightOnLock, (Rm).LightOffLock. Using WebCore, all of my pistons are written so that if any "lock" is turned on, the piston execution is disabled. Motion pistons are disabled, lighting pistons are disabled. I modified all of the device handlers to facilitate triple tap buttons. If the triple tap button 1 is pushed, the LightONLock is activated, if the triple tap button 2 is pushed, the lock is turned off. I also have a lock dashboard in hubitat. In an example case, when the TV is turned on, the LightONLock is turned on and a piston begins a light fade routine if during the NightTime hours. Media Room motion sensors are disabled. i also have a Aeotec Wallmote that is WebCore programmed to turn off all locks. If presence is away, all locks are turned off. TV turns off, locks is turned off. this happens for the 70 or so switches i have throughout my house.

An alternative, assuming you are only concerned about commands from the hub and not physical actions on the device: enable and disable the device as needed. You can do this manually from there Devices list or automate it with a rule (which also has access to this feature).


Well, look at that...I did not even notice that column. Is that new? That would certainly solve the issue, I think.

I can manage the physical action on the device.

1 Like

Not new, but the UI just changed, so some may find it more discoverable!

Oh, that is so cool. I just made a virtual switch with a basic if-then-else to change enable/disable state based on the virtual switch and triggered by change state on it.

FUN. :slight_smile:

1 Like