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

No privacy mode sensor on 0.4.5/How to turn off the cameras? #119

Closed pannal closed 5 months ago

pannal commented 1 year ago

There's no privacy sensor available anymore. Calling http://yicam1:8080/cgi-bin/privacy.sh still works.

Firmware Version: 0.2.6 Model Suffix: r30gb

Controls: image

bedson87 commented 1 year ago

I just updated and want report it ;-) it's a very useful option for automation. At this point, I have to turn off the camera completely so that it does not record unnecessarily, but I lose the preview.

Cam - y211ga

roleoroleo commented 1 year ago

This is a breaking change of the last release (both hack and integration). privacy.sh is no longer available, if you reinstall the hack from scratch the service http://yicam1:8080/cgi-bin/privacy.sh will not work. The switch is replaced by switch_on that is synced with the app.

pannal commented 1 year ago

Oh OK. I'll stay on the legacy version, then. Thank you!

pannal commented 5 months ago

I'm sorry, I'm using the latest 0.4.8 on two r30gb_0.3.0.

I have no idea how to turn the cameras on or off from HA. camera.turn_off does turn it "off" for HA (the sensor reads as off), but the camera stream still works. The "Switch On" toggles do absolutely nothing. The only way I can reliably turn the cameras off now is by using the toggle in the Web UI.

What am I missing? I've tried HA's generic turn off, the mediaplayer turn off, the Switch On toggle. Nothing changes the video stream state/availability other than turning the cameras off using their Web UI.

Edit: Using the toggle in the Web UI is also the only one that actually results in the camera doing something (clicks). Edit 2: Switch On in HA also doesn't synchronize with the camera state in the Web UI.

Edit 3: Seems like the main (HD) streams actually turn off when calling HA's camera.turn_off, but the SD streams (0_1) don't. Nope, they still open.

roleoroleo commented 5 months ago

"Switch on" in ha should work and should be synchronized with the web gui. Please, try to remove the cam from ha and add it again.

pannal commented 5 months ago

Just did, the switch isn't synchronized at all. One thing I've noticed: The camera settings page on the Web UI says Any change will take effect immediately. - that isn't true as it seems. The camera only turns on/off when Save Configuration is pressed as well.

image

image

pannal commented 5 months ago

I've just removed all yi cameras from HA, rebooted HA and rebooted the cameras.

Only added one camera for the time being, and the state is not synchronized this time, either: image

This time the camera reports as "on", "Switch On" doesn't. The camera is set to On in the Web UI.

roleoroleo commented 5 months ago

The camera only turns on/off when Save Configuration is pressed as well.

Yes, the meaning is that you don't need to reboot the cam. For the other pages you need to reboot the cam.

From the images above it seems that the connection between ha and the cam doesn't work at all. Did you configure properly mqtt?

pannal commented 5 months ago

Oh, mqtt HAS to be active for this? As the addon was creating sensors and not throwing any errors on setup, I was under the impression that mqtt was optional. Good to know, I'll try again, thank you.

roleoroleo commented 5 months ago

Yes, mqtt is mandatory.

pannal commented 5 months ago

Thank you, When using mqtt, is device renaming in HA still supported? Also what modes have to be enabled in the mqtt config on the camera?

roleoroleo commented 5 months ago

Thank you, When using mqtt, is device renaming in HA still supported?

I think it's supported but I never tested.

Also what modes have to be enabled in the mqtt config on the camera?

Set general options: immagine

Set topic prefix: immagine

Other options are not important.

pannal commented 5 months ago

Nothing to enable on /index.html?page=mqtt_adv?

pannal commented 5 months ago

OK, thank you so much, this seems to work now, with just MQTT enabled (and nothing on the advanced mqtt page). I do have a lot of duplicate sensors/switches now, though.

pannal commented 5 months ago

Works, thank you so much.