sahilchaddha / homebridge-dafang

Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
MIT License
203 stars 34 forks source link

[BUG] - Motion Détection don't work #57

Open leovj opened 4 years ago

leovj commented 4 years ago

Good morning everyone, congratulations on your work, fantastic! I installed the hack on the cam and the plug in and it seems to work well: the video and the accessories to record audio and video. Motion Detection and Motion Detection with notification do not work for me.

[7/4/2020, 14:59:11] [Dafang] MQTT Server Publish : $SYS/pbpaEzd/new/clients : mosqpub|6434-Ingresso [7/4/2020, 14:59:11] [Dafang] MQTT Server Publish : MyHouse/CameraIngresso/rtsp_h264_server : ON [7/4/2020, 14:59:11] [Dafang] MQTT Server Publish : $SYS/pbpaEzd/disconnect/clients : mosqpub|6434-Ingresso

machineglow commented 4 years ago

Same issue as #53 with fix in comments

roboterm commented 4 years ago

@machineglow even if I change the coding as you suggest motion and motion tracking doesnt work for me either. I set up a new telegram bot but I m not receiving anything instead of everything is correctly configured. The telegram-bot service is running fine, motion is enabled and I have the motion display indicator in the top right corner but do not receive any snapshot videos or images. The MQTT functionality is also working fine, since I m able to rotate the camera dom via the accessories in the Home app.

machineglow commented 4 years ago

hmm... maybe it's something else. Are you actually running the latest dafang-hack code that has the change to the motion sensor mqtt topic? Are you sure you restarted the services to load the modified homebridge-dafang code? Do you know how to confirm whether the motion sensor messages are being posted to the mqtt topic (I don't but it's worth confirming).

roboterm commented 4 years ago

The firmware seems to be the latest (firmware date: 2020-04-30T18:44:10Z, firmware branch: master). I can monitor the mqtt communication since I m running my own broker.
At which topic are the sensor messages posted?
There is only one topic definition in my camera section of the dafang array in my config.json:
"mqttTopic": "myhome/dafang/#",

roboterm commented 4 years ago

If I monitor the MQTT communication I don't see any messages about motion detection. I can see a lot of messages but they're only about the value sets of the Dafang camera configuration.

machineglow commented 4 years ago

Did you setup mqtt on the dafang camera itself? There’s a mqtt.conf file you have to configure and point to your mqtt service first... i feel like you’re only seeing the messages from the homebridge-dafang plugin and nothing from the camera itself.

roboterm commented 4 years ago

I already customized the content of this file to my needing. If I change the topic in this file and I monitor this topic with a mqtt tool I the the exact same messages I already saw before. I can also rotate left right up down via the accessories in the Home app. So mqtt communication is working fine.

machineglow commented 4 years ago

Then... did you enable motion detection on the dafang camera via the web GUI? Do you get coloured dot in the corner when there is motion on screen?

roboterm commented 4 years ago

Yes and yes... That’s why I’m almost at a loss. Everything is turned on, the motion indicator is working but no snapshots or videos are sent to the telegram-bot. The telegram bit service is also running of course. It’s not my first telegram bot so I think it’s correct configured too.

roboterm commented 4 years ago

@machineglow Auto motion tracking is working now. I erased and formatted the sd card, copied the content again and now it’s working. Fun fact: RTSP is very unstable now. So I guess the sd card is corrupt and I already ordered a new one.

machineglow commented 4 years ago

Never knew how flakey and cards were until I started playing around with my RPi and cameras. Had to chuck one recently too.