Yi Home Camera with Home Assistant?


I have an old Xiaomi Yi Home Camera 720p, which is a 12CN version, so it’s a few years old. I don’t remember when I did install a special firmware to it, so I don’t know what is installed. But I am able to use the camera from the Mi Home app, and I can also visit the camera IP in a browser and see all the files on the SD-card.
I am also able to view RTSP if I visit: rtsp://myipadress/ch0_0.h264
And I have tried it with https://home-assistant.io/components/camera.yi/ which displays the latest video-file where there is movement (not a live stream). Is it supposed to show a live stream?

My question is, is it possible to secure this camera somehow? I can access the RTSP stream via the IP without any username/password, I can also visit the IP-adress in a browser and browse all the video-files, without a username/password.
So how have you solved this? Even if it is only available internally I don’t want it to be this unprotected.

I can also access it via telnet, root and password 1234qwer.

One last thing. To get the timestamp working (the one watermarked in the video) I had to edit a file called TZ which is found in /etc/ on the camera. I changed this from GMT +0 to GMT +7 which gives me the correct time. But when daylight saving time comes in spring again, this will be 1 hour off. Is there a way to get this to update automatically?

1 Like

And I also have this type of cam (12CN). Just yesterday I started to resuscitate it and integrate it into HA. From what we searched for on the net, fritz-smh is the last to launch a modified firmware for rstp access but without security access.
So for those who are interested in the topic:
firmware change fritz-yi hack
reverse original firmware post # 5: firmware with access outside China
alternative: alternative firmwares

Yesterday I resolved implement Fang Xiaomi Cam with success and today I try to implement 12CN in HA.

About timestamp maybe is a common problem like to Fang Cam see details: Fang cube and search
+1 Hour Offset Issue
I’m going to come back with the implementation of CN12.

1 Like

I got it working, but there is one thing I do not like. I can access the camera via a webbrowser and view all the files it has recorded. Without even logging in, so everyone who has access to my network can view all the videos this camera has recorded. I do not like that, and I have tried to disable the http feature and only keep the rtsp and ftp services, but I don’t know how.

Another option would be to block the cameras IP-adress from access in the router with http:// but I haven’t figured that out (I have a Asus RT-AC68U with Merlin firmware if anyone has suggestions?).

Yes it works. I changed Fritz hack and I add some lines in configuration.yaml

  - platform: ffmpeg
    input: -rtsp_transport tcp -i rtsp://fix-ip1 /unicast
    name: Xiaofang 1
  - platform: ffmpeg
    input: -rtsp_transport tcp -i rtsp://fix-ip2:554/ch0_0.h264
    name: YI

You must make an update inspired from here yi-home-camera-with-home-assistant

sudo apt-get install libav-tools

other: my HA is 0.60.0

Picture refresh vary from 5 to 14 seconds.

Now I search ideas how to implement TinyCam in HA (tinycam into an media-player or old smartphone with android) . https://tinycammonitor.com/.
These is good software I like to help me to manage other no name camera.

hi, sorry for my english… when i puy the sd in the yi…and plug connector usb… don’t start the hack
yi start normally…

sd is fat32
folder and file it’s ok from guide…

help!!! thankyou