Xiaomi camera platform allows you to utilize Xiaomi Cameras within Home Assistant.
To successfully implement this platform, the Home Assistant host should be capable of multiple simultaneous reads. For every concurrent Home Assistant user, a connection will be made to the camera every 10 seconds. This should normally not be a problem.
Preparing the Device
In order to integrate the camera with Home Assistant, it is necessary to install a custom firmware on the device. Instructions for doing so can be found for each models.
- Yi 720p
- Yi Home 17CN / 27US / 47US / 1080p Home / Dome / 1080p Dome
- Recent Yi 1080p Home / 1080p Dome
- Xiaofang 1080p Camera
Once installed, please ensure that you have enabled FTP.
Currently, version 0.1.4-beta2 of the custom firmware is the highest supported. Firmwares higher than this version use Pure-FTPd, which has a bug that prevents FFmpeg from correctly rendering video files.
Raspbian users: Don’t forget to install
ffmpeg support on your platform, otherwise, you’ll not see video.
Configuring the Platform
To enable the platform, add the following lines to your
camera: - platform: xiaomi name: Camera host: "192.168.1.100" model: "yi" password: YOUR_PASSWORD
The IP address or hostname of the camera.
The password to the FTP server on the camera (from above), can be any string as the current firmware doesn’t allow setting ftp passwords.
The default for
path: will not work with all cameras. It may be needed that you add that key with the exact path for your device.
Any option supported by
ffmpeg camera can be utilized via the
ffmpeg_arguments configuration parameter.
One particularly useful adjustment deals with video size. Since Yi videos are fairly large (especially on the 1080p cameras), the following configuration will bring them down to a manageable size:
camera: - platform: xiaomi name: My Camera host: "192.168.1.100" model: "xiaofang" password: YOUR_PASSWORD path: /home/camera/feed ffmpeg_arguments: "-vf scale=800:450"
The hostname/IP address can be provided either a value or from the existing entity attributes.
camera: - platform: xiaomi name: Front Camera host: "" model: "yi" password: 1234 path: /tmp/sd/record