Setting up an override feature for PIR sensors

So I am now using the new webhooks functionality in Apilio (yay!) to control the “if there’s no movement for 3mins then turn the lights out” behaviour across my house. I’m doing it because it’s just a bit too annoying to have to keep waving hands during dinner or while working at the kitchen table (yeah seems I don’t move very much when I’m working).

I’m not going to go into how to setup http shortcuts as @Anna dealt with that here but I used it to create two webhooks requests: 1) to switch on the timeout override and 2) to switch it back to the regular 3m timeout setting.

I had already installed lighting automation using two PIR sensors and a light level sensor see here and so this is an addition to that functionality to use the webhooks override function to stop the timeout switching off lights. I’m only interested in stopping the lights going off at this point, but I probably need an override to stop them going on with movement as well (like if getting up in the middle of the night for some reason and not wanting all lights to go on).

First I added a new boolean variable called “lights-over-ride-status” with my webhooks http short-cuts shown above using the Apilio web hooks service to update the boolean variable.

A condition, called PIR-timeout-status is then set depending upon which http button I choose to update the variable.

And then finally I have edited my “lights off” logicblock to verify all of PIR-timeout, PIR1-motion-negative and PIR2-motion-negative are true and if so then the lights will timeout and switch off. If however, the PIR-timeout-status is overriden and the related condition false, then the logicblock won’t ever be true and the lights stay on.

Hope that makes sense!