Add YI home camera services to turn on / off and enable / disable motion tracking

Hi,
I’m a very happy user of Home Assistant!

I tried to use camera services for a YI camera but I realised that they are not implemented when I received a NotImplementedError.

Exploring the code I found that the Camera class has 3 method:

  • turn_on
  • turn_off
  • enable_motion_detection
  • disable_motion_detection

with a raise NotImplementedError() as implementation. In the YiCamera class the methods are not defined.

Is it planned to develop these functionalities?

Original Yi HASS developer here. I’ll look into it!

Thank you! I followed the documentation here, and I can see (a minute delayed) videos from the camera on my Home Assistant page. So I guess the installation was successful.

I took a look. Unfortunately, there’s no easily-detectable way to implement these services; when I try to sniff the traffic from the Yi Home app to my camera, the network connection drops. So, I can’t see (or replicate) HTTP calls to enable or disable a camera.

I will certainly keep my eyes open for other possibilities.

Thanks for being interested

Hey everyone,

Sorry to re-open an old topic like the following. I would however have the same need.
I notice that if you flash your camera with YI hacks, you could use a HTTP call to YI-Hack to disable the camera.

http://CAMERAIP:CAMERAHTTPDPort/cgi-bin/camera_settings.sh?save_video_on_motion=yes&sensitivity=low&led=no&ir=yes&rotate=no&switch_on=no

Does anyone of you have an idea how we could integrate this with Hass.IO ?

I tried to use the turn on, turn off action of the Hass.IO with my camera entity ID but didn’t work :frowning:

If any one of you have an idea how we could use this to turn off with Hass.IO would be amazing.

thanks in advance.

1 Like

I know it’s a very late answer, but hope it can be usefull anyway.

You can achieve that by using Home Assistant native REST integration, by adding the http call in your configuration.yaml.

You can check here for other details: https://www.home-assistant.io/integrations/rest_command/

Or this intergration.
Works great for me.