Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

In the previous note, we successfully installed the Lucky tool on the CM0 and configured IPv6 internal penetration, SSL certificates, and reverse proxy functionality, enabling FileBrowser.

This article will continue from that foundation to install Docker, Home Assistant Container, HACS Fast Version, and integrate Xiaomi devices, further challenging the limits of the CM0.

1. Advantages of CM0 NANO Hardware

<span>CM0 NANO</span> is a low-cost development board based on the <span>Raspberry Pi Compute Module 0</span> (CM0). It features a 1 GHz quad-core 64-bit Arm Cortex-A53 processor, 512 MB of onboard memory, and optional eMMC storage and wireless modules.

The CM0 NANO has a rich set of interfaces, including 1 HDMI output, 2 USB 2.0 ports, 1 100M Ethernet port, and 1 MIPI DSI and 1 MIPI CSI interface each, supporting display and camera expansion. Its native USB and Ethernet interfaces provide a stable and reliable hardware foundation for smart home applications.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

2. Choosing the Home Assistant Solution

<span>Home Assistant</span> is an open-source home automation platform that supports local operation and can integrate various smart devices for unified control and automation management. The official recommendations currently focus on two deployment methods: Home Assistant OS (HAOS) and Home Assistant Container.

Considering that the CM0 NANO is only equipped with 512MB of memory, our previous attempt to install the 64-bit HAOS failed due to insufficient memory. After multiple tests, we ultimately chose the more resource-efficient and flexible Home Assistant Container solution.

The Raspberry Pi OS we installed (based on Debian 13 “trixie”) integrates ZRAM and disk writeback swap mechanisms, which significantly improve system stability on low-memory platforms like the CM0 without additional configuration.

To further free up valuable memory resources, we minimized the GPU memory allocation to 16 MB and added the GPU memory configuration to the <span>config.txt</span> file:

echo "gpu_mem=16" | sudo tee -a /boot/firmware/config.txt

After completing the modification, restart the system to apply the configuration.

3. Installing Docker

First, log into the system via SSH and execute the following command to install the Docker environment:

curl -fsSL https://get.docker.com | \
  sed 's|https://download.docker.com|https://mirrors.aliyun.com/docker-ce|g' | \
  sudo sh

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

Next, add the current user to the docker user group so that Docker commands can be run without sudo:

sudo usermod -aG docker $USERnewgrp docker

To improve the speed of pulling images, configure a domestic mirror accelerator:

sudo mkdir -p /etc/dockersudo tee /etc/docker/daemon.json << EOF{  "registry-mirrors": [    "https://hub-mirror.c.163.com",    "https://docker.mirrors.ustc.edu.cn"  ]}EOF

Finally, restart the Docker service to apply the configuration:

sudo systemctl restart docker

4. Installing Home Assistant Container

Run Home Assistant Container using Docker by executing the following command:

mkdir -p ~/homeassistant
docker run -d \
  --name homeassistant \
  --restart=unless-stopped \
  -e TZ=Asia/Shanghai \
  -v ~/homeassistant:/config \
  -p 8123:8123 \
  ghcr.io/home-assistant/home-assistant:2024.10.1

Once the container starts, you can access the Home Assistant management interface via the browser at <span>http://localhost:8123</span> or <span>http://yourIP:8123</span>.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

At this point, the system memory usage is approximately 300 MB, which is within the acceptable range for the CM0 NANO.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

5. Installing HACS Fast Version

HACS (Home Assistant Community Store) is a popular third-party integration store, but it is difficult to use in China due to network issues. Therefore, we use the HACS Fast Version optimized by domestic developers. Execute the following command to complete the installation:

cd ~/homeassistant
wget -O - https://get.hacs.vip | bash -

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

After the installation is complete, restart Home Assistant to load the new components:

docker restart homeassistant

Then enable HACS in the web interface:

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

  • Go to Settings → Devices & Services

  • Click the bottom right “Add Integration”

  • Search for HACS and click install

  • Confirm the relevant statements as prompted

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

After successful installation, the HACS option will appear in the left menu of Home Assistant.

6. Installing Xiaomi Integration

The Xiaomi integration is a Home Assistant component officially supported by Xiaomi, allowing seamless integration of Xiaomi ecosystem devices into Home Assistant. With the installed HACS, the operation is very simple:

  • Search for Xiaomi Home

  • Go to the details page and install it

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

After downloading, restart Home Assistant, then search for “Xiaomi Home” in Settings → Devices & Services → Add Integration, and log in with your Xiaomi account as instructed.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

After successful login, the system will display the Choose Home and Devices window. After selecting the target home, all associated smart devices will be automatically imported into Home Assistant.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi IntegrationDeployment Results: After successfully installing the Xiaomi integration, the newly added Xiaomi Home service can be seen in the integration management page of Home Assistant. All Xiaomi devices have been successfully integrated into the system.Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi IntegrationOn the overview page, Xiaomi devices are clearly displayed by area, facilitating centralized control and personalized scene linkage.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

The system ultimately runs stably, with memory usage maintained at around 400 MB.

Pushing the Limits of CM0 NANO: Installing Home Assistant, HACS, and Xiaomi Integration

Thus, we have successfully deployed Home Assistant Container on the resource-constrained CM0 NANO, installed HACS and Xiaomi integration, fully validating its feasibility in lightweight home automation scenarios.

Recommended Reading:

Installing Home Assistant OS and ha_xiaomi_home Xiaomi Integration on Synology NAS

One command to solve IPV6 internal penetration and reverse proxy

USB expansion board for Raspberry Pi CM0 Dev Kit

Raspberry Pi CM0 + OpenCV Practical: License Plate Recognition

Raspberry Pi CM0 + OpenCV Practical: Easily Achieve Real-Time Face Detection

Playing Super Mario with Raspberry Pi CM0, making the neighbor’s kids cry with envy

Mastering Raspberry Pi CM0: Enabling DSI Touch Screen and CSI Camera

Mastering Raspberry Pi CM0: Driving OLED and AHT10 to Easily Display Temperature and Humidity Data!<img src=”https://mmbiz.qpic.cn/sz_mmbiz_gif/ACdUa3SX5Gs2oFlMvA4mfeS3dPdY7UVNXwJBAAV2x1ZfCxLI7iaR6VRW02aTMtCgWyZnMvDUtDxySUwdnJECfFQ/640?wx_fmt=gif&from=appmsg#imgIndex=13″

Leave a Comment