Rule exception for manual override?

Having just welcomed a little one into this world, we’re not only getting to grips with looking after the little man, but I’m also learning more about my HA setup!

I had everything cobbled together “just fine” for two grown adults, but given babies demands are different, things like light timers causing you to be in the dark at 3am etc show my setup isn’t quite right.

Is there a way to perform different rules based on whether the light was manually triggered as opposed to being triggered by say a PIR?

Currently I have a combo of ZWave Light Relays and PIRs, and HUE bulbs.

For example, I would like a different rule to trigger if the light switch is manually pushed as opposed to the PIR causing the light to go on.

I can’t picture this being possible in my head, as for example my Qubino Relay, is either ON or OFF (AFAIK), a manually switch press would simply “sendCommand(ON)” (as would the PIR – if Fibaro PIR detections motion, then secondCommand(ON) to zwave switch).

Any ideas? If none of this makes sense. File it under baby brain/trash :slight_smile:

I guess one way would be to disable all light timers in specific rooms between TimeA and TimeB.

That depends on your setup. If the manual switch is seperated from the zwave relay that is actually doing the switching of the light it should be possible. ( The PIR Rule should only switch on or off if this manual switch is off).
If the manual switch is not seperated I would say no, not possible.

At first, there’s no way to distinguish, whether an item was triggered “by hand” or “by PIR”.

That being said, one logic to do stuff depending on the triggerpoint is to add proxy items, which then in turn can only be triggered by one method.

e.g., if talking about your Light relay:

  • turning the light on or off is item “Light_Doorway
  • the PIR triggers “Light_Doorway_PIR
  • the Zwave Releay triggers “Light_Doorway_Zwave

So, you then add two rules for “Light_Doorway_PIR”-changes and “Light_Doorway_Zwave”-changes. Both turn “Light_Doorway” on or off, but with different outcome - so perhaps the “Light_Doorway_PIR”-item gets and expire for xx minutes, which the “Light_Doorway_Zwave” won’t get…

More specifics on the devices you have and current rules would be helpful. Do your PIRs have internal timers that trigger when there is no motion, or are you doing this through rules? Are you using associations between devices (this would make things a bit trickier)? If your relays support the scene command classes, they can be used to identify if the lights were manually activated.

You could use a global variable or virtual switch item to flag whether the light was turned on before motion was detected, or if the light was turned off then back on while there is motion. Then use that variable to prevent the motion rule from doing anything. When the light turns off, reset the variable or item. This is a lot easier with dimmers, where the motion sensor rule only adjusts the light to no more than 95% and is disabled if the light is >95%. Or with door sensors… like if the baby room door is closed, the motion sensor is disabled.

This is possible too. Depends on your preference.

Thanks all, bit too hazy to take all that in but I can see the logic of both proxy item suggested by @binderth and virtual switch suggested by @5iver

I’ll revisit when I’m seeing a little clearer I think :slight_smile:

For now, I’ve just disabled the timers on the lights between TimeA and TimeB.

1 Like

Best thing is, openHAB is open for so many possibilities!
You’ll have to dive in though to embrace all of them… :stuck_out_tongue_winking_eye:

But be assured, all of us started with the feeling of being overwhelmed by all of that, but taking small steps by the time you’ll see more and more of them!

It is indeed not easy but possible.