ESP32 firmware to handle YCC365 cloud cameras motion detection notification
This firmware allows to handle YCC365 (GK7102) cloud cameras with hack installed onboard motion detection feature and translate them to MQTT messages for HomeBridge Camera.UI plugin.
By default when you add such camera to the HomeBridge Camera.UI you enables software video analizing and motion detection in Camera.UI. It works great but, however, it detect light changing as motion and may cause recording empty videos and send notification when there is no actual motion.
Fortunately such cameras usually have onboard motion detection. The only problem was to find how to get such notitifcations from camera. And there is a solution.
The camera sends simple text events to TCP port 3201 (it looks like simple logging port). So I wrote this simple firmware (for me its better to have separate ESP32 board that handles such things) that connects to cameras on TCP port 3201, receives all events and translate them to Camera UI MQTT messages.
WiFi Settings
WIFI_SSID - Set to your WiFi network SSID.
WIFI_PWD - Your WiFi network password.
MQTT server settings
MQTT_PORT - Camera UI MQTT server port.
MQTT_SERVER - Camera UI (actually HomeBridge) IP address.
MQTT_CLIENT_ID - MQTT server client ID, can be any text value.
MQTT_USER_NAME - Camera UI MQTT server user name.
MQTT_PASSWORD - Camera UI MQTT server password.
MQTT_MOTION_ON_MESSAGE - MQTT message send to Camera UI when motion detected.
MQTT_MOTION_OFF_MESSAGE - MQTT message send to Camera UI to reset motion detection.
Camera settings
You can get more than one camera controlled. Each camera must have the following settings:
CAMERA_IP - Camera's IP address.
CAMERA_MOTION_TOPIC - Camera UI MQTT motion detection topic.
CAMERA_MAX_MOTION_EVENTS - How many motion events should be received from camera before MQTT message will be send to Camera UI.
CAMERA_MOTION_COUNTER_RESET_TIMEOUT - Timeout after which motion events counter should be reset.
CAMERA_MOTION_RESET_TIMEOUT - Motion detection reset timeout. When this timeout expires Motion Reset MQTT message will be send to Camera UI.
CAMERA_MOTION_DETECTED_LED - The motion detection LED pin. Set to 0 if no motion detected indication LED used.
Should you have any question please do not hesiatate to contact me at mike@btframework.com
Would you like to support me? That would be great:
USD: https://buymeacoffee.com/dronetales
BTC: bitcoin:1A1WM3CJzdyEB1P9SzTbkzx38duJD6kau
BCH: bitcoincash:qre7s8cnkwx24xpzvvfmqzx6ex0ysmq5vuah42q6yz
ETH: 0xf780b3B7DbE2FC74b5F156cBBE51F67eDeAd8F9a