Connecting Xiaomi smart camera

Is there some news in this area? Some progress in the integration of RTSP protocol?

I kindly ask you again if there is some update about Rtsp support? Thank you in advance

Hi! Check the main thread about rstp integration Rtsp stream support for camera

Hi all – old topic, I know, but I have exciting news on this front: I’ve developed a HASS integration with the YI Home Cameras:

Unlike some hacks that force you to enable experimental RTSP streaming, yet lose the ability to use the official Yi app, this allows for both.

I’m waiting for some underlying library updates (and a lot more testing) before I publish, but I’m excited!

9 Likes

Excellent!!

And how?

My platform makes use of the v3 Yi “hacked” firmware, which (a) retains usage of the mobile app and (b) enables an FTP server. The platform utilizes FTP to find and stream the latest captured video file.

You can see my progress here: https://github.com/home-assistant/home-assistant/pull/9787

4 Likes

hi, is this the right cam:

or this one:

https://www.gearbest.com/ip-cameras/pp_615275.html

thanks!

The documentation on the HASS website lists the cameras. That said, if you can install a custom firmware that enables an FTP server, it’s likely that camera will work.

It looks like this camera component is using particular ftp folder /tmp/…
Would it be possible to add an additional configuration to the component where you can specify the folder?
For instance, I have another YI smart camera with ftp server, but the component doesn’t work with it since there is some slight difference in its folder structure.

Yes, I can definitely add support. Can you share your full structure (path, folders under that path, etc.) so I can brainstorm a holistic strategy?

Thanks, the path is the following: ftp://xx.xx.xx.xx/tmp/hd1/record/

1 Like

And under that, are there multiple folders, each with MP4s?

Yes, I believe it’s the same structure of folders based on date/time with .mp4 files.

1 Like

Great! I will add an enhancement that allows you to specify a custom folder path. Stay tuned!

1 Like

I came across something great: turns out, I already put that feature in the platform – I just forgot to document it!

Use the path key to change your path:

camera:
  - platform: yi
    host: '192.168.1.100'
    password: my_password_123
    path: /tmp/hd1/record

Give that a shot and let me know how you get along. In the meantime, I’ll submit a PR to update the docs.

Xiaofang hacks firmware does have FTP server but doesn’t write mp4 files. I don’t think the component can be used. The RTSP stream support issue remains.

Does it save any type of video? Let me know; I’d be happy to see if I could expand the platform to cover your use case.

I can think of one option: Disable RTSP server so cloud app is functional. Now, enable record to SD in the cloud app. So, there should be recorded files available on the ftp server. I can try this out tomorrow.

EDIT: \record\20171107\07\ is the folder on the SD card. Files are indeed mp4 (audio is PCM ALAW and video is H264 AVC1). It seems to record multiple files, each around 1 minute long and around 1-1.5 MB in size. My folder had 33.mp4, 34.mp4 and so on.

So my guess is :slight_smile: \record\YYYYMMDD\HH\MM.mp4.

Got it! In that case, I think this configuration should work:

camera:
  - platform: yi
    host: '192.168.1.100'
    password: my_password_123
    path: /record

Logged into FTP and found this is the correct folder: /media/mmcblk0p1/record/

EDIT: A bug in the hacked firmware is preventing SD card from being found in Mi Home. So, recording cannot be turned on with the latest official firmware. But downgrading works!

I’m getting this error:
[homeassistant.components.camera.yi] There don’t appear to be any uploaded videos
[haffmpeg.core] FFmpeg fails program arguments must be a bytes or text string, not bool

My config:
camera:

  • platform: yi
    name: DoorCam
    password: 123
    host: ‘192.168.1.36’
    path: /media/mmcblk0p1/record/

I used a dummy password since the camera runs an anonymous ftpd.

EDIT2: Got something to happen! I see files in the ftp folder. They open in VLC just fine. Now, the HASS component is also loading fine and there are no ffmpeg errors in the log.

However, I’m getting a strange black image with ASCII characters

@bachya: seems the system time on the camera (in GMT) is wrong. Do you think this could be causing an issue?