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
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.