elad-bar / ha-blueiris

Integration with Blue Iris Video Security Software
184 stars 43 forks source link

Allow MOTION binary sensor auto-creation to detect MOTION_<x> Topics #11

Closed Hisma closed 5 years ago

Hisma commented 5 years ago

It took me hours to figure out why my motion detect sensors were not working. I checked my mosquitto live database, and found that when motion was detected on a camera, the topic was "~/MOTION_A ON", not "~/MOTION ON", which is what the binary sensor created by this component is expecting to see.
Because blue iris allows the use of motion groups, it defaults to motion group A in my system. I changed line 52 in binary_sensor.py from this - for t in ['MOTION', 'AUDIO', 'EXTERNAL', 'WATCHDOG']: to this - for t in ['MOTION_A', 'AUDIO', 'EXTERNAL', 'WATCHDOG']:

Once I did that, my motion detectors worked correctly.

darkgrue commented 5 years ago

This is a duplicate of Issue #10.

Be aware that there are something like 8! combinations of motion zones (i.e. 40,320+ sensors per camera). Automatically creating them isn't practical.

I've fixed it in my fork, but until Version 5 was released, I didn't want to keep speculating on how BI was going to handle the MQTT macros, and held Pull Requests back for a while until v5 was out. Apparently it's the same.

Auto-creating the MOTION_A sensor is the compromise. The end-user can always create MQTT binary sensors for any other motion zones they want to monitor in their YAML configuration.