dbsqp / withings-influxdb2 Goto Github PK
View Code? Open in Web Editor NEWDocker image to fetch data from Withings API and push it to an InfluxDBv2 bucket.
License: MIT License
Docker image to fetch data from Withings API and push it to an InfluxDBv2 bucket.
License: MIT License
I had to add a few extra steps to get this working:
I found that I had to specify an environmental variable WITHINGS_CALLBACK and give it the SAME address as was used when registering for the withings credentials. I used https://localhost knowing it would fail to load.
I booted into the container with WITHINGS_AUTH_CODE=INIT
instead of messing with the logs I bashed int the container and ran # python3 /withings2influxdb.py
went to the address provided and then logged in.
I then set this in the terminal with # export WITHINGS_AUTH_CODE=XXXXX
and reran # python3 /withings2influxdb.py
influxdb2_ssl_verify_str=os.getenv('INFLUXDB2_SSL_VERIFY', "True")
if influxdb2_ssl_verify_str is not None:
influxdb2_ssl_verify = influxdb2_ssl_verify_str.lower() == "true"
The condition "is not none" breaks my brain a little and I think breaks the code as it replaces the input False with True.
to deal with it i replaced:
if influxdb2_ssl_str:
influxdb2_url="https://" + influxdb2_host + ":" + str(influxdb2_port)
else:
influxdb2_url="http://" + influxdb2_host + ":" + str(influxdb2_port)
with:
influxdb2_url="http://" + influxdb2_host + ":" + str(influxdb2_port)
This isn't a general solution but it worked for my case
Thank you for putting this together. The code was easy to read and I was able to get it up and running.
If anyone has code to pull night_events in the api I would be interested to get that. I may work on that next.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.