Skip to main content

System update and docker image notification and execution over MQTT

Project description

Rhizomatics Open Source

updates2mqtt

PyPI - Version Ruff pre-commit.ci status Publish Python 🐍 distribution 📦 to PyPI and TestPyPI Github Deploy CodeQL Dependabot Updates

Summary

Use Home Assistant to notify you of updates to Docker images for your containers and optionally perform the pull (or optionally build) and update.

Example Home Assistant update dialog

Description

updates2mqtt perioidically checks for new versions of components being available, and publishes new version info to MQTT. HomeAssistant auto discovery is supported, so all updates can be seen in the same place as Home Assistant's own components and add-ins.

Currently only Docker containers are supported, either via an image registry check, or a git repo for source (see Local Builds). The design is modular, so other update sources can be added, at least for notification. The next anticipated is apt for Debian based systems.

Components can also be updated, either automatically or triggered via MQTT, for example by hitting the Install button in the HomeAssistant update dialog. Icons and release notes can be specified for a better HA experience.

To get started, read the Installation and Configuration pages.

For a quick spin, try this:

docker run -e MQTT_USER=user1 -e MQTT_PASS=pass1 -e MQTT_HOST=192.168.1.5 ghcr.io/rhizomatics/updates2mqtt:release

Release Support

Presently only Docker containers are supported, although others are planned, probably with priority for apt.

Ecosystem Support Comments
Docker Scan. Fetch Fetch is docker pull only. Restart support only for docker-compose image based containers.

Healthcheck

A heartbeat JSON payload is optionally published periodically to a configurable MQTT topic, defaulting to healthcheck/{node_name}/updates2mqtt. It contains the current version of updates2mqtt, the node name, a timestamp, and some basic stats.

A healthcheck.sh script is included in the Docker image, and can be used as a Docker healthcheck, if the container environment variables are set for MQTT_HOST, MQTT_PORT, MQTT_USER and MQTT_PASS.

TIP: Check healthcheck is working using docker inspect --format "{{json .State.Health }}" updates2mqtt | jq

HomeAssistant integration

Any updates that have support for automated install will automatically show in the Home Assistant settings page if the MQTT Integration is installed and automatic discovery is not disabled.

Home Assistant MQTT Integraion configuration

The homeassistant default topic prefix matches the default updates2mqtt config, if its changed in HomeAssistant, then the updates2mqtt config must be changed to match.

Home Assistant updates in Settings

For Home Assistant integration, updates2mqtt represents each component being managed as a MQTT Update entity, and uses [MQTT discovery(https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery)] so that HomeAssistant automatically picks up components discovered by updates2mqtt with zero configuration on HomeAssistant itself.

There are 3 separate types of MQTT topic used for HomeAssisstant integration:

  • Config to support auto discovery. A topic is created per component, with a name like homeassistant/update/dockernuc_docker_jellyfin/update/config. This can be disabled in the config file, and the homeassistant topic prefix can also be configured.
  • State to report the current version and the latest version available, again one topic per component, like updates2mqtt/dockernuc/docker/jellyfin.
  • Command to support triggering an update. These will be created on the fly by HomeAssistant when an update is requested, and updates2mqtt subscribes to pick up the changes, so you won't typically see these if browsing MQTT topics. Only one is needed per updates2mqtt agent, with a name like updates2mqtt/dockernuc/docker

If the package supports automated update, then Skip and Install buttons will appear on the Home Assistant interface, and the package can be remotely fetched and the component restarted.

Related Projects

Other apps useful for self-hosting with the help of MQTT:

  • psmqtt - Report system health and metrics via MQTT

Development

Access to Docker APIs uses the Python docker-py SDK for Python. Eclipse Paho is used for MQTT access, and OmegaConf for configuration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

updates2mqtt-1.3.7.tar.gz (303.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

updates2mqtt-1.3.7-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file updates2mqtt-1.3.7.tar.gz.

File metadata

  • Download URL: updates2mqtt-1.3.7.tar.gz
  • Upload date:
  • Size: 303.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for updates2mqtt-1.3.7.tar.gz
Algorithm Hash digest
SHA256 4adfcce212322d6e0f76dad6347ae35328749881b0426ef4284882826f01a16d
MD5 91ea172f13cf38431d53b8fcc96083eb
BLAKE2b-256 71a1d663957cb63f2a35db6215c1b6c1a0f3190700642c8428547ff346d17ae8

See more details on using hashes here.

Provenance

The following attestation bundles were made for updates2mqtt-1.3.7.tar.gz:

Publisher: pypi-publish.yml on rhizomatics/updates2mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file updates2mqtt-1.3.7-py3-none-any.whl.

File metadata

  • Download URL: updates2mqtt-1.3.7-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for updates2mqtt-1.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 57c020994eeeda62833cd773aa8fb3cdf6e5b70f1152dd158330de9c4d98fe3f
MD5 f14253c4e0b26e0505205bc481e2164c
BLAKE2b-256 efb18056c29e47935ffe472dc34ed8f577d0d96c4b5303a46a8e8edece7762c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for updates2mqtt-1.3.7-py3-none-any.whl:

Publisher: pypi-publish.yml on rhizomatics/updates2mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page