Sensor.zigbee2mqtt_version does not work. Why?

Hi,

I have zigbee2mqtt connected to my homeassistant instance.

in MQTT explorer, I see the following JSON under zigbee2mqtt/bridge/config

{
    "commit": "unknown",
    "coordinator": {
        "meta": {
            "maintrel": 1,
            "majorrel": 2,
            "minorrel": 7,
            "product": 1,
            "revision": 20210430,
            "transportrev": 2
        },
        "type": "zStack3x0"
    },
    "log_level": "warn",
    "network": {
        "channel": 11,
        "extendedPanID": "0xdddddddddddddddd",
        "panID": 6758
    },
    "permit_join": false,
    "version": "1.21.0"
}

In home assistant, I configured following yaml in packages:

sensor:
# -------------------------------------------
  # Sensor for Showing the Zigbee2mqtt Version
  - platform: mqtt
    name: Zigbee2mqtt Version
    state_topic: "zigbee2mqtt/bridge/config"
    value_template: "{{ value_json.version }}"
    icon: mdi:zigbee
  # Sensor for Showing the Coordinator Version
  - platform: mqtt
    name: Coordinator Version
    state_topic: "zigbee2mqtt/bridge/config"
    value_template: "{{ value_json.coordinator }}"
    icon: mdi:chip

group:
# -------------------------------------------
  Zigbee2mqtt:
    name: Zigbee2mqtt
    entities:
    - sensor.zigbee2mqtt_bridge_state
    - sensor.zigbee2mqtt_version
    - sensor.coordinator_version

However, in the interface I see that “Coordinator Version” is recognized, but “Zigbee2mqtt Version” isn’t…
2021-09-02_17-31-44

Question
How can I configure my sensor in a way that I can show the running version of Zigbee2mqtt on hass?

thanx in advance!

Grtz
B

That is exactly what I have

  # Sensor for Showing the Zigbee2mqtt Version
  - platform: mqtt
    name: Zigbee2mqtt Version
    state_topic: "zigbee2mqtt/bridge/config"
    value_template: "{{ value_json.version }}"
    icon: mdi:zigbee

So I really don’t know

Hi @francisp ,

I switched to lovelace - “automatic”, and I noticed that there is a sensor “Zigbee2mqtt Version”.
However, it seems to have a different internal name: “sensor.zigbee2mqtt_version_2”

2021-09-03_9-21-13

Do you have any idea why the sensor has “_2” as suffix? Where is this stored? Can I delete/rename it?

grtz
B

You can add an unique id to a mqtt sensor

  # Sensor for Showing the Zigbee2mqtt Version
  - platform: mqtt
    unique_id: zigbee2mqtt_version
    name: Zigbee2mqtt Version
    state_topic: "zigbee2mqtt/bridge/config"
    value_template: "{{ value_json.version }}"
    icon: mdi:zigbee


After reloading ‘manually configured mqtt entities’ you will probably be able to rename it.

oh, the _2 suffix is probably because it has been detected before.

Hi @francisp ,

no solution.
If I do this:

  • my manually defined sensor is still not available
  • the automatically discovered sensor has id “sensor.zigbee2mqtt_version_2”
  • I can not rename “sensor.zigbee2mqtt_version_2” to “sensor.zigbee2mqtt_version” because “Entity with this ID is already registered”…

I also

  • stopped hass
  • removed the folder “Q:\usr\share\hassio\homeassistant.storage”
  • removed the file “Q:\usr\share\hassio\homeassistant\home-assistant_v2.db”
  • started hass

so a “clean” install, but still: the name remains “sensor.zigbee2mqtt_version_2”

If I remove the manual definition of the sensor, than neither “sensor.zigbee2mqtt_version” or “sensor.zigbee2mqtt_version_2” exist…

any other suggestion?