WTH can’t we build a native way to run Home Assistant natively on an M series processor? I know they are expensive, but there are so many used Mac mini’s and the new one would be amazing to run as a home server…. No limits on the onboard processing you could do ( language models, image analysis etc…). All at the core, all inside the home.
Can you run Linux/Ubuntu on the Mac Mini and run HA in a docker container?
HA is just a python application that can be installed and run natively under MacOS or homebrew’s python. I did this for a few months and found it cumbersome, but it works.
You can also install Docker desktop for MacOS, but last I checked it still runs all the containers in a Linux virtual machine, which is still “native” (arm64) execution. (Note you can also run docker-compatible images using open-source Colima which may be even more performant).
Finally, if you’re really advanced you can install Asahi Linux OS on Apple Silicon Macs, currently supporting M1 and M2 processors, which in turn can run HA in docker natively. This distribution is still somewhat experimental so doesn’t yet work with all hardware components, so don’t expect a HAOS image for Apple silicon any time soon.
To clarify, when I say “natively” i mean running as an app without a virtualized environment.
Sure, but that’s a huge huge ask…
You’re talking about support all the way down to the kernel level. Likely unreasonable compared to the availability and support of x86. Your best bet is to ride on the coattails of bigger development efforts like Asahi.
This is what OP should be doing. Support for MAC or Windows is likely to never happen. I did adapt HA to windows a while back but I had to strip a ton of functionality to get it to work properly at the OS level. And I only got core running. A lot of random functionality like access to keyboard interupts etc was broken.
I understand that this is a “Huge Ask”. And it is very difficult, But there are some very serious benefits. I thought the reason for this “WTH” exercise was to get people talking and thinking. I am sure many people can give me a ton of reasons not to try to do this. But, it’s just time and programming, not a new branch of physics.
My point is to look at the benefits of leveraging the Compute on a platform that is very large (processors deployed) and powerful. If you also look at the future requirements for compute they are only going to go up (even exponentially). You can also look at the benefits of recycling or re-using vs purchasing a new pi for example.
I guess my question to the community is if you set aside the attitude of “it’s hard”. And instead ask what would the platform look like if we did this?
I agree that it will be awesome to use an old Mac mini to run HAOS, whenever that is possible. It is reasonable that it will take a while to happen, but I’m looking forward to it none the less.
To reiterate, two of the options above are “bare metal”, i.e. without any virtualization, natively on M-series Apple Silicon today. One of them runs on macOS command-line, the other replaces macOS with Linux. Both use “official” installation methods described in the docs (i.e. pip and docker). (Although I would recommend homebrew python instead, then pipx install homeassistant
which handles the venv for you — I just tried it and it works great on my M2 Pro Mini, here’s a screenshot:)
So maybe I’m not clear what this WTH is suggesting. If the goal is to see HA core in the Mac App Store, I’m doubtful that’s a plausible option given how much Apple restricts what those apps can do. Any kind of installable app bundle would have to deal with the limitation that HA core has no user interface because it’s a background daemon, so you would likely need OS-specific code to create a UI menu bar icon, for example, and handle the background launching, and it still might not run if nobody is logged into the Mac. There is a macOS app bundler for python called py2app, but I’m not familiar enough to know whether it would work for a application as complex as HA.
Edited to add: to clarify the above screenshot, note that “Virtual environment” refers to a python sandbox for the purpose of dependencies (venv), similar to how all modern apps are packaged — it is not a virtual machine / hypervisor environment with a full OS intermediary.