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

ERROR No video, after desactivate privacy mode in HA #68

Closed ibanmda closed 2 months ago

ibanmda commented 2 years ago

Hi!

After I desactivate 'privacy mode' in Home Assistant i loss signal video in HA (WebRtc through rstp), but not in web interface (yihack)

Why can it happen?

Best Regards.

Captura de pantalla de 2021-12-30 17-07-49

Yi Dome Guard 1080 YRS3019
Firmware Version yi-hack 0.1.9
Base Version 9.0.05.33_202009251856
Model Suffix r30gb
Home Assistant Core 2021.12.7
roleoroleo commented 2 years ago

Please, explain me better.

ibanmda commented 2 years ago

The privacy mode doesnt work in HA, while that in Yi-hack Web UI works perfect! When I push Yi Camera Switch Status (_switch.yi_camera_switchstatus) in button card of the HA, the camera has problems for focus to ceiling and disconnect signal. It rotates up very slowly and it keeps trying when it reaches the maximum vertical rotation.

Log in HA:

2022-01-08 23:04:11 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: switch.yi_camera_ir_led
2022-01-08 23:04:11 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: switch yi-cam-hack ROTATE, sending update
2022-01-08 23:04:11 INFO (MainThread) [homeassistant.components.mqtt.mixins] Got update for entity with hash: ('switch', 'yi-cam-hack ROTATE') '{'availability_topic': 'yicam/status', 'payload_available': 'online', 'payload_not_available': 'offline', 'device': {'identifiers': ['yi-cam-hack'], 'manufacturer': 'YI', 'model': 'YI Hack', 'name': 'Yi Camera', 'sw_version': '0.1.9'}, 'retain': True, 'icon': 'mdi:monitor', 'state_topic': 'yicam/camera_setting', 'command_topic': 'yicam/camera_setting/ROTATE/set', 'name': 'Yi Camera  Rotate', 'unique_id': 'yi-cam-hack-ROTATE', 'value_template': '{{ value_json.ROTATE }}', 'payload_on': 'yes', 'payload_off': 'no', 'platform': 'mqtt'}'
2022-01-08 23:04:11 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: switch.yi_camera_rotate

In addition, the mqtt broker log shows continuous connected and disconnected from client:

1641681836: New connection from 192.168.1.86 on port 1883.
1641681836: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681836: Client yi-9b14 disconnected.
1641681837: New connection from 192.168.1.86 on port 1883.
1641681837: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681837: Client yi-9b14 disconnected.
1641681837: New connection from 192.168.1.86 on port 1883.
1641681837: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681837: Client yi-9b14 disconnected.
1641681838: New connection from 192.168.1.86 on port 1883.
1641681838: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681838: Client yi-9b14 disconnected.
1641681838: New connection from 192.168.1.86 on port 1883.
1641681838: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681838: Client yi-9b14 disconnected.
1641681838: New connection from 192.168.1.86 on port 1883.
1641681838: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681838: Client yi-9b14 disconnected.
1641681838: New connection from 192.168.1.86 on port 1883.
1641681838: New client connected from 192.168.1.86 as yi-9b14 (p2, c1, k60, u'mqtt').
1641681838: Client yi-9b14 disconnected.
roleoroleo commented 2 years ago

This switch in the ui immagine is different than that in ha.

The first one duplicates the same feature of the app. But it's not able to stop the rtsp stream The second one switches off rtsp stream and snapshot. But it's not able to stop the stream to the yi app.

About mqtt, how many cams do you have?

ibanmda commented 2 years ago

About mqtt, how many cams do you have?

I have only one cam

roleoroleo commented 2 years ago

Try to restart mqtt server, maybe the connection is not properly closed. And you can't have two connections with the same client id.

ibanmda commented 2 years ago

I changed the name of client id and I have same issue. Even I disabled the mqtt connections from the web UI of yihack with the same error loop

1641846485: New connection from 192.168.1.86 on port 1883.
1641846485: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846485: Client cam1 disconnected.
1641846486: New connection from 192.168.1.86 on port 1883.
1641846486: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846486: Client cam1 disconnected.
1641846486: New connection from 192.168.1.86 on port 1883.
1641846486: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846486: Client cam1 disconnected.
1641846487: New connection from 192.168.1.86 on port 1883.
1641846487: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846487: Client cam1 disconnected.41846485: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846485: Client cam1 disconnected.
1641846486: New connection from 192.168.1.86 on port 1883.
1641846486: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846486: Client cam1 disconnected.
1641846486: New connection from 192.168.1.86 on port 1883.
1641846486: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846486: Client cam1 disconnected.
1641846487: New connection from 192.168.1.86 on port 1883.
1641846487: New client connected from 192.168.1.86 as cam1 (p2, c1, k60, u'yihack').
1641846487: Client cam1 disconnected.
1641846487: New connection from 192.168.1.86 on port 1883.
1641846487: New connection from 192.168.1.86 on port 1883.
ibanmda commented 2 years ago

Ok! After I disabled in the yihack UI - Mqtt Advertise & Homeassistant MQTT Discovery: MQTT Information Advertise, MQTT Link Advertise, MQTT Camera Settings Advertise, MQTT Telemetry Advertise, Home Assistant; AI Human Detection, Face Detection, the log loops has not appear in my log.

Maybe some strange MQTT conflict?

I has readed in this post that this is not a bug. However I think that can be some annoying...

Thanks @roleoroleo !!!

roleoroleo commented 2 years ago

Maybe a conflict between 2 connections: mqtt events and mqtt advertise. I will check it.

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.