Supporting multiple sky or air in apps we write

My udp listener currently only supports one air+sky device on the local network from a MQTT perspective, writing observations out to MQTT topics ala /wf/obs/sky or /wf/status/hub or /wf/rapid_wind etc.

I’d like to be able to support multiple sensors (two sky, two air, etc.) and need to modify my output to be able to distinguish between sky-A and sky-B, for example.

Technically it’s not a problem, I have the serial number in the messages of course. I’m wondering from a namespace perspective what makes the most sense.

One thing that came to mind was the appending the serial_number in the topic name ala:





That would mean a MQTT subscription to /wf/obs_sky would get the sky observations for all the sky units (plural) that are broadcasting. For my primary use case of having my listener feed MQTT and then seeding influxdb (via telegraf subscribing to MQTT) this would work great. I’d just need to tweak my grafana dashboard slightly to get to the right topic for the observation on sky-A vs. sky-B.

A different way would be to put the serial_number before the observation type ala:





Personally I like the first variant notionally. Anybody have any thoughts either way or alternate ways of cooking up MQTT topics for multiple devices doing the same observations that I might think about ?