roleoroleo / yi-hack_ha_integration

Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner, yi-hack-Allwinner-v2, yi-hack-v5 and sonoff-hack
GNU General Public License v3.0
205 stars 32 forks source link

Integration not discovering movment #54

Closed Vormillion closed 2 months ago

Vormillion commented 2 years ago

Hi,

I installed this integration in HA (latest hassio) and after login I have new entities available. Unfortunately motion sensor is not working at all - it's always showing no movment.

I sshed into camera and execute mqttv4 and I can see MQTT events for motion_detection without any issue.

CALLBACK MOTION START Client yi-cam sending PUBLISH (d0, q1, r1, m2, 'yicam/motion_detection', ... (12 bytes)) Starting program Mapping file /dev/shm/fshare_frame_buf, size 1786156, to b6da5000 Decoding h264 frame Starting decode Decode frame Client yi-cam received PUBACK (Mid: 2) Writing yuv buffer Cleaning ffmpeg memory Adding watermark Encoding jpeg image Unmapping file /dev/shm/fshare_frame_buf, size 1786156, from b6da5000 Client yi-cam sending PUBLISH (d0, q1, r1, m3, 'yicam/motion_detection_image', ... (234533 bytes)) Client yi-cam received PUBACK (Mid: 3) CALLBACK MOTION STOP Client yi-cam sending PUBLISH (d0, q1, r1, m4, 'yicam/motion_detection', ... (11 bytes)) Client yi-cam received PUBACK (Mid: 4) CALLBACK MOTION START Client yi-cam sending PUBLISH (d0, q1, r1, m5, 'yicam/motion_detection', ... (12 bytes)) Starting program Mapping file /dev/shm/fshare_frame_buf, size 1786156, to b6d72000 Decoding h264 frame Starting decode Decode frame Writing yuv buffer Client yi-cam received PUBACK (Mid: 5) Cleaning ffmpeg memory Adding watermark Encoding jpeg image Unmapping file /dev/shm/fshare_frame_buf, size 1786156, from b6d72000 Client yi-cam sending PUBLISH (d0, q1, r1, m6, 'yicam/motion_detection_image', ... (234377 bytes)) Client yi-cam received PUBACK (Mid: 6) CALLBACK MOTION STOP

roleoroleo commented 2 years ago

Check if your mqtt server receives the messages.

Vormillion commented 2 years ago

Yes, I checked on HA:

mosquitto_sub -h 192.168.1.214 -p 1883 -v -d -q 1 -t 'yicam/motion_detection'

and I'm getting messages

Vormillion commented 2 years ago

Hmm, I just checked again and getting:

[core-ssh config]$ mosquitto_sub -h 192.168.1.214 -p 1883 -v -d -q 1 -t 'yicam/motion_detection' Client (null) sending CONNECT Client (null) received CONNACK (0) Client (null) sending SUBSCRIBE (Mid: 1, Topic: yicam/motion_detection, QoS: 1, Options: 0x00) Client (null) received SUBACK Subscribed (mid: 1): 128 Client (null) sending DISCONNECT All subscription requests were denied.

Vormillion commented 2 years ago

I have even more weird scenario.

Whenever I will reboot camera, mqttv4 is saying that it's connected but HA can't see any messages - sensors are in unavailable status. Sometimes restart of mqttv4 helps, sometimes not.

I'm still trying to reproduce this issue and see what will help.

roleoroleo commented 2 years ago

Please, give me details. Model suffix and fw of the cam? Version of the integration?

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.