Closed onedr0p closed 2 years ago
Hi @onedr0p,
Weird, I've just tested and it is working (I've tested for both zigbee2mqtt 1.26.0 and 1.27.0).
I do see the availability metrics:
zigbee2mqtt_zigbee_availability{sensor="zigbee2mqtt_garage"} 1.0
Could you please provide the following info:
Availability (simple)
in zigbee2mqtt? (personally I am running simple mode, but I tried with advanced and it is still working).Thanks
Env:
LOG_LEVEL: DEBUG
MQTT_ADDRESS: emqx.default.svc.cluster.local
MQTT_TOPIC: "zigbee2mqtt/#"
MQTT_V5_PROTOCOL: "True"
MQTT_USERNAME: username
MQTT_PASSWORD: password
PROMETHEUS_PORT: 80
PROMETHEUS_PREFIX: zigbee2mqtt_
ZIGBEE2MQTT_AVAILABILITY: "True"
Zigbee2mqtt Version: 1.27.0
Logs:
I can try changing to changing to Availability (simple)
but like you said it should work...
Thanks for the details. At a first glance, there is no "availability" mention in the logs. There should be whether it has failed to convert or succeeded.
I suspect zigbee2mqtt not exporting the availability metric for some reason.
But I'll have a deeper look at the log.
In the meantime, if you can extract the raw value from MQTT it would be nice. Otherwise, I may just add additional logs in the exporter to show them in debug mode.
@onedr0p unfortunately, I am not able to reproduce your issue.
Could you please run the exporter using this branch https://github.com/kpetremann/mqtt-exporter/tree/debug and provide me the logs.
I have simply added the original MQTT messages in the debug log. But I don't necessarily want to merge this.
Any chance there's a docker image of that?
sure Actually I've added this MQTT message debug mode as an option.
You'll have to set the following environment variables:
It will be pushed to Docker Hub once this GH Action is complete: https://github.com/kpetremann/mqtt-exporter/actions/runs/2935308892
The docker image has been pushed to Docker Hub
On the topic of docker images would it be possible to push release tags instead of only latest?
I'll try the debug image out soon.
On the topic of docker images would it be possible to push release tags instead of only latest?
sure
I'll try the debug image out soon.
Thanks
Also can you confirm that legacy availability payload is disabled? https://www.zigbee2mqtt.io/guide/configuration/device-availability.html#availability-payload
Also can you confirm that legacy availability payload is disabled? zigbee2mqtt.io/guide/configuration/device-availability.html#availability-payload
I set that to false
And what do you know with the latest latest latest version it now works :) I have no idea what happened but you did something! lol
Oh weird ^^ the change I pushed could not have fixed that. Maybe because of a restart either of the exporter or zigbee2mqtt?
Was it already set to false or did you change it recently?
I changed it, maybe that was the fix :)
Thanks for the debugging, I'll go ahead and close the issue!
oh I see. I confirm this was the root cause for sure.
As stated in the README, legacy mode is not supported.
https://github.com/kpetremann/mqtt-exporter#zigbee2mqtt-device-availability-support
Note: Supports only non-legacy mode - see [Device availability advanced](https://www.zigbee2mqtt.io/guide/configuration/device-availability.html#availability-advanced-configuration)
Don't hesitate if you need further assistance or features.
I got confused and thought you mean the other setting which I showed in the screenshot.
I'll update the readme to make it clearer
Hi 👋🏼
I deployed this and I can see metrics coming thru but it seems like
ZIGBEE2MQTT_AVAILABILITY=True
is not working. I actually still see the_state
metrics.