News for hackers. Stuff that matters.
Re:Xiaomi has provided official support for Home Assistant by mrj on Monday December 16, 2024 @03:22PM (#42434985)
What I wish I had known: HA is just a python program, it's pretty easy to run it manually.

After my Pi's sdcard died, I wanted to use an old laptop (more reliable with a built-in backup battery) so I followed the deployment recommendations and used the VM image. After that, for the first time I started having problems with HA not running - because VirtualBox would run only about a month before crashing. And I didn't like how much memory a VM locked up on the host.

The documentation makes it sound super complicated, but if you can make a venv and `pip install`, the setup is that easy. I tend to just run `hass` manually but there instructions for setting up supervised. I wish the documentation made this clearer, it really tries to scare people away from that method but running a whole VM is a lot of overhead for my pretty simple zwave-js setup.

Re:Xiaomi has provided official support for Home Assistant by 15155 on Monday December 16, 2024 @03:35PM (#42435120)
Just use Docker?
Re:Xiaomi has provided official support for Home Assistant by mrj on Monday December 16, 2024 @03:39PM (#42435173)
There are a few things you can't do with docker (my case was an addon that I wanted). The install docs have a good grid of the differences.
Re:Xiaomi has provided official support for Home Assistant by IgorPartola on Monday December 16, 2024 @05:58PM (#42436445)
I also don’t think Docker can do ARP network interrogation, though I could be wrong about that. Also not sure how it handles mDNS.
Re:Xiaomi has provided official support for Home Assistant by thedougd on Monday December 16, 2024 @07:58PM (#42437244)
Overlooked option for running these things in containers is macvlan networking. Just give it its own MAC address on the network. Works great and you don't have to compromise on isolation.
Re:Xiaomi has provided official support for Home Assistant by paulfurtado on Monday December 16, 2024 @07:06PM (#42436938)
The benefit of docker for home assistant is the packaging of it, rather than isolation. You can always run a container with host network mode and privileged mode so that it can access everything it needs to the same as if it were running directly on the host.
Re:Xiaomi has provided official support for Home Assistant by sylphaenos on Monday December 16, 2024 @07:22PM (#42437041)
As an alternative to host network mode, you can give the container a dedicated IP on your network using the macvlan driver.
Re:Xiaomi has provided official support for Home Assistant by noprocrasted on Monday December 16, 2024 @07:04PM (#42436929)
You can run in host network mode to avoid that.
Re:Xiaomi has provided official support for Home Assistant by XorNot on Monday December 16, 2024 @07:52PM (#42437200)
I've ditched all ARP, mDNS in my setup. Everything is static IP addresses: it vastly improved robustness against network glitches, which absolutely will happen to you.

If my router is unplugged or offline, everything with power can still communicate for example.

Re:Xiaomi has provided official support for Home Assistant by TacticalCoder on Monday December 16, 2024 @09:11PM (#42437669)
Nearly everything is static on mine too. I keep track of all the various devices' MAC addresses and assign them one IP. I also make sure that, even should I reinstall an OS on a device and "forget" to assign it a static IP, my router always assigns that MAC address the static IP I picked for that MAC address. I then keep a little range of IP addresses for unknown devices that the router is allowed to use when a new device shows up. Once in a while I log into my router and look which new device(s) I forgot to assign a static IP too.

When you say you ditched all ARP, did you do anything special? For example do you configure, on all your machines, static ARP entries for each MAC address of all your devices?

Re:Xiaomi has provided official support for Home Assistant by XorNot on Monday December 16, 2024 @10:45PM (#42438140)
Sorry what I meant was I don't depend on any dynamic discovery systems like inspecting ARP tables.
Re:Xiaomi has provided official support for Home Assistant by shepherdjerred on Monday December 16, 2024 @09:51PM (#42437873)
You can get mDNS working in Docker, but IMO it's much easier to give up and use host networking. It is _very_ difficult to get mDNS working in K8s.
Re:Xiaomi has provided official support for Home Assistant by Sander_Marechal on Tuesday December 17, 2024 @03:53AM (#42439610)
I think it can, if you run your Docker containers in host network mode. I run my HA in docker using host mode, and it auto-detects all new devices that pop up on my network.
Re:Xiaomi has provided official support for Home Assistant by demosthanos on Monday December 16, 2024 @08:01PM (#42437264)
Can't do with docker or can't do as easily with docker as you can with HAOS? My understanding has been that everything can be done by just adding new containers or files, and it's worked for me thus far.
Re:Xiaomi has provided official support for Home Assistant by madeofpalk on Monday December 16, 2024 @08:29PM (#42437454)
If you're using things like USB Zigbee dongles, they can be a pain to pass through to the docker container, or just not possible at all on macOS.
Re:Xiaomi has provided official support for Home Assistant by epcoa on Monday December 16, 2024 @08:41PM (#42437513)
HAOS uses docker to containerize everything, so it can’t be that difficult, and it really is not. Docker has a —-device flag for this purpose, udev makes it easy enough to assign stable names.
Re:Xiaomi has provided official support for Home Assistant by madeofpalk on Monday December 16, 2024 @09:06PM (#42437648)
Docker does not support USB/serial device passthrough on macOS https://docs.docker.com/desktop/troubleshoot-and-support/faq...
Re:Xiaomi has provided official support for Home Assistant by bluefinity on Monday December 16, 2024 @09:47PM (#42437853)
macOS is not really a good OS for running a server anyway, and Docker Desktop is intended for development more than anything else.
Re:Xiaomi has provided official support for Home Assistant by s2l on Monday December 16, 2024 @09:00PM (#42437613)
zigbee2mqtt makes things easier to establish the bridge. Running as a container, next to home assistant container.
Re:Xiaomi has provided official support for Home Assistant by greggsy on Tuesday December 17, 2024 @05:17AM (#42440080)
Trust me it's not worth the effort to get USB passthrough for HAOS on Docker.
Re:Xiaomi has provided official support for Home Assistant by epcoa on Wednesday December 18, 2024 @03:41AM (#42448977)
What do you mean by “HAOS on docker”. HAOS is a standalone complete Linux system with its own fully managed kernel, not meant to be containerized. It uses docker internally itself though and “pass through” works transparently.

If you’re talking about running home assistant in a docker container, sure you’re more on your own, but since official home assistant in HAOS must run in docker, none of this is terribly difficult to configure.

The dongles are usually exposed as tty devices and I’ve been running zigbee2mqtt and Zwavejs addons in docker containers for years with no issue. HAOS takes care of stable naming (based on default udev rules) out of the box.

Unlike system virtualization, there isn’t really anything that needs passing through, it’s a naming and permissions issue - the container just needs an appropriately permissioned dev node ideally with a stable name. If you are using official addons it is effectively zero-config, and if you’re not, sorry but I don’t find the configuration to ensure a dev node to be anything but straightforward container config.

As someone else mentioned it may be as simple as:

  devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
But you can just as easily use the /dev/serial tree to have stable names. Those names come out of the box with udev. You can always make your own too, I’ve done it, it’s not hard.
Re:Xiaomi has provided official support for Home Assistant by greggsy on Monday December 23, 2024 @04:27AM (#42493064)
HA can be deployed as a container. Yes it uses containers.

I’m impressed with your knowledge of the Linux ecosystem. Regardless, passing usb devices to the containerised version is still more effort than it’s worth for the average user.

Re:Xiaomi has provided official support for Home Assistant by demosthanos on Tuesday December 17, 2024 @11:06AM (#42442474)
I'm doing USB passthrough for Z Wave right now and it's trivial. Just bind a volume to the device file.

Maybe Zigbee is different for some reason?

Re:Xiaomi has provided official support for Home Assistant by greggsy on Tuesday December 17, 2024 @05:16AM (#42440075)
USB passthrough for docker (and LVM) is a massive pain. Avoid if you're just starting out. VMs or physical deployments are much more straight forward.
Re:Xiaomi has provided official support for Home Assistant by Coelacanthus on Tuesday December 17, 2024 @07:55AM (#42440974)
Maybe you can consider USB/IP to pass thorough USB device over network.
Re:Xiaomi has provided official support for Home Assistant by silversmith on Tuesday December 17, 2024 @06:46AM (#42440585)
Could you elaborate? I run HA in docker, and the extent of necessary configuration was adding this in docker-compose.yml:

    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
Re:Xiaomi has provided official support for Home Assistant by ctm92 on Tuesday December 17, 2024 @06:29AM (#42440499)
From what I know, HAOS runs on Docker in the backend, plugins are basically containers that are started up
Re:Xiaomi has provided official support for Home Assistant by slug on Sunday December 29, 2024 @09:02AM (#42540001)
Have HA running without any issue on a Linux KVM VM.