zigbee2mqtt

by andrenarchy

Helm chartv9.46.0App 2.14.3Verified publisher

Bridges events and allows you to control your Zigbee devices via MQTT

About this chart

zigbee2mqtt

Bridges events and allows you to control your Zigbee devices via MQTT

Helm chart originally based on a chart from k8s-at-home.

Source Code

Requirements

Kubernetes: >=1.16.0-0

Dependencies

RepositoryNameVersion
https://library-charts.k8s-at-home.comcommon4.5.2

TL;DR

helm repo add andrenarchy https://andrenarchy.github.io/helm-charts/
helm repo update
helm install zigbee2mqtt andrenarchy/zigbee2mqtt

Installing the Chart

To install the chart with the release name zigbee2mqtt

helm install zigbee2mqtt andrenarchy/zigbee2mqtt

Uninstalling the Chart

To uninstall the zigbee2mqtt deployment

helm uninstall zigbee2mqtt

The command removes all the Kubernetes components associated with the chart including persistent volumes and deletes the release.

Configuration

Read through the values.yaml file. It has several commented out suggested values. Other values may be used from the values.yaml from the common library.

Specify each parameter using the --set key=value[,key=value] argument to helm install.

helm install zigbee2mqtt \
  --set env.TZ="America/New York" \
    andrenarchy/zigbee2mqtt

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

helm install zigbee2mqtt andrenarchy/zigbee2mqtt -f values.yaml

Custom configuration

IMPORTANT NOTE: a zigbee controller device must be accessible on the node where this pod runs, in order for this chart to function properly.

First, you will need to mount your zigbee device into the pod, you can do so by adding the following to your values:

additionalVolumeMounts:
  - name: usb
    mountPath: /path/to/device

additionalVolumes:
  - name: usb
    hostPath:
      path: /path/to/device

Second you will need to set a nodeAffinity rule, for example:

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: app
          operator: In
          values:
          - zigbee-controller

... where a node with an attached zigbee controller USB device is labeled with app: zigbee-controller

If you are getting errors, that the device cannot be opened when starting Zigbee2Mqtt, try uncommenting the privileged flag:

securityContext:
  privileged: true

Values

Important: When deploying an application Helm chart you can add more values from our common library chart here

KeyTypeDefaultDescription
affinityobject{}Affinity constraint rules to place the Pod on a specific node. [ref]
configobjectSee values.yamlzigbee2mqtt configuration settings. This will be copied into the container's persistent storage at first run only. Further configuration should be done in the application itself! See project documentation for more information.
config.advancedobject{"homeassistant_discovery_topic":"homeassistant","homeassistant_status_topic":"homeassistant/status","last_seen":"ISO_8601","log_level":"info","log_output":["console"],"network_key":"GENERATE"}port: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00 Optional: adapter type, not needed unless you are experiencing problems (options: zstack, deconz) adapter: deconz
config.advanced.last_seenstring"ISO_8601"default: 11 channel: 11 Optional: Baudrate for serial port (default: 115200 for Z-Stack, 38400 for Deconz) baudrate: 38400 Optional: RTS / CTS Hardware Flow Control for serial port (default: false) rtscts: true Optional: Add a last_seen attribute to MQTT messages, contains date/time of last Zigbee message possible values are: disable (default), ISO_8601, ISO_8601_local, epoch (default: disable)
config.homeassistantboolfalseHome Assistant integration (MQTT discovery)
config.permit_joinbooltrueWARNING: Disable this after all devices have been paired! (default: false) Note: this will be controllable in the UI
envobjectSee belowenvironment variables. See image docs for more details.
env.ZIGBEE2MQTT_DATAstring"/data"Set the data folder for Zigbee2MQTT.
image.pullPolicystring"IfNotPresent"image pull policy
image.repositorystring"koenkk/zigbee2mqtt"image repository
image.tagstring"1.19.1"image tag
ingress.mainobjectSee values.yamlEnable and configure ingress settings for the chart under this key.
persistenceobjectSee values.yamlConfigure persistence settings for the chart under this key.
persistence.usbobjectSee values.yamlConfigure a hostPathMount to mount a USB device in the container.
securityContext.privilegedboolnilPrivileged securityContext may be required if USB controller is accessed directly through the host machine
serviceobjectSee values.yamlConfigures service settings for the chart. Normally this does not need to be modified.

Deploy zigbee2mqtt with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has zigbee2mqtt on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartzigbee2mqtt is pinned at v9.46.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply