Page 1 of 1
False triggers pir sensor hc-sr501
Posted: Friday 15 April 2022 23:58
by nalivikam
Hello. I have been using "domoticz" recently and I am very happy. I want to use it first and foremost to guard an outdoor garden. I have bees and I want to put motion sensors. I came across projects that work through the "domoticz", but the sensors emit a lot of false signals. perhaps from the sun or the movement of the leaves of the trees.
these sensors that I have and want to use are "pir sensor hc-sr501".
my question is is there any way to combine or change their sensitivity software with "domoticz"?
For example, 2 sensors must be activated and only then I will receive a notification. in case of single operation from one sensor to filter or I don't know ...
can the platform itself have any option to handle such a task?
I don't have False triggers inside the house. just outdoors!
there are photo traps / hunting cameras that also seem to use similar sensors that work on the principle of infrared light, but there are not so many false positives. So maybe I'm using the wrong sensor or the software needs to be filtered.
I'm asking for help!
Re: False triggers pir sensor hc-sr501
Posted: Saturday 16 April 2022 8:50
by jacobsentertainment
Hi,
The "hc-sr501" PIR sensor does have a sensitivity control, I assume you tried adjusting this!
I tried these devices also with an wemos nd never had reliable results, I went to other devices like the sonoff and the ikea trädfri trough zigbee to control lights, these devices are solid in behaviour and predictable but the sensitivity can't be changed.
I Dont know what kind of script you use like DzVent or Blockly but if you want the result of two sensor to trigger then it would end up like
Code: Select all
if device1.state == 'On' and device2.state == 'On' then
Re: False triggers pir sensor hc-sr501
Posted: Saturday 16 April 2022 8:56
by heggink
Same here. I tried everything from soldering condensors, grounding, shielding, multiple types of esp modules. Every 'solution' out there I tried to conclude that the only way to get around the false positives is by software: only transmit motion if multiple triggers happen in a short interval. I gave up on them.
Sent from my SM-G980F using Tapatalk
Re: False triggers pir sensor hc-sr501
Posted: Saturday 16 April 2022 10:44
by nalivikam
jacobsentertainment wrote: ↑Saturday 16 April 2022 8:50
Hi,
The "hc-sr501" PIR sensor does have a sensitivity control, I assume you tried adjusting this!
I tried these devices also with an wemos nd never had reliable results, I went to other devices like the sonoff and the ikea trädfri trough zigbee to control lights, these devices are solid in behaviour and predictable but the sensitivity can't be changed.
I Dont know what kind of script you use like DzVent or Blockly but if you want the result of two sensor to trigger then it would end up like
Code: Select all
if device1.state == 'On' and device2.state == 'On' then
Yes thank you! I tried to change the sensitivity, but there is still a false alarm.
I just haven't tried putting on a thermistor. I do not know with what parameters it is.
“Making HC-SR501 PIR Sensor more versatile
The HC-SR501 circuit board has solder pads for two additional components. These are usually labeled as ‘RT’ and ‘RL’. Note that on some boards the labels may be covered by the “dome” lens on the side opposite the components.
RT– This is meant for a thermistor or temperature-sensitive resistor. Adding this allows the HC-SR501 to be used in extreme temperatures, it also increases the accuracy of the detector to some degree.
RL– This connection is for a Light Dependant Resistor (LDR) or Photoresistor. By adding this component the HC-SR501 will only operate in darkness, a common application for motion-sensitive lighting systems.
The additional components can be soldered directly to the board or extended to remote locations using wires and connectors. "
https://imgur.com/a/GFtTWqK
https://imgur.com/a/wg77cQy
you say "device1.state == 'On' and device2.state == 'On' then" how work this?
is there any time for the 2 sensors to overlap. if there is a gap of 1 second, for example, what will happen?
does this code that you say directly in the domoticz platform fit?
maybe here?
1.
https://imgur.com/a/CzDaOYl
2.
https://imgur.com/a/FZykPhx
i follow these 2 threads for my alarm
viewtopic.php?p=232863#p232863
viewtopic.php?f=51&t=19572
Re: False triggers pir sensor hc-sr501
Posted: Monday 18 April 2022 15:26
by jacobsentertainment
You can always try to install an thermistor, that's all up to you. For the code, this is just a sample not a complete script, depending on what you use and you're setup. So if you have both PIR sensors added to you're domoticz device list then they should have an IDX number or a name. With that you can use the events in domoticz to create a little script. In there you can create something with the two sensors and even a timer in between, if both sensors are on in a time span of 2 sec then a action will be triggered.
Re: False triggers pir sensor hc-sr501
Posted: Tuesday 19 April 2022 10:20
by nalivikam
jacobsentertainment wrote: ↑Monday 18 April 2022 15:26
You can always try to install an thermistor, that's all up to you. For the code, this is just a sample not a complete script, depending on what you use and you're setup. So if you have both PIR sensors added to you're domoticz device list then they should have an IDX number or a name. With that you can use the events in domoticz to create a little script. In there you can create something with the two sensors and even a timer in between, if both sensors are on in a time span of 2 sec then a action will be triggered.
Yes, I understood you!

