Running Home Assistant in Hyper-V with Zigbee USB Gateway
Posted on: September 11, 2023I’m a big Home Assistant fan. I have been running it with Raspberry Pi for two years, but I decided to upgrade my setup to Intel NUC early this year.
At the same time, I wanted to use that same machine for AKS Edge Essentials and Azure Arc demos as well. My Intel NUC is placed in my living room because everybody wants to run Kubernetes in their living room, right? Right?
Therefore, I decided to run Home Assistant OS in Hyper-V on that same machine. It would be the easiest way to go, and I have flexibility to demonstrate other cool Azure capabilities from the same machine too.
I was using Zigbee Home Automation in my previous Home Assistant setup and apparently, I already had 16 devices connected to that:
It was clear that getting these devices to work in my new setup was a must.
I have ConBee II Zigbee USB Gateway and it has been working flawlessly in my previous setup. After I started to test my new fancy setup, I realized one important thing that I’ve missed earlier. I couldn’t just pass through that USB gateway to my Home Assistant. There isn’t a setting to enable that in Hyper-V Manager:
I looked for alternative configuration options but couldn’t find anything that would solve my problem.
While studying this a bit, I noticed that I could however map serial port in the guest OS to named pipe in the host OS.
After I realized that capability, I started to see the solution. I looked for ready-made solutions, but I couldn’t find anything that I wanted to install to my machine as permanent solution.
So, I did what developers do: I wrote my own solution.
I call it serialport2namedpipe
and it’s available in my GitHub repository:
Repo contains more details about the solution and a sequence diagram that explains how it works in practice all the way from Zigbee USB Gateway to Home Assistant.
I have been running this solution for 6 months now and it has been working very well.
I mentioned that I’ve also installed Azure Arc and AKS Edge Essentials on the same machine.
Azure Arc enables me to monitor my serialport2namedpipe
but more about that
in my next post so stay tuned!