Solving Yi Camera and Home Assistant Integration Issues
Integrating Yi cameras into Home Assistant can be a powerful way to create a locally-controlled, customised security system. However, due to the closed nature of Yi's ecosystem, the process can sometimes be challenging. If you're struggling with connection failures, unavailable streams, or other integration problems, this guide is here to help you troubleshoot.
Understanding the Challenge with Yi Cameras
The core issue with Yi cameras is that they are not designed for open integration. They do not officially support protocols like RTSP (Real-Time Streaming Protocol) or ONVIF (Open Network Video Interface Forum) out of the box, which are the standard ways Home Assistant communicates with cameras.
To overcome this, the Home Assistant community has developed brilliant custom firmware and custom components. These unofficial modifications unlock the camera's potential, enabling features like RTSP that are essential for Home Assistant. Most problems stem from issues with this custom firmware or the Home Assistant integration's configuration.
A Step-by-Step Troubleshooting Guide
Let's break down the common problems and their solutions.
1. Ensure You Have the Correct Custom Firmware
This is the most critical prerequisite. You cannot integrate most Yi cameras with Home Assistant using the stock, official firmware.
- Identify Your Camera Model and Version: You need to know the exact model number of your Yi camera (e.g., YI 1080p Home) and its hardware version. This is crucial as different models require different custom firmware.
- Find the Right Firmware: Search for projects like "yi-hack" on GitHub. These projects provide custom firmware for various models. Read their documentation carefully to find the version that matches your camera.
- Flash the Firmware: Follow the instructions provided by the firmware developers to flash it onto your camera, which usually involves placing specific files on an SD card and rebooting the camera.
2. Verify the RTSP Stream is Working
Once custom firmware is installed, you must confirm that the RTSP stream is active before even touching Home Assistant.
- The custom firmware should provide you with an RTSP URL. It typically looks something like:
rtsp://<camera_ip_address>/ch0_0.h264 - Use a video player that can open network streams, such as VLC Media Player.
- In VLC, go to
Media > Open Network Streamand enter the RTSP URL of your camera. - If the video feed appears in VLC, you know the camera is correctly configured and broadcasting the stream. If it doesn't work here, it will never work in Home Assistant. Double-check the camera's IP address and the firmware's documentation.
3. Correctly Configure the Home Assistant Integration
Once the RTSP stream is confirmed, you can add it to Home Assistant.
- Use the Generic Camera Integration (for RTSP): The most reliable method is often the generic camera integration, which is now configured via the UI.
- Go to Settings > Devices & Services > Add Integration.
- Search for and select Generic Camera.
- Stream Source URL: Enter the RTSP URL you tested in VLC.
- Still Image URL: You can often leave this blank initially.
- Authentication: If your custom firmware has a username and password for the stream, select 'basic' and enter them.
- Use a Custom HACS Integration: Some custom firmwares work best with a corresponding custom integration installed via HACS (Home Assistant Community Store). If the firmware documentation recommends a specific HACS integration, use that one instead of the generic camera.
4. Address Network and 'Unavailable' Issues
If the camera shows as 'Unavailable' in Home Assistant, consider these points:
- Static IP Address: Your camera's IP address might be changing. It is highly recommended to assign a static IP address or a DHCP reservation for your camera in your router's settings. This ensures the address Home Assistant is trying to reach never changes.
- Firewall Rules: Ensure that your network's firewall is not blocking traffic on the RTSP port (usually port 554) between your Home Assistant server and the camera.
- Avoid the Official Yi App: Using the official Yi Home or Kami Home app on your phone can sometimes connect to the camera and disable the custom scripts that enable the RTSP stream. After a reboot, it's often best to connect only via Home Assistant or your direct RTSP feed.
Final Tips
- Read the Documentation: The GitHub pages for the
yi-hackprojects are the ultimate source of truth. Read their FAQs and open issues to see if others have solved a problem similar to yours. - Start Simple: Get the video stream working first. Once you have a stable feed in Home Assistant, you can then explore more advanced features like motion detection sensors or controlling the camera's LED.
- Patience is Key: Integrating these cameras is a DIY project. It may require some trial and error to get the right combination of firmware and configuration for your specific model.