Puzzling.
I’m not sure how you bring Zigbee2MQTT sensors into Home Assistant. I manually create MQTT sensors for all of my Z2M devices. I’m sure there are better ways, however I want full control over what comes into HA and how it is formatted.
I’m not clear on your setup and how you are bringing MQTT date into HA.
I do not think it is part of the problem, however anal me, I don’t like ‘spaces’ in my MQTT topics…
zigbee2mqtt/AC Quarto
Again, OCD/anal me, this is how I bring in a Z2M voltage value from one of my plugs:
- name: "Hall Dehumidifier Plug Voltage"
device_class: voltage
unique_id: "0x282c02bfffeb4c9b-Voltage"
expire_after: 3600
state_topic: "zigbee2mqtt/0x282c02bfffeb4c9b"
value_template: "{{ ( value_json.voltage / 10.0 ) | float(0) }}"
unit_of_measurement: "V"
availability_topic: zigbee2mqtt/0x282c02bfffeb4c9b/availability
I would have a close look at the raw MQTT topic and message content. And also how HA sees/consumes this topic and JSON message.
Picture below is what HA developer tools ‘sees’ from above sensor and MQTT JSON message.
topic :
zigbee2mqtt/0x282c02bfffeb4c9b
JSON message :
{"current":11,"elapsed":496,"last_seen":"2023-09-18T18:12:53-07:00","linkquality":91,"power":0.1,"state":"ON","voltage":1207}