brandond / esphome-tuya_pir

ESPHome support for cheap WiFi PIR sensors
66 stars 21 forks source link

Fix problem with motion/door reset message arriving too early. #25

Open AriZuu opened 3 years ago

AriZuu commented 3 years ago

It seems that newer Coolcam PIR sensor sends a motion reset message before actual motion on/off message. This causes unfortunate side effect of esp8266 shutting down too early. As the reset message is not used for anything, just acknowledge it to MCU and keep going.

AriZuu commented 3 years ago

About these messages:

SB1_EVENT_TYPE_DOOR_RESET = 0x6504 SB1_EVENT_TYPE_MOTION_RESET = 0x6604

In README.md these messages are described as battery level messages. If so, it explains why they are arriving early. Might be a good idea to rename these constants from _RESET to _BATTERY.