Using PVE to Build Your Own Smart Device Management Platform Based on Home Assistant OS
本文最后更新于 279 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。
Article Abstract
To integrate Xiaomi devices with the Apple ecosystem, the user deployed the Home Assistant OS smart management platform based on PVE, batch-connected 48 Xiaomi devices via the Xiaomi Miot Auto plugin, and synchronized the devices to the Apple Home App using HomeKit Bridge. During deployment, a virtualization solution was adopted to resolve network compatibility issues, and configuration file sharing was achieved through Samba Share, ultimately building a smart home system covering device control and automation scenarios (such as an amplifier triggering lights). This practice demonstrates the application value of virtualization technology in smart ecosystem integration, providing a feasible solution for cross-platform management of multi-brand devices.
Qwen3-14B · 2026-06-18

Preface

I started playing with smart homes probably right when Xiaomi first launched theirs, so I should be considered one of the earliest smart home enthusiasts. I bought whatever they released (I even replaced all the regular light switches in my house with remote-controlled ones, though they almost all broke in less than 3 years...), so I have a ton of Xiaomi smart devices and automations at home:

image.png

Then I started building the Apple ecosystem:
image.png

Although Xiaomi's smart features can be added directly to Siri via the Mi Home app:
image.png

But it's not very convenient. Plus, I have now fully switched to Siri and don't want to call out to Xiao AI anymore. How can I bridge Mi Home devices with the Apple ecosystem? That's when I thought of Home Assistant (HA). I never really had the motivation to look into it before, but now I finally have a reason to play around with it.

Deploying Home Assistant

Choosing the Installation Method

Home Assistant provides four different installation methods (HA OS, HA container, HA Supervised, HA Core), and the official recommendation is to use HA OS.

Experienced users can also choose other methods based on their specific needs, such as running HA in a virtual environment (like Proxmox) or on top of an existing operating system (like Windows, macOS, Linux).

Note: While these installation methods can provide some flexibility for advanced users, they may also have significant limitations. For example, you might not be able to use add-ons and other important Home Assistant features:

image.png

Since I already have an existing PVE environment, I chose to deploy HA OS on PVE. You can choose the method that best suits your actual environment.

Creating a Home Assistant OS Virtual Machine

Download the latest version of the Home Assistant OS qcow2 file suitable for installation on PVE. The link is as follows:
https://github.com/home-assistant/operating-system/releases。

image.png

The latest version when I downloaded it was 12.2.rc1. After extracting it, upload the qcow2 file to the /root directory of PVE.

Note: This was right around the time the xz-utils backdoor vulnerability was exposed. Make sure your xz version is not 5.6.0 or 5.6.1.

Create a new virtual machine on PVE and remember its VM ID (here, taking 108 on my PVE as an example).


For the detailed process of creating a new virtual machine, please refer to my other article:OpenWrt Soft Router Series: Detailed Tutorial on Deploying OpenWrt (23.05.2) on PVE, the only difference is that after creation, you need to change the BIOS type to OVMF (UEFI) in the hardware settings:

image.png


Import the downloaded qcow2 hard disk into the virtual machine:

qm importdisk 108 /root/haos_ova-12.2.rc1.qcow2 local-lvm

Add the imported disk:

image.png

image.png

Modify the boot order of the virtual machine:
image.png

image.png

Enable the virtual machine:
image.png

Boot completed:
image.png

The IP shown in the red box in the image above is the IP address of Home Assistant OS, and the port is 8123.

Initializing Home Assistant

Usehttp://homeassistant.local:8123Log in to Home Assistant OS.
Upon first access, Home Assistant OS will perform preparation work:

image.png


Note 1: This step is best done with the help of a VPN or proxy (scientific internet access). Under normal domestic network conditions, there's no telling how long you'll have to wait. Personally, I was stuck at .675 for a very long time. Out of frustration, I routed the HAOS IP address directly through a proxy, which bypassed the .675 hang and completed the initialization in less than 10 minutes.
Note 2: If the network environment where HAOS is deployed has a public IPv6 address and you are also using a proxy, it is recommended not to assign an IPv6 address to HAOS. At this stage, the compatibility between IPv6 addresses and some proxy methods is not very good. If you must use IPv6, it is recommended to disable AAAA records in DNS resolution.