"IDX number or a name" - yes, I see it.
but just say the whole script is written, then put in the folder "script: //home/pi/domoticz/scripts/myscriptname.sh"
is it correct ??
how to specify from where to read the script domoticz?
in the menu itself somewhere? I read the manual but did not find the answer.
maybe "Switches> Edit" or "Switches> Notification"?
i see an empty field where the script path can be loaded, but is it there at all or elsewhere ....
1.
https://imgur.com/a/CzDaOYl
2.
https://imgur.com/a/FZykPhx
Tnx advanced!
Re: False triggers pir sensor hc-sr501
Posted: Wednesday 20 April 2022 12:17
by jacobsentertainment
I never used the actions directly trough the devices, I have all my scripts running trough the editor. Go to "setup>more options>events" there you find the options of using several editors, blockly, lua python and dzvents.
https://www.domoticz.com/wiki/Automation is a good page to read and has some links to other pages where there is even more information.
Her in the forum we can assist you, but then we need some information about the devices that trigger the notification, so if you can share the IDX numbers of the motion-sensors and the kind of notification you would like to receive mail telegram etc then we can help you in the correct way

Re: False triggers pir sensor hc-sr501
Posted: Saturday 23 April 2022 5:32
by nalivikam
jacobsentertainment wrote: ↑Wednesday 20 April 2022 12:17
I never used the actions directly trough the devices, I have all my scripts running trough the editor. Go to "setup>more options>events" there you find the options of using several editors, blockly, lua python and dzvents.
https://www.domoticz.com/wiki/Automation is a good page to read and has some links to other pages where there is even more information.
Her in the forum we can assist you, but then we need some information about the devices that trigger the notification, so if you can share the IDX numbers of the motion-sensors and the kind of notification you would like to receive mail telegram etc then we can help you in the correct way
Thank you very much for the help!
Yes, I found the menu where editors can be used.
I have already sent it to me and I have a telegram notice.
I just want to make the two motion sensors work together. Now they are still working individually and sending a notice.
The numbers are:
first devices
Idx - 3
ID - 00014053
Name - DM1
and second
Idx -5
ID - 00014055
Name - DM2
https://imgur.com/a/oGGbxfI
https://youtu.be/bbm3YOpMLfk
Re: False triggers pir sensor hc-sr501
Posted: Thursday 28 April 2022 15:13
by lost
heggink wrote: ↑Saturday 16 April 2022 8:56
the only way to get around the false positives is by software: only transmit motion if multiple triggers happen in a short interval.
I have z-wave PIRs & that's the kind of trick implemented in these devices firmware (like Fibaro "eye"): On top of usual sensitivity parameter, there is the combination of a pulse counter and window time. Mine are setup to trigger movement only if there is 2 pulses in a 16s time slice. Even is sensitivity is setup quite high, no issue & I have one in front of my home and another under the roof in an inhabited/not insulated side (to quickly prevent weasels to settle there & disorders they may create) with yearly temperatures in a -15°C/55°C range: No false positive with these ones even with such extreme conditions.
PIRs are unreliable by nature, especially if no temperature compensation done & no basic "device intelligence" implemented. For instance, never managed to find one to trigger basic night light that does not sometimes gets fool. Especially during winter nights when the air is very cold and ground remains quite "hot": IMO, some "hot" air convection movement is enough to trigger them. Have to almost half sensitivity knob when it's really cold outside, otherwise it's on/off almost all night long (more a few hours after nightfall, less after because ground/air temperature levels over night hours) & as light also trigger captures on an external camera, I can see no-one was there...
IMO, when you want something reliable, it's best to pay for a fully integrated device with minimal embedded intelligence/tunables. Otherwise that's lot of test/integration time.
Re: False triggers pir sensor hc-sr501
Posted: Monday 09 May 2022 22:46
by nalivikam
I lost hope today!
I thought someone could help, but it took so long and no one could help me!
Every day I check if someone has given a working code, but no one has written. How to make the code so that the notification works only when there are 2 sensors activated.
Re: False triggers pir sensor hc-sr501
Posted: Tuesday 10 May 2022 12:14
by lost
nalivikam wrote: ↑Monday 09 May 2022 22:46
Every day I check if someone has given a working code, but no one has written. How to make the code so that the notification works only when there are 2 sensors activated.
If you don't want to use a device that just works (i.e. with embedded configuration/filtering) write a device script that, if one of your 2 devices trigger (checking their names), checks the last update value of the other and if difference to current time is less than 10s (for instance), send the notification...
Re: False triggers pir sensor hc-sr501
Posted: Wednesday 11 May 2022 8:21
by nalivikam
lost wrote: ↑Tuesday 10 May 2022 12:14
nalivikam wrote: ↑Monday 09 May 2022 22:46
Every day I check if someone has given a working code, but no one has written. How to make the code so that the notification works only when there are 2 sensors activated.
If you don't want to use a device that just works (i.e. with embedded configuration/filtering) write a device script that, if one of your 2 devices trigger (checking their names), checks the last update value of the other and if difference to current time is less than 10s (for instance), send the notification...
Can you give me a little more information about the "i.e. with embedded configuration / filtering" you're talking about?
my english is not good and i have a hard time finding information.
maybe there should be a description somewhere
https://www.domoticz.com/wiki/Main_Page, but I was looking for ... there is too much information and I can't find my way.
please for some guidance in this!
Re: False triggers pir sensor hc-sr501
Posted: Wednesday 11 May 2022 11:39
by lost
nalivikam wrote: ↑Wednesday 11 May 2022 8:21
Can you give me a little more information about the "i.e. with embedded configuration / filtering" you're talking about?
For instance, z-wave devices (and most zigbee ones I presume) provides some configuration parameters. But this must be checked in device documentation, not Domoticz as this is device features.
A well known z-wave Fibaro PIR documentation can be found here for instance:
https://manuals.fibaro.com/fr/motion-sensor/
In chapter #8, so called "advanced parameters", you can see what can be tuned in the device itself. This one provide quite rich configuration options on top of usual sensitivity: A pulse counter and associated windows time is there for instance.