Commit Graph

2 Commits (39400f3b2f3175610aaf4f489998aab523f76c81)

Author SHA1 Message Date
Dustin 7d2b3887c2 Add ability to update HA-related containers
Home Assistant, Zigbee2MQTT, and ZWaveJS2MQTT can now be updated by
setting the corresponding Ansible variable.
2021-08-12 19:02:34 -05:00
Dustin 0f70a5b6ba roles/zwavejs2mqtt: Deploy Z2M using Podman
Home Assistant no longer recommends using the built-in libopenzwave
integration for communicating with Z-Wave devices.  Evidently, OpenZWave
is no longer maintained, and community efforts have shifted toward
Z-Wave JS.

Z-Wave JS is architecturally much different than the legacy Z-Wave
integration.  Instead of running the network controller inside the Home
Assistant process, a separate daemon communicates with the Z-Wave radio.
Home Assistant integrates with that daemon using a WebSockets API.  This
has the advantage of decoupling the network operation from the lifecycle
of the Home Assistant process: restarting Home Assistant (e.g. to load
new configuration changes) does not take the Z-Wave network offline.

ZwaveJS2Mqtt is a distribution of the Z-Wave JS daemon, as well as a
web-based user interface for configuring it.  Although its name implies
that it uses MQTT for communication, this feature is actually optional,
and the native WebSockets API can still be used for integration with
Home Assistant.

I decided to follow the same deployment pattern for ZwaveJS2Mqtt as for
Home Assistant itself: run the application from a container image using
Podman.  This of course simplifies the installation of the application
significantly, leaving most of that work up to the maintainer of the
container image.  Podman provides the container runtime, managing the
privileges, etc.  The systemd service unit starts Podman, configuring an
ephemeral container on each run.  The container uses the default network
namespace, avoiding the unnecessary overhead of port mapping.  It uses
Podman's "rootless" mode, via the `--uidmap` and `--gidmap` arguments,
mapping users inside the container, including root, to unprivileged
users on the host.  The Z-Wave radio, which is specified by the
`zwavejs_device` Ansible variable,  is passed into the container via the
`--device` argument.
2021-07-19 15:58:52 -05:00