I'm fiddling with importing MQTT values into telegraf to import to influxdb
and then display with grafana. It seems like the weewx MQTT extension is
generating JSON that has double quotes around the numerical values ala:
{"monthET": "0.0", "heatindex": "75.4", "outHumidity": "50.0", "dayET":
"0.0",
The values should be bare without quotes so they're floats, not strings.....
The following patch seems to do the trick....
--- mqtt.py.orig 2018-09-03 14:11:09.000000000 -0700
+++ mqtt.py 2018-09-03 14:11:28.000000000 -0700
@@ -374,7 +374,7 @@
from_t = (v, from_unit, from_group)
v = weewx.units.convert(from_t, to_units)[0]
s = fmt % v
- data[name] = s
+ data[name] = float(s)
except (TypeError, ValueError):
pass
# FIXME: generalize this
Fodder for an extension update by mwall, I suppose....
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.