Is there a way to query the running version of Z-Wave JS?

I’m trying to setup notifications about upgrading. I was able to configure nginx with a REST endpoint that serves the version number of nginx. I was able to configure an MQTT sensor to query $SYS/broker/version to get the version of Mosquitto.

However, I’ve searched and searched and for the life of me I don’t see an API to query the current version of Z-Wave JS. If it matters this is the image I’m using:

https://hub.docker.com/r/zwavejs/zwavejs2mqtt

However I’m not using the MQTT bridge. And I’d like not to have to start it. I’d like to be able to do a REST query to Z-Wave JS from the Home Assistant side to get its version number.

Thanks!

There are multiple components involved in the Z-Wave JS integration. The version number of ZWaveJS2MQTT is not available in any form from HA. You can get (not easily) the driver and server versions, that’s it.

The easiest solution to this problem, IMO, is to watch the releases in Github. You’ll get an email anytime a new version is published.

https://github.com/zwave-js/zwavejs2mqtt/releases

Thanks @freshcoast

Hmm… not sure about that. Home Assistant is able to show the server version of Z-Wave JS but I’ve not identified how it gets that version.

That part of the problem is already solved. I have a custom component that queries Docker for the version of the latest image. I don’t query Github because sometimes there’s a delay between the release of something on Github and it’s availability as a Docker image. The Docker image is what I care about.

zwavejs2mqtt has its own version though. How would you use the driver or server versions in comparison to your docker query?

If you want to use the driver version, and you already use custom components, then you can just access the zwave-js-server client from the zwave-js integration within a custom component.

If you’re already using Docker, can you access the host and extract the version from the currently running container? The image contains labels, including one that describes the application version:

$ sudo docker inspect --format='{{index .Config.Labels "org.opencontainers.image.version"}}' z2m
5.6.0

The API I requested has been added:

This is the sensor I’m using:

sensor:
  - platform: rest
    resource: http://zwavejs2mqtt:8091/version
    headers:
      Accept: application/json
    name: ZWaveJS2MQTT Current Version
    value_template: "{{ value_json.z2m }}"

Internal communications between Docker containers are not encrypted but accessing the HA server from outside goes to an Nginx front-end that encrypts.