Closed astrakid closed 3 years ago
Hi Andre,
all influx related code is in influx.py
. It appears to me you'd need change from influxdb to influxdb-client
There are three methods in influx.py
:
loadData
loads a data frame df - I believe you can follow this. The second write is a straight forward data dictionary write.getLastIssueTime
is a straight forward read ...getPostData
was used in conjunction with SolCast tuning, which is deprecated anyway ... so you don't need this.Let me know if you have something, then we can share it through the repo :-)
yes, i think you are right an dinfluxdb-client is necessary. the major change is switching from user and password authentication to org, token and buckets:
my_token = my-token my_org = "my-org" bucket = "system"
establish connection: client = InfluxDBClient(url="http://localhost:9999", token=token, org=org)
write_api = client.write_api()
write_api.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek water_level=1"]) or write_api.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek water_level=1".encode()]) or write_api.write("my-bucket", "my-org", Point("h2o_feet").tag("location", "coyote_creek").field("water_level", 1).time(1)) or write_api.write("my-bucket", "my-org", [{"measurement": "h2o_feet", "tags": {"location": "coyote_creek"}, "fields": {"water_level": 1}, "time": 1}])
i will try to look into influx.py.
the new influxdbclient supports influxdb 1.8+. i think it makes sense to create a new module influx2.py. so we won't break current functionality and you can switch between influxdb <1.8 and 1.8+. what do you think?
makes sense - let's do an influx2.py
and then, once we see what it takes, we figure out how to make this easy for the user ...
Alpha version of merged influx.py shared with astrakid for testing.
Merged into trunk, released as v1.01 Thx. @astrakid for patiently testing :-)
thanks for implementing it! testing was the least i could do!
hi, just found your project, thanks for that. because i am not using solaranzeige, but my own dashboards (grafana), i would like to get support for influxdb_v2. i would like to support, but have not that much programming knowledge. regards, andre