tkurki / signalk-mqtt-gw

Signal K server plugin that provides gateway functionality between Signal K and MQTT
Apache License 2.0
14 stars 7 forks source link

Offer unit conversions for mqtt topics #44

Open GraffJosh opened 3 months ago

GraffJosh commented 3 months ago

It would be very useful to be able to convert topics to other units of measure.

One way could be to broadcast data as JSON with the units (and perhaps other metadata like friendly name?) in the dict.

Another way could be to put unit conversions under a sub directory in the mqtt ie: vessels/self/convert/environment/wind/kts/speedApparent

It's an interesting problem, but solving it in the plugin sounds better than doing a loopback through home assistant (which is my current workaround)

Thanks!

tkurki commented 2 months ago

Something that I have been pondering is server wide settings for preferences per original unit and path specific overrides.

I would indicate the conversion part either at the very beginning or near the end of the path. Also underscore prefix like _convert to mark the path part as special.