Nice! This worked more or less perfectly. Two things:
1) You were missing 3 zeros on the time conversion to nanoseconds I think
2) I'd prefer all fields in the same measurement
The following diff takes care of these. (I know just enough Python to be
dangerous)
One thing I didn't know how to address... What do I need to do to get units
in metric?
Thanks,
Ryan
--- /root/weewx-influx-master/bin/user/influx.py 2016-08-09
20:48:14.000000000 -0600
+++ /usr/share/weewx/user/influx.py 2016-08-10 12:13:37.931570654 -0600
@@ -281,7 +281,7 @@
db'
logdbg('data: %s' % data)
if self.skip_upload:
raise AbortedPost()
db'
- req = urllib2.Request(url, '\n'.join(data))
+ req = urllib2.Request(url, data)
req.add_header("User-Agent", "weewx/%s" % weewx.__version__)
db'
if self.username is not None:
b64s = base64.encodestring(
@@ -349,11 +349,10 @@
db'
from_t = (v, from_unit, from_group)
v = weewx.units.convert(from_t, to_units)[0]
s = fmt % v
db'
- data.append('%s%s value=%s %d' %
- (name, tags, s, record['dateTime']*1000000))
+ data.append('%s=%s' % (name, s))
──────
except (TypeError, ValueError):
pass
- return data
+ return ('record%s %s %d' % (tags, ','.join(data),
record['dateTime']*1000000000))
On Tuesday, August 9, 2016 at 8:53:35 PM UTC-6, mwall wrote:
>
>
>
> On Tuesday, August 9, 2016 at 9:50:01 PM UTC-4, Ryan Sommers wrote:
>>
>> The GitHub site mentions InfluxDB support. Where can I find this?
>>
>> Thanks,
>> Ryan
>>
>
> hi ryan,
>
> try this:
>
> https://github.com/matthewwall/weewx-influx
>
>
