Closed Merlin83b closed 2 years ago
Hello @Merlin83b,
Can you send the original messages from MQTT?
According the logs, the metrics are "duplicated" as they have the same device id or name. Let's take the power metric for instance.
In the logs there is:
DEBUG:mqtt-exporter:new value for mqtt_power: 1647.29
DEBUG:mqtt-exporter:new value for mqtt_power: 0.0
but at the end you only get:
mqtt_power{topic="shellies_shellyem"} 0.0
Looks like you devices have the same name/identifier (shellye). So you only get the last power metric as it overrides it.
Please check your MQTT configuration on your Shelly devices.
In a separate window I have mosquitto_sub -h localhost -u user -P password -v -t "shellies/shellyem/emeter/0/power"
running and get the following for the MQTT messages:
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1447.54
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1432.74
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1424.27
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1399.98
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1393.41
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1412.84
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1409.69
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1424.67
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1419.98
shellies/shellyem-BCFF4DFCFBFD/emeter/0/power 1427.57
Would you like this running with moquitto_sub
in debug mode??
Aha, I think I've just realised that it's likely because the Shelly EM has two power monitors, form the above there is also emeter/1/power
and it's likely that that's overwriting the value.
Yep, that does it. Adjusting the topic to MQTT_TOPIC=shellies/+/emeter/0/#
has sorted it for my use case.
perfect :)
I'm trying to use mqtt-exporter to expose some values from a Shelly EM. Running with LOG_LEVEL=DEBUG, I see the following output with each MQTT message published:
All good so far. Then, on the
/metrics
output, the following:So it seems that most of the values are being lost at output time. Are you able to see why this is happening?