MQTT Topic Variations
Heya,
I've been back to working on my HomeAssistant integration for pulling CAD data, with a focus on moving to MQTT and away from HTTP polling.
It seems there are a few potential MQTT topics where data can be published to. My CAD publishes to SMART/HILD/
, but I received a report from someone with a CAD publishing to SMART/DCAD/
, and it seems others have CADs publishing to SMART/IGLOO/
.
The MQTT server doesn't seem to mind subscribing to multiple potential topics (so I'm currently subscribing to SMART/HILD/
and SMART/DCAD/
), but I was wondering if there was a REST API endpoint or similar that could be used to discover the correct topic- it doesn't seem to be exposed through the /resource
or /device
endpoints.
I released v0.1.0-beta last night which has rough support for smart meter autodiscovery & MQTT streaming, but it's likely this won't work at all until I've had a chance to add better error handling.
Really appreciate any suggestions/feedback on this.
Thanks :)
Comments
If I subscribe to
(obviously with my valid Glow ID) it doesn't matter whether it's HILD or DCAD or IGLOO.
Except that it wont auth - or at least it didn't when I tried.
As for knowing which topic - no sadly there is no programmatic way of knowing .
However just ask - we will tell you and it won't change.
It is an historical accident which can't change without affecting other users.
@clivee
It worked perfectly for me just using `mosquitto_sub` so I've built that into all of my API code. Here's a simple example.