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

Camera dome u h52ga with hack yi-hack-Allwinner-v2 version 0.2.6 -camera off #112

Closed majkers closed 1 year ago

majkers commented 1 year ago

After updating integration to latest version and hack to 0.2.6 I can't play stream in Home Assistant. In logs I see message that camera is off:

image

It was working OK with previous integration version. I can access last motion camera at the same time or use go2rtc integration.

Sensors also not showing real status, eg. Actually almost are all off...

image

image image

One more question about those new sensors. Previously I had to disable face detection, humand deterction to make motion detection work. Now I can enable it all?

majkers commented 1 year ago

When restarting HA some more logs: 2023-02-23 17:28:16.588 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry dome_u_1 for yi_hack Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 533, in async_unload result = await component.async_unload_entry(hass, self) File "/config/custom_components/yi_hack/__init__.py", line 150, in async_unload_entry hass.data[DOMAIN].pop(entry.entry_id) KeyError: '255c97486a9155b7949a348dce198fc1' 2023-02-23 17:28:39.388 ERROR (SyncWorker_4) [custom_components.yi_hack.common] Failed to get status from device http://192.168.1.14/: error HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //192.168.1.14/:8080/cgi-bin/status.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4aee6860>: Failed to establish a new connection: [Errno -2] Name does not resolve')) 2023-02-23 17:28:52.381 ERROR (SyncWorker_0) [custom_components.yi_hack.common] Failed to get status from device http://192.168.1.14/: error HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //192.168.1.14/:8080/cgi-bin/status.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f485f2950>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

This url http://192.168.1.14:8080/cgi-bin/status.json is working OK but I think it might try to acces something like //192.168.1.14/:8080/cgi-bin/status.json and that is not OK

roleoroleo commented 1 year ago

If you restart ha, the status of the cam is not updated. I need to add a force refresh to fix this problem. Try to restart the cam and the camera should appear "on".

About the status.json error, I don't know... What version of ha are you using?

majkers commented 1 year ago

It happended on HA version 2023.1.7. Maybe this is the cause? Max retries exceeded with url: //192.168.1.14/:8080/cgi-bin/status.json why there is an extra / before port number?

roleoroleo commented 1 year ago

I don't know. Never seen before. Did you try to remove the the cam from the integration and add it again?

majkers commented 1 year ago

Yes I did. Ok let's leave it for now. I will wait for your next release (with fix youe mentioned above) and check it then.

majkers commented 1 year ago

Just installled 0.4.5 version...camera is still offline... Restarted HA, then restarted camera and it is not helping... Going back to last working version 0.4.2

majkers commented 1 year ago

Cleaning browser cache did not help:

image

image

roleoroleo commented 1 year ago

Any message in the log?

majkers commented 1 year ago

Jus the one I mentioned above with a bottom picture.

roleoroleo commented 1 year ago

I got a doubt. Is mqtt enabled in your ha installation?

majkers commented 1 year ago

Yes. I use zigbee2mqtt

roleoroleo commented 1 year ago

Ok, please run MQTT Explorer and check if you receive stat messages when you start the cam.

immagine

majkers commented 1 year ago

It look somewhat different in my explorer.. image

but....I once again updated to 0.4.5 version doing exactly the same thing as before and now it started to work...... sic! I will test it and leave this issue open for a while

roleoroleo commented 1 year ago

Sometimes OTA update doesn't work properly and a fresh install is necessary. Let me know.