Prometheus exporter for Withings Health Mate (For Public Cloud).
At first, create withings app for yours.
- Register with Withings Public API | Withings
- I recommend
http://localhost:8000/
to Callback URI. - Please note
CLIENT ID
andCONSUMER SECRET
.
- I recommend
The simplest way to use it is with Docker.
# set env
export WITHINGS_CLIENT_ID="YOURCRIENTID"
export WITHINGS_CONSUMER_SECRET="YOURCLIENTSECRET"
# run get_token.py
docker run -p 8000:8000 \
--env WITHINGS_CLIENT_ID \
--env WITHINGS_CONSUMER_SECRET \
legnoh/withings-exporter python3 get_token.py
# paste your generated data to .env (and edit TZ)
vi .env
# run exporter(with above .env file)
docker run -p 8000:8000 \
--env-file='.env' \
legnoh/withings-exporter
Alternatively, it can be started from the source.
# clone
git clone https://github.com/legnoh/withings_exporter.git && cd withings_exporter
pipenv install
# prepare env file for your apps
cp example/example.env .env
# input WITHINGS_CLIENT_ID, WITHINGS_CONSUMER_SECRET
vi .env
# exec get_token.py(in your browser)
pipenv run get-token
# paste your env to .env 3rd block (and edit TZ)
vi .env
# run exporter
pipenv run main
please check metrics.yml or example
- This script is NOT authorized by Withings.
- We are not responsible for any damages caused by using this script.
- This script is not intended to overload these sites or services.
- When using this script, please keep your posting frequency within a sensible range.