After the preparation is complete, you will enter the welcome page:

image.png

Create a username and password:
image.png

image.png

image.png

Then Home Assistant will discover compatible devices on the same subnet:
image.png

After clicking finish, you will enter the official interface:
image.png

Implementing Key Features

Batch Configuring Existing Xiaomi Devices into Home Assistant

image.png

image.png

Configuring them one by one is obviously impractical, so we need to use the integration feature to batch import existing products from the same platform into HA. Below, I will use Xiaomi devices as an example to demonstrate how to batch import my Xiaomi devices into HA using the "Xiaomi Miot Auto" plugin. Since "Xiaomi Miot Auto" is not in the default integrations of HA OS (actually, it comes with another plugin "Xiaomi Miio", but it kept throwing errors when logging into the Xiaomi cloud platform during configuration, supposedly because the host accessing HA and HA itself are not on the same local network. This is possible because my HA host was proxied, while the host I used to access HA was not, but I didn't bother to look into it and just switched directly to Xiaomi Miot Auto), we need to install "Xiaomi Miot Auto" first using the following method.
Go to "Settings" - "Add-ons":

image.png

Click on "Add-on Store" in the red box at the bottom right:
image.png

Install "Terminal & SSH" in the red box:
image.png

After installation is complete, enter and click "Open Web UI" in the red box at the bottom right:
image.png

Install HACS (Home Assistant Community Store):
image.png

The command is as follows:

wget -O - https://get.hacs.vip | DOMAIN=xiaomi_miot bash -

Note: Actually, in HA deployed through other methods, this command is for installing HACS (which is a third-party app store). After installation, a HACS option should appear in the bottom-left menu of the HA page, similar to the following:

image.png

But for some reason, after I installed it, nothing happened except that a "Xiaomi Miot Auto" integration was added. Could it be related to the HA OS version I installed (or maybe some HACS features have been integrated into the latest version of the Add-on Store)? I don't get it, you guys can look into it yourselves, I didn't want to spend the energy.


Restart Home Assistant:

image.png

Then return to "Devices & Services" and click "Add Integration" in the bottom right corner:

image.png

You will find that "Xiaomi Miot Auto" has been added:
image.png

After clicking to enter, the following interface appears. I chose the account integration, which will associate all devices in my Xiaomi account together:
image.png

Just keep the device connection mode as "Automatic mode":
image.png

After submitting, an error will be reported, and the following interface will appear:
image.png

Actually, when I used the "Xiaomi Miio" plugin, I also got a similar error as above, but there was no option to "click here" to continue. After choosing "click here" to continue, the following interface appears, just click "Yes":
image.png

The interface below is to select the scope of Xiaomi devices to be connected, which is equivalent to a blacklist/whitelist. If Exclude is left blank, all devices will be connected:
image.png

You can see that configurations have been automatically created for all the Xiaomi devices under my Xiaomi account:
image.png

At this time, returning to the overview, you can see all my Xiaomi devices:
image.png

(Optional) Add-on "Samba share"

In the "Developer Tools" menu, there are options related to YAML:

image.png

The YAML here actually refers to a key configuration file in HA: "configuration.yaml". Many custom functions need to be implemented by directly editing it and adding content. Its default path is at:

/root/config/configuration.yaml

You can directly edit it in the CLI interface using the following command through the "Terminal & SSH" we installed earlier:

vim /root/config/configuration.yaml

However, this method is slightly troublesome. After all, it requires using vim, which some friends might not be familiar with. Therefore, in this section, I will use another simpler method that is more in line with everyone's habits, which is the add-on "Samba share". It can directly expose the /root directory as a shared folder. It is still in the "Add-on Store":

image.png

Click to install "Samba share":
image.png

After the installation is complete, enter and configure it first:
image.png

Then start the service:
image.png

If it is a Windows system, access it directly in "Run" using \\HAOS IP address. After entering the username and password configured earlier, you can access it using File Explorer:
image.png

In the image above, addons is used to manually install plugins, and under config is where "configuration.yaml" is located. You can directly use a text editor on Windows to edit "configuration.yaml".

Connecting Xiaomi Devices to HomeKit

Generally speaking, we mostly add devices from other platforms to HA through integration functions. However, sometimes there is a reverse demand. For example, adding Xiaomi devices that have joined HA to Apple's Home app via HomeKit. I believe many Apple fans have this demand. After all, compared to smart devices that directly support HomeKit, Xiaomi's devices are much cheaper. At this time, it is actually using HA as a bridge device. The steps to add are as follows:

image.png

Select "HomeKit Bridge":
image.png


Note: "HomeKit Bridge" in the image above is to add HA devices to HomeKit, while "HomeKit Device" is to add devices in Apple HomeKit to HA. Their functions are completely different, so please do not choose the wrong one.


Then select the domains to include, which is actually choosing which devices on HA to add to HomeKit:

image.png

This is still necessary. Since I have so many Xiaomi devices at home (48 devices, 157 entities), importing all of them into HomeKit is a bit overwhelming... I checked binary sensors on top of the default values (I was wrong, checking binary sensors made adding them in the Home app later a nightmare... I suggest you don't check it at the beginning, you can modify the options to achieve it after adding if needed):
image.png

image.png

image.png

Then in HA's notifications, you can see that many HomeKit pairings have been added:
image.png

Open the "Home" app on your iPhone, click the "+" sign in the upper right corner, and select the first option "Add or Scan Accessory":
image.png

Scan and add the devices in the notifications that require scanning QR codes one by one. The last one is HomeKit Bridge. After adding, the information of the Xiaomi devices will come over (it exhausted me to death adding them...), and finally, the content of the Home app is as follows:
image.png

And "HomeKit Bridge" is also added to the configured list in "Devices & Services":
image.png

The content inside is as follows (the previous domain options can also be modified in the "HASS Bridge" options in the image below):
image.png

Other Features

If you want to add automation scenes, add them in "Automations & Scenes":

image.png

image.png

For example, I want to create an automation so that whenever I turn on my Marantz amplifier, the TV wall light turns on:
image.png

image.png

The functions are too powerful, you can explore them slowly on your own.

Home Assistant OS can also support other functions through the "Add-on" store:

image.png

image.png

You can choose flexibly according to the hardware performance of your HA OS deployment and your own needs. Personally, I don't really like this kind of hodgepodge usage. I advocate for "dedicated" use of devices. If a hodgepodge is needed, I use virtualization solutions for refined "dedication".

Afterword

HA supports a vast number of smart device brands. If you are interested in building a smart home, HA is highly worth studying. If you have higher requirements, you can also use dedicated idle hardware to build dedicated devices. This depends on your needs.

📌 Content Structure Prompt:
This content belongs to the "Blog Knowledge Map" part, you can view the complete content path from here: Blog Knowledge Map 。
View Related Categories · 3 Matches
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.

Comments

  1. kk
    Windows Edge 127.0.0.0
    2 years ago
    2024-8-12 16:00:25

    After changing to UEFI boot, it prompts "uefi interactive shell v2.2" and cannot start. My system is PVE 8.2.2.

    • Owner
      kk
      Macintosh Chrome 127.0.0.0
      2 years ago
      2024-8-15 10:25:49

      My PVE is 7.9.x, does 8.2.2 still have this issue? I searched online for the keywords “pve 8 uefi interactive shell v2.2” and didn't seem to see similar news. It feels like it's not a problem unique to PVE 8. I can only look again to see if there is anything missed in the operation process.

      • kk
        Tang Wudi
        Windows Edge 127.0.0.0
        2 years ago
        2024-8-15 10:30:00

        Searching the entire network, there are basically only a few solutions: 1. Turn off secure boot, which works for another ROS system, but HA still doesn't work. 2. Modifying the boot options given by the official website is still useless. Finally, I found an image made by someone else. I don't know if mine is an isolated case.

        • Owner
          kk
          Macintosh Chrome 127.0.0.0
          2 years ago
          2024-8-16 14:58:11

          Most of the time, I also have to admit that I just have bad luck~

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews