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

v0.4.5 - yi-hack-v5 related issues #113

Closed alienatedsec closed 2 months ago

alienatedsec commented 1 year ago

I am testing your commits and wondering if the code is now covering requirements for more topics to be advertised

Logger: homeassistant.config_entries
Source: custom_components/yi_hack/__init__.py:74
Integration: Yi Home Cameras with yi-hack ([documentation](https://github.com/roleoroleo/yi-hack_ha_integration), [issues](https://github.com/roleoroleo/yi-hack_ha_integration/issues))
First occurred: 11:56:58 (2 occurrences)
Last logged: 12:03:19

Error setting up entry yi_hack_v5_b578a4 for yi_hack
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/yi_hack/__init__.py", line 74, in async_setup_entry
    CONF_VEHICLE_DETECTION_MSG: mqtt[CONF_VEHICLE_DETECTION_MSG],
KeyError: 'AI_VEHICLE_DETECTION_MSG'

Does the front-end need updating to cover additional topics? There is no vehicle detection setting (and possibly other topics) even supported by the old platform.

https://github.com/alienatedsec/yi-hack-v5/blob/2110360dd79dbd9369153e06f72b50d60350c2ed/src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh#L27-L44

https://github.com/alienatedsec/yi-hack-v5/blob/2110360dd79dbd9369153e06f72b50d60350c2ed/src/www/httpd/htdocs/pages/mqtt.html#L98-L168

roleoroleo commented 1 year ago

Please, try this commit: https://github.com/roleoroleo/yi-hack_ha_integration/commit/216597bf4cda290e27bb0bac9130ac999bf3d32e

alienatedsec commented 1 year ago

So, there is a problem, but I don't know where. I already made a comment on the mqttv4 side https://github.com/alienatedsec/yi-hack-v5/commit/6acca79cf591b7faa8de6a0a898cc62c38190560#commitcomment-109026051, which is another issue.

However, there are some weird issues, which we discussed outside of GitHub, and after several weeks of testing, I am struggling to understand them. First of all, having Audio enabled - if using the Lovelace card code, it works (despite performance issues) in the dashboard (with sound) e.g.,

type: 'custom:webrtc-camera'
entity: camera.yi_hack_m_XXXXXX_cam
ui: true

image

Having said that, I go to the camera device, and when clicking on the highlighted below, to see the stream, it becomes unavailable.

image

If I disable audio, it works as normal within the device view. And yes, the performance is much better in the Lovelace dashboard without audio - but that is another problem.

image

roleoroleo commented 1 year ago

Similar behavior with my cam, but not the same. When I click on the sensor: immagine it becomes unavailable, but it comes back "On" after a couple of seconds. Could you check if mqttv4 process dies?

roleoroleo commented 1 year ago

When I have this problem ha log shows this: immagine

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.