Wiring experts and coding hero’s I need your help!

Reason behind this set up is that we want the end user to know that its not an odd setup from what they are used to as currently we have 3 position switches in place which people don't understand. They end up overriding the lights leaving them on all day and night. So by having a normal light switch the end user doesn't know any different. The advantage is that we can now also tell when that particular room is in use (useful for other automations such as heating) At the end of the day we then shutdown all the lights in the building so that none are left on. In the morning when people come back the pir takes back over.

We have the normal physical switch controlling the light via s1 and output 1. Then HE is controlling the sensor side when it detects movement. The sensor isn't connected directly to the lights as it goes to s2 which turns on output 2 that doesn't have anything on it. I know this looks like its in a bathroom setup but that's the test stage for this at the moment then we'll roll it out to other areas when we are happy that its working well enough.

For some reason the room lighting wont turn on both outputs so I cant use that way but your example has most definitely got us to an almost ready working stage. Just need to change the rule in rm a little to accommodate the physical s1 switch being on and for it to ignore the s2 input when its on

Why are you looking for it to do so. You said above that output 2 isn't attached to anything. Output 2 shouldn't do anything since it isn't attached to anything. The RL listed above will do this.

1 Like

good point, I think rl is only turning on output 2 and there doesn't seem to be a way to force rl to turn output 1 on where the light is connected.

Is there an advantage over using rl rather then rule machine? I suppose I could bridge output 1 and 2 to the lights which would then make rl work

I suspect that points to one of two things. It could be you don't have the qubino device configured properly in HE, or you have the instance in RL pointing to the wrong device.

1 Like

Sometimes it is much easier to setup and then later make changes in RL vs a complex rule in rule machine. There are just some things you can do in RL which would take either multiple RM rules or long and complex rules.

Some things are super simple to do in RM as well but overall I just put all my lighting stuff in RL so its all together in one place for the most part.

2 Likes

I realized above after posting that my image doesn't have the last switch labeled. It would be switch1 I believe.

Thanks for posting that, I’ve managed to get it done in room lighting! All being well we have a normal switch now and only a few seconds delay when it’s in pir mode. I’ll report back once I’ve had a day or so with it. Thanks @jtp10181 and @mavrrick58 for your help it’s much appreciated

Ok, so I've found a problem with this implementation if the physical switch is on and hubitat overrides the lights and turns them off when the lights next come on via the pir they stay on. Also its taking around 3-4 seconds for the pir to turn the lights on. @mavrrick58 do you have this kind of delay with your set up that i copied?

What do you mean by Hubitat overrides the light and turns them off. Hubitat isn't overriding anything. You are telling hubitat how to react to conditions. All the setup i showed above is doing is

  1. activating the lights by motion
  2. Preventing the lights from being turned on when a physical switch is pressed.
  3. Saying when the physical switch is turned off to allow the PIR turn the lights off when the PIR goes inactive.

There is no override by hubitat, but it is handled by switches and all those switches are doing is allowing you to set when the PIR can turn off the device.

Sorry i mean that if the light are on and he asks the switch to turn off outside of room lighting. Example of this would be if someone has turn the light on and left it on then when the building is empty he asks the light to turn off

I think what you are saying is this.

You activate the light via the physical switch which is also tells Hubitat to ignore new motion events to turn off. Then later that day you turn the lights off via something other then what is set as the "Use Turning Off Alternative." (ie Physical Switch). So it is still set to on. So the next day when someone enters the room the lights activate via PIR, but then won't turn off again because the physical switch is on.

To me this means the light switch isn't what you want to control the ability for the PIR to work, but something else. So please again define how you want this to work. Since you aren't using a Zigbee/Zwave switch but a physical toggle switch it isn't like you can keep that in sync with a virtual switch in Hubitat and use that virtual switch to control this either.

This may be a janky way of doing it but you could try this.

  1. Create a virtual switch in HE
  2. Create a rule in RM that turns on that Virtual switch when the physical switch is turned on.
  3. Update RL to use that virtual switch instead of the physical switch for the "Limit turn off" and add it to "Use Turning off Alternative" with the physical switch.

At this point the Virtual Switch is what would control if the PIR is ignored instead of the physical switch. So it is possible that a on state with the physical switch means nothing if it was turned off digitally via the virtual switch. All you would need to do to correct that is toggle physical the switch off and back on though.

If you have the option to set the physical switch toggle state instead of up on down off. That may let you not have that extra step when turned off digitally at the end of the day, but that means the state of the switch is meaningless as well on could be both up or down.

@mavrrick58 Thanks for this. The delay I'm getting isn't ideal tbh its near instant when its just the PIR.

To summarise what I'm trying to do is: Have the PIR activate the lights but also have the ability for the user to override said lights to keep them on (using a normal light switch so they don't know any different). Then if the lights are on and the building is empty have the lights turn off via HE telling the relay module to turn off then have the process there again for the next morning i.e PIR turning the lights on with the override off

I've done some research and there's another PIR that allows a toggle sequence which overrides the PIR sensing ability (flip the physical switch twice in a 1.5 second period). I'll get one of these bought and see where i get going down that route. Everyday is a school day!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.