Telegraf as MQTT consumer - handling string and float values

Sending Line Protocol sounds like it could work, at the cost of the published data being less friendly to non-InfluxDB subscribers (no longer a simple value). I’ll think about whether it will work in my application.

Do you know if there’s a way to convert a string to a float in a Grafana query? The query will know that the string is meant to be a float (so that’s the explicit conversion that is required), but I can’t find a way to actually make the conversion. Is there a hidden “cast” or “convert” function, either in Grafana or in the InfluxDB query language? Aggregators like Mode still work on string representations of floats because they treat each value as a member of a set of arbitrary values, but Mean does not work because it needs numerical values to calculate the mean, and if given strings it doesn’t automatically convert.