PIR sensor, false positives on initialization

I have two PIR sensors. One on the ESP32 and another on the ESP2866. Both, when powered on, produce false positives. I only get false positives in this situation, when the power fails and returns.

I’ve already tried delay on boot and also delayed_on in the filters, but it doesn’t solve the problem. Does anyone know how to work around this issue?

Ths

What is it that supplies the power to the unit (e.g., why is that turned off or on etc…)?

One workaround is, have an automation to update the exact time the unit is powered on (possibly from a smart plug or something similar?), into a datetime helper. Then in all of your logic where you act upon the unit detecting motion (or motion clearing), only act upon it if it is X minutes AFTER the value in that dattime helper… ?

This would allow you to not act upon any state changing during the initialization of the unit being powered on - ?

When I’m away from home, the alarm is activated using some PIR sensors. If the power goes out at home and I return, the PIR sensors give false positives.

Well the solution I gave will resolve the issue. However you also need something to notify you on your cell phone when the power goes out (you can use HA for that as well of course)

I think there must be another solution… all the people who use the sensor pir device to detect movement, if the house power fails, when it comes back on, it will give a false positive. I thought it had something to do with other sensors I might have connected, but I did tests and it happens with all PIR sensors and all ESP boards…

There probably is, but so far you have provided no information to provide any help.

Many PIR sensors do nothing for a period of time when power is applied. Maybe yours don’t do that for a quick blip or maybe it is something else.

Have you tried removing the sensor and seeing if the problem is still there, to narrow it down to sensor, esphome config, or possibly the interaction of the two?

Use global variable with initial value 0.
On_boot automation with x seconds delay and then set the global variable to 1. On your gpio binary sensor use automation or lambda filter to check that the global is 1

1 Like

That was my solution essentially just a different way of going about it (actually more elegant than mine!)