IP camera Xiaomi NAS: how to create and configure with your own hands

Modern video surveillance systems are no longer the domain of specialized security companies. Today, every smart home owner can organize professional monitoring using affordable gadgets. Xiaomi NAS IP camera is one of the most popular requests among enthusiasts who want to get rid of the monthly fee for cloud storage of the video archive. Local data storage not only saves budget, but also guarantees privacy, since your records do not leave the perimeter of the apartment.

The process of integrating the Mi Home ecosystem cameras with network storage may seem difficult for a beginner, but in practice it only requires careful follow-up to the setup steps. In this article, we will explore all the nuances of creating a stable link between the camera and storage. You will learn how to bypass the limitations of proprietary software and make devices work in a single bundle through the ONVIF or RTSP protocols.

Before you start setting up, it's important to understand that not all camera models support direct NAS recording without using an intermediate gateway. ONVIF is the de facto standard for video streaming, and that's what support is worth looking for when choosing equipment. We'll look at methods that are relevant for most current models, including street and rotary devices.

Selection of equipment and network preparation

The first step to building a reliable video surveillance system is to make a smart selection of components. Xiaomi cameras are famous for their value for money, but for working with the best of their abilities. NAS They often need additional activation of functions. IP-It's a camera that supports Wi-Fi or Ethernet, and it's a network storage system. NAS from Synology or QNAP, or a more budget-friendly Raspberry Pi solution with installed software.

For stable transmission of high-resolution video stream, especially if there are several cameras, it is recommended to use a wired connection or Wi-Fi standard 802.11ac and higher. Wireless networks are often subject to interference, which leads to packet loss and intermittent recording of archives. The ideal configuration involves a dedicated VLAN for IoT devices, which isolates camera traffic from the main network and improves overall security.

You also need to make sure that all devices are on the same subnet and have static devices. IP-Dynamic change of address. DHCP This can cause the video surveillance system to lose communication with the storage after restarting the router. pin addresses in the router settings or manually in the interface of each device to avoid confusion in the future.

  • πŸ“· IP-Xiaomi camera (models with support) ONVIF/RTSP)
  • πŸ’Ύ Network storage (NAS) free-place
  • 🌐 Router with support for static addressing (Static) DHCP)
  • πŸ”Œ Ethernet Cable for initial configuration (preferably)
πŸ“Š What type of storage you plan to use?
Ready NAS (Synology/QNAP)
Homemade server (TrueNAS/Unraid)
Cloud Disk (Yandex Disk/Google Drive)
SD-cell-card
Not yet.

After the devices are physically installed, you need to conduct a basic network diagnostics, make sure that the ping between the camera and the future storage is stable and does not exceed the permissible latency values. If you use Wi-Fi, check the signal level at the camera installation point, as walls and overlaps can significantly weaken the signal, especially at 2.4 GHz.

Activation of the ONVIF protocol on Xiaomi cameras

Most users have a problem when the camera is visible in the Mi Home app but not available to third-party recording systems.This is because by default broadcast protocols are often disabled by the manufacturer. To activate hidden features such as RTSP stream and ONVIF, you may need to change the region in the application or use special scripts. Often helps switch the region to China, where the functionality of the devices is wider, but the interface will be in English or Chinese.

There's a way to activate ADB debugging if the camera is running Android, but for many modern models, that's no longer the case. A simpler way is to use modified versions of firmware or plugins for Home Assistant that can pull authorization keys. Without those keys, you can't authorize the NAS as a video stream client.

Once the protocol is activated, you need to set a password to access the video stream. Often, an empty password or password from your Mi Account is used by default, but for security reasons, it is strongly recommended to set a unique complex password specifically for ONVIF. Write it down, as you will need it when setting up a record profile on the network storage.

  • πŸ”‘ Set a unique password for ONVIF user
  • 🌍 Check the region of the device in the Mi Home app
  • πŸ›‘οΈ Disable cloud features if they are not needed to save traffic
  • πŸ“ Lock it down. MAC-tether IP

Set up a network storage for video recording

When the camera is ready to transmit data, it's the turn of the receiving party to set up, and on modern NAS operating systems like Synology's DSM or QNAP's QTS have built-in Surveillance Station (QVR Pro) applications that allow you to centrally manage dozens of cameras, create recording schedules, and customize motion detection.

In the interface of the video surveillance program, you need to create a new camera by choosing the type of connection"ONVIF" or"RTSP". In the address field, specify static IP-The default port for your Xiaomi camera address ONVIF It's usually 80 or 8080, but it can be changed in the settings of the camera itself. RTSP-link.

For Xiaomi cameras format RTSP The links often look like the following: rtsp://username:password@ip_address:554/live/ch00_0. Here, a username is usually a user created in settings. ONVIF, A password is the password you set, and if the link is generated correctly, you'll see a preview of the image in the preview window. NAS.

