Xiaomi camera C300 β Popular Video Surveillance Solution with Support 2K-But its integration into the Home Assistant ecosystem is often questionable. Unlike natively supported HomeKit or Google Home devices, Xiaomi cameras require additional manipulations to work properly in an open automation platform.
In this article, we will discuss all the current ways to connect Xiaomi C300 Home Assistant β from the official Mi Home Integration plugin to alternative solutions RTSP-flow MQTT. We'll focus on common errors (e.g., missing images or stream delays) and how to fix them. If you've tried to connect your camera and you've had problems, here's a proven solution.
1.Preparation of Xiaomi camera C300 before integration
Before you start setting up Home Assistant, you need to properly configure the camera itself in the Mi Home app (or Xiaomi Home for European regions), without which further integration will not be possible.
First, make sure the camera is connected to your local network via 2.4GHz Wi-Fi β Xiaomi C300 It doesn't support 5GHz networks. Also check that the Mi Home app displays the camera as an Online status and streams video without artifacts. If the image slows down already at this stage, the problem is more network-based than Home Assistant.
- π§ Update the camera firmware to the latest version via Settings β About the device β Update in the application Mi Home.
- π Connect the camera to the same network as the Home Assistant server (avoid guest networks or other networks). VPN).
- π Enable Local Access (if available) in your camera settings β this will make integration easier.
- π‘ Check the strength of the Wi-Fi signal at the camera installation site (must be at least 70% of the signal level).
β οΈ Note: If you are using Xiaomi C300 With Chinese firmware (e.g., purchased on AliExpress), some features may be blocked for European regions, in which case you will need to change the region in the Mi Home application or install an alternative firmware.
2.Official method: integration through Mi Home
The easiest (but not always stable) method is to use the official Xiaomi Miio plugin for Home Assistant. RTSP, but has limitations: for example, no sound support and video delays are possible.
To add a camera through Mi Home Integration, follow the following steps:
- Open the Home Assistant web interface and go to Settings β Devices & Services β Add Integration.
- In the search bar, type Xiaomi Miio and select the appropriate plugin.
- Enter the username and password from your Mi Home account (make sure two-factor authentication is enabled).
- In the list of detected devices, find Xiaomi C300 And add it to the system.
Once successfully connected, the camera will appear in the Media or Devices section, but there is a caveat: official integration often only works with Xiaomi's Chinese servers, which can lead to high ping and lags. If the image slows down, move to alternative methods.
| Parameter | Formal integration | RTSP-flow | MQTT |
|---|---|---|---|
| Support for video | β Yes (with delays) | β Yes (real time) | β No. |
| Sound support | β No. | β Yes (when setting up) | β No. |
| Local work. | β No (depends on the cloud) | β Yes. | β Yes. |
| Difficulty setting up | β (simple) | βββ (middle-of-the-road) | ββββ (difficult) |
π‘
If the camera doesnβt appear in Home Assistant after adding, try restarting the server or updating the access token in the integration settings.
Alternative method: connection through RTSP-flow
For those who want to get real-time stable video without depending on the Xiaomi cloud, the best option is customization. RTSP-This method requires prior activation of the flow. RTSP on the camera itself, which is possible only through informal firmware or special utilities.
Attention: Xiaomi C300 default does not support RTSP. It will be necessary to turn it on:
- π Install an alternative firmware (e.g. Hack) C300 developer community).
- π§ Use Mi Home Hack to unlock hidden functions.
- π‘ Connect to the camera via Telnet and manually activate RTSP-server.
After activation RTSP You'll need it. URL-Standard format for Xiaomi C300:
rtsp://[IP_Cameras]/live/ch00_0Where [IP_Cameras ] - local IP-Device address on your network (can be found on the router or via the Fing app).
In the Home Assistant, add the camera as a Generic Camera.
- Go to Settings. β Devices and services β Add integration β Generic Camera.
- Insert the Stream Source field RTSP-URL.
- Please provide the camera name (e.g. Xiaomi) C300 Front Door).
- Save the settings and check the flow in the Media section.
β οΈ Note: Using unofficial firmware can lead to loss of warranty and unstable camera operation. Before firmware, back up the original software through the utility MiHome_Backup_Tool.
βοΈ Preparation for setup RTSP
4. Customization of sound and notifications
One of the main drawbacks of official integration is the lack of support for two-way audio. C300, You will need to adjust it via FFmpeg or MQTT.
To transmit sound through RTSP-flow:
- Make sure that in RTSP-URL specified parameter for audio: rtsp://[IP]/live/ch00_1 (where ch00_1 β audio-channel).
- In Home Assistant, add a media player through FFmpeg integration:
media_player:
- platform: ffmpeg
name: Xiaomi C300 Audio
input: rtsp://[IP]/live/ch00_1For traffic notifications:
- π Set up automation in Home Assistant that responds to an event motion_detected camera-wise.
- π± Use notify to send push notifications to your smartphone:
automation:
- alias: "Movement at the door"
trigger:
platform: state
entity_id: binary_sensor.xiaomi_c300_motion
to: "on"
action:
service: notify.mobile_app_your phone
data:
Message: "C300 camera detected motion!"
title: "Security"How to check the microphone?
5. Solving typical problems
Even after setting it up correctly, users often encounter errors, and here are the most common ones and ways to fix them:
| Problem. | Possible cause | Decision |
|---|---|---|
| The camera is not displayed in the Home Assistant | The wrong token or region in Mi Home | Change region to βChinaβ in your Mi Home account settings and reboot HA |
| Video lagging or slowing down | Low Wi-Fi bandwidth | Switch the camera to a Wi-Fi channel with less congestion (use Wi-Fi Analyzer). |
| No sound in RTSP-flow | The audio channel is not activated in the firmware | Check your Hack firmware settings or update it to the latest version |
| The camera shuts down in 5 minutes. | Energy-saving router mode | Turn off "Energy Saving" for the camera in the router settings |
If the camera doesn't work after all the manipulations, check the Home Assistant logs for errors.
- Go to Settings. β System system β Magazines.
- Filter your posts by the keyword camera or xiaomi.
- Note the Connection refused or Authentication failed errors, which will indicate a connection or token problem.
π‘
If the camera is running through RTSP, but the image is interrupted β reduce the bitrate of the video in the camera settings to 2-4 Mbps will reduce the network load.
6. Optimizing performance and safety
After successful Xiaomi connection C300 It is important to ensure that data is stable and protected:
- π Change the standard camera password in the Mi Home app to a complex one (at least 12 characters with numbers and special signs).
- π Set up Geofencing in Home Assistant so that the camera only activates when youβre not at home.
- π¦ Limit access to RTSP-stream through the router firewall (allow connections only from IP-Home Assistant server address).
- π Update your camera firmware and Home Assistant components regularly (especially FFmpeg and Miio).
To reduce the load on the system:
- π Reduce the flow resolution to 1080p, if 2K non-critical.
- β± Set up a record by motion instead of a constant stream (use MotionEye or Frigate integration).
- π Archive records older than 7 days on an external drive (via Samba share or Google Drive).
β οΈ Note: If you are using Xiaomi C300 For street surveillance, make sure the camera is protected from moisture (protection class) IP65). Lower temperature -10Β°C possible battery failures (if wireless version is used).
7. Alternative integrations: MQTT Homebridge
If neither formal integration nor RTSP Not in the same way as the functionality, consider the options MQTT These methods are more difficult to set up, but give more flexibility.
Method 1: MQTT
This will require:
- Install MQTT-Broker (e.g. Mosquitto) to the Home Assistant server.
- Set the camera to send events (movement, sound) to the topics MQTT.
- Add configuration to configuration.yaml for MQTT-camera:
camera:
- platform: mqtt
name: Xiaomi C300 MQTT
topic: home/camera/c300/feed
image_topic: home/camera/c300/imageMethod 2: Homebridge
If you are using Apple HomeKit, you can connect the camera via Homebridge with the homebridge-camera-ffmpeg plugin:
- Install Homebridge on the same server as the Home Assistant.
- Add to the config. config.json:
"platforms": [
{
"platform": "Camera-ffmpeg",
"name": "Xiaomi C300",
"videoConfig": {
"source": "-i rtsp://[IP]/live/ch00_0",
"maxStreams": 2,
"maxWidth": 1280,
"maxHeight": 720
}
}
]Both methods circumvent the limitations of formal integration, but require a deep knowledge of server configuration.