Estimated reading time: 3 minutes

Do you have Zigbee devices in use and always want to be up to date when an update is available? With Home Assistant and Zigbee2MQTT, you can set up notifications for firmware updates that inform you immediately when one of your Zigbee devices needs an update. This article shows you step by step how to set this up in Home Assistant.

What is Zigbee2MQTT and why is MQTT important?

Zigbee2MQTT is a popular open source software that allows you to seamlessly integrate Zigbee devices with Home Assistant. Zigbee2MQTT connects to a Zigbee adapter and then communicates with Home Assistant using the MQTT protocol. MQTT is a lightweight messaging protocol specifically designed for small data transfers between IoT devices. It ensures that Home Assistant receives messages from Zigbee2MQTT - e.g. a message when a firmware update is available for one of your devices.

Step 1: Set up the MQTT broker

If you have not yet installed an MQTT broker, this is the first step. An MQTT broker receives messages from Zigbee2MQTT and forwards them to Home Assistant.

  1. Open the Home Assistant interface and go to Settings > Add-ons.
  2. Search for the Mosquitto Broker (the standard MQTT broker for Home Assistant) and install it.
  3. After installation, start the broker and configure the user name and password if necessary.
  4. Now go to Settings > Integrations and add the MQTT integration if it is not already present.

The other option is to install MQTT independently, for example as a Docker container.

Step 2: Set up Zigbee2MQTT

To receive firmware update notifications from your Zigbee devices, you must ensure that Zigbee2MQTT is configured correctly.

  1. Open the Zigbee2MQTT configuration file (configuration.yaml), which you can find in your installation directory.
  2. Make sure that the homeassistant: true and the mqtt: entry are configured correctly so that Zigbee2MQTT sends messages to your MQTT broker.
  3. Add if necessary. advanced: log_level: info so that you receive comprehensive information in the log - this helps with troubleshooting.
  4. Restart Zigbee2MQTT.

Now your Home Assistant receives information about the status of your Zigbee devices and is informed when an update is available.

You can also change the settings in the Web UI of Zigbee2MQTT under OTA updates set the frequency of the update checks. By default, the Update check interval 1440 minutes, which corresponds to exactly one day.

Step 3: Create automation for update notifications

alias: Zigbee2MQTT device update notification
triggers:
  - value_template: >
      {{ states.update | selectattr('state', 'eq', 'on') |
      selectattr('attributes.device_class', 'eq', 'firmware') | list | length >
      0 }}
    trigger: template
actions:
  - data:
      title: Firmware updates for devices
      message: >
        {% set devices = states.update | selectattr('state', 'eq', 'on') |
        selectattr('attributes.device_class', 'eq', 'firmware') %} {% for entity
        in devices %}
          - {{ entity.name }}
        {% endfor %}
      data:
        notification_icon: mdi:update
        color: red
    action: notify.smartphones
mode: single

This Home Assistant automation notifies you when firmware updates are available for Zigbee2MQTT devices:

  1. TriggerChecks whether at least one device requires a firmware update (status on and device_class is firmware).
    • states.update: Accesses all entities of the type update which represent firmware updates.
    • selectattr('state', 'eq', 'on'): Filters all entities for which the state on which means that an update is available.
    • selectattr('attributes.device_class', 'eq', 'firmware'): Restricts the selection further to firmware updates (entities with device_class equal firmware).
    • list | length > 0Converts the filtered results into a list and checks whether it contains at least one element.
  2. ActionSends a message with a list of affected devices to the group notify.smartphones. The notification has an update icon and a red marker.
  3. Mode: single ensures that the automation is not executed multiple times at the same time.

In short: It informs you about available firmware updates.

YouTube video implementation

https://youtu.be/4Kz4sPlOOdA

Conclusion

With Zigbee2MQTT and MQTT, you can easily get Home Assistant to inform you about new firmware updates for your Zigbee devices. This allows you to stay up to date and keep your devices secure and functional.

The display of the products was implemented with the affiliate-toolkit plugin.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US