Skip to main content

System update and docker image notification and execution over MQTT

Project description

Rhizomatics Open Source

updates2mqtt

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

  • 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.6.tar.gz (303.4 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.6-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: updates2mqtt-1.3.6.tar.gz
  • Upload date:
  • Size: 303.4 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.6.tar.gz
Algorithm Hash digest
SHA256 26107d5681e59b06552e16ff2b1c67bb96a5f4061a67bbdfab1b457c50fb4d86
MD5 94e64ff0ccd13d14dc99a72a7a01cc50
BLAKE2b-256 47bc5f1ef6d78f69f9348f8a7a78b0746ced392543dde5b702f9920cb026aa10

See more details on using hashes here.

Provenance

The following attestation bundles were made for updates2mqtt-1.3.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: updates2mqtt-1.3.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2768b89ff3e28faf437a5864989bac795ca04e38a77f8d85dff41ab877f37de9
MD5 a116dfe448bb6b497d1dc89513c95c1e
BLAKE2b-256 ee9f948eeab5fd52201e287aec42fb448151ac2e22e0e2a987ae0c9b8a8f26bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for updates2mqtt-1.3.6-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