PIR sensor - Smartest way to disable at daytime? (newbie)
-
[My enviroment: controller: domoticz on Raspberry PI/zwave/Mysensors)
My first motion/PIR node with 2 relays now working. Some other nodes also running. But I want to add one feature; "disable daytime". What is the smartest approach?
- Ask controller for time or, even better, a variable which described if daytime or not
- Use a lightsensor to block the logic at "light"
- Other approach
(I want to block the logic daytime)
Of course very happy if someone willing to help a rookie on it's very first shaky steps..
Thanks
Pelle
PS! Read this post (https://forum.mysensors.org/topic/2116/hard-to-grab-time-and-value-sent-from-controller) about grab time.. Also read this one about variables (https://forum.mysensors.org/topic/3326/requesting-variables-reliably-how). Light sensor is my last option; I've read this one; (https://www.mysensors.org/build/light-bh1750)DS
I'm still in the beginning of my learningcurve and my code is not the cleanest. And my wiring and coding for the relays is probably the most strange coding You've ever seen..
-
@pellusfromtellus I have implemented the logic in the controller. The sensor just sends a trigger on motion, and it's up to the controller (node-red in my case) to act on it or not.
A lot simpler than making the sensor 'smart'.
-
Hi Yveaux!
Thanks for taking your time and answer me. That's of course a smart approach and maybe the normal way to do it.But for the moment (and for learning purpose) I want the logic in the sensor. But I got an idea from Your approach. Maybe I could let my MyS-node present a "dummy-relay" (S_DOOR) which the controller could set on & off depending on sunrise/sunset. (I have more than one relay on my MyS-node, so some logic must be there.. And also a "override"-button which manually disable the MyS-node/relays.)
Like: Controller: "After sunset"-event: set "dummy node=on", and then att sunrise "dummy node=off" and use "savestate" or something locally on arduino to save this "state", which then the controller checks if the sensor is enabled or disabled.
Is that possible?
I'm open for more ideas and technics..
/Per
-
@pellusfromtellus keep in mind that your sensor might not receive the switch message from the controller that it should start or stop reporting.
Imagine your burglar alarm is offline because your pir sensor didn't get activated...
-
Thanks again. Important aspect, of course!
I'm new to this so I don't have any own oppionion about how reliable the communication is. So I really appreciate your input!!
-
This video might be useful to you if you are using the same type of PIR.
Adding a light sensor to a PIR module. – 06:39
— bigclivedotcom
-
Lovely. Will be this evenings experiment – if I got the right PIRs.. – to find out...
Thanks for answering!
/Pelle