ParameterDefault valueRecommended valueNote
Port Port RTSP554554Standard port for video streaming
Port ONVIF808080Often changes to avoid conflict
Video codecH.264H.265H.265 saves space but requires a powerful CPU
Permission1920x10801920x1080FullHD is sufficient for identification

After a successful connection, check the load on the NAS processor. Decoding multiple high-resolution threads can significantly strain the system. If you notice an interface slowing down or the device heating up, consider reducing bitrate or switching to sub-stream for continuous monitoring, recording the full stream only on event.

Integration through Home Assistant and Third-Party Software

For those who want to gain maximum control, the Home Assistant automation platform is a great solution. This open-source software allows Xiaomi cameras, NAS and hundreds of other devices to be combined into a single ecosystem. Unlike the standard NAS solutions, Home Assistant gives the flexibility to create complex scenarios.

For example, you can set up a system so that NAS recording only starts when the Xiaomi camera captures movement and the smart lamps in the house turn on red. This will require you to install Xiaomi MiOT integration or use the ONVIF component built into the Home Assistant. Once you add the camera, it will be available for add to any media player or recording system.

⚠️ Note: When using Home Assistant, make sure your server has sufficient resources. real-time video processing can require significant processing power, especially if you plan to use facial recognition features.

The advantage of this approach is that it is independent of the manufacturer’s cloud services. Even if Xiaomi servers are not available or the company decides to limit functionality, your local system will continue to work.

  • 🏠 Centralized management of all smart home devices
  • βš™οΈ Flexible configuration of automation scenarios
  • πŸ”’ Complete data locality and independence from the cloud
  • πŸ“± Easy access from mobile devices through the application

Storage optimization and archive management

High-resolution video recording is fast consumes disk space. To optimize the use of your NAS resources, it is important to properly configure the recording settings. It makes no sense to write video 24/7 in maximum quality if nothing happens in the frame. Motion detection settings save up to 80% of disk space.

Modern systems allow you to adjust the sensitivity of the detector and the activity zone, you can exclude from the control zone the swinging trees outside the window or cars passing by, leaving the reaction only to movements in the immediate vicinity of the camera, and it is also useful to set a schedule so that at night the recording is only on the movement, and during the day – constantly.

Keep in mind the archive rotation policy, set up the system to automatically delete old records or overwrite new ones when the disk is full, which will save you from having to manually monitor the vacant space, and for critical events, you can set up sending notifications or copying a fragment to a separate, secure partition of the disk.

Backup configuration is another important aspect. If your NAS fails, you should be able to quickly deploy your CCTV system on new hardware. Regularly create backups for Surveillance Station settings or Home Assistant configurations. This will save you hours of work reconfiguring your cameras and profiles.

Solving Typical Connection Problems

When setting up the Xiaomi and NAS IP cameras, users often encounter a number of common problems. One of the most common is an authorization error. This may be because the password set for ONVIF does not match the one entered in the NAS settings. Also, the problem may lie in the wrong username; try using "admin" or creating a new user specifically for the cameras.

Another common problem is intermittent flow or no image at all after a few minutes of operation, which often indicates a lack of network bandwidth or overheating of the camera. Check whether the router firewall blocks the ports used for the video stream. In some cases, switching the camera to compatibility mode or reducing the bitrate of the video helps.

⚠️ Note: If the camera is constantly losing contact with the NAS, Check the Wi-Fi router's power saving settings. Some routers may break the connection to "low-active" devices, which include standby cameras.

And also the problem of time desynchronization, if you're on camera and on camera. NAS It's different, it's going to be very difficult to find a time record of the event. NTP-You can either manually set the time to the minute, or you can set the time to the minute, and that's critical to the legal validity of the video.

Questions and Answers (FAQ)

Can you record video from the Xiaomi camera to the usual? USB-router-connected?
Technically, this is possible if the router supports the FTP or SMB video recording function and has a productive processor, but the stability of such recording is often lower than with a full-fledged NAS. Routers often can not cope with encoding and writing multiple streams simultaneously, which leads to loss of frames.
Which video format is better for saving space: H.264 or H.265?
H.265 (HEVC) format allows you to reduce the file size with the same image quality by 30-50% compared to H.264. However, more powerful hardware is required to play and process this format. If your NAS or client device is old, it is better to stay on H.264 for compatibility.
Is it safe to access Xiaomi’s camera from the internet?
Directly sniffing the camera ports into the Internet is extremely insecure. VPN-Connecting to your home network or the manufacturer's cloud services with two-factor authentication. NAS set up a safe tunnel or use it. HTTPS certified.
Why Xiaomi’s camera doesn’t work with ONVIF after the firmware update?
Manufacturers often change security algorithms or close access to protocols in new versions of software, in which case you may need to roll back on the previous version of the firmware or wait for an update to integrate in third-party software (for example, Home Assistant), which will bypass new restrictions.