Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Withings Binding

Dennis edited this page Apr 16, 2014 · 12 revisions

Documentation of the Withings binding Bundle.

Introduction

The Withings Binding allows to synchronize data from the official Withings API to items. The following body measure types are supported: diastolic blood pressure, fat free mass, fat mass weight, fat ratio, heart pulse, height, systolic blood pressure, weight.

For installation of the binding, please see Wiki page Bindings.

Setup

To access Withings data the user needs to authenticate via an OAuth 1.0 flow. The binding implements the flow through the command line interface. The first time the binding is started, it prints the following messages to the console:

#########################################################################################
# Withings Binding needs authentication.
# Execute 'withings:startAuthentication' on OSGi console.
#########################################################################################

In order to start the authentication process the user needs to execute withings:startAuthentication on the OSGi console. The binding will print the following lines to the console

#########################################################################################
# Withings Binding Setup: 
# 1. Open URL 'http://<auth-url>//' in your webbrowser
# 2. Login, choose your user and allow openHAB to access your Withings data
# 3. Execute 'withings:finishAuthentication "<verifier>" "<user-id>" on OSGi console"
#########################################################################################

So the user needs to open the shown url in a web browser, login with his withings credentials, confirm that openHAB is allowed to access his data and at the end he is redirected to a page on github. There the user finds the command withings:finishAuthentication "<verifier>" "<user-id> with filled parameters that is needed to finish the authentication.

The binding stores the OAuth tokens, so that the user does not need to login again. From this point the binding is successfully configured.

Item Binding Configuration

To bind a measure value to an item the measure type has to be defined in the generic binding config. Withings data can be bound to NumberItems only. The syntax for a Withings binding is withings=<measure type> The following table shows the measure types and units, that are supported by the binding:

Measure type Binding Config Unit
Weight weight kg
Height height meter
Fat Free Mass fat_free_mass kg
Fat Ratio fat_ratio %
Fat Mass Weight fat_mass_weight kg
Diastolic Blood Pressure diastolic_blood_pressure mmHg
Systolic Blood Pressure systolic_blood_pressure mmHg
Heart Pulse heart_pulse bpm

The following snippet shows some sample bindings:

Number Weight     "Weight"     { withings = "weight" }
Number FatRatio   "FatRatio"   { withings = "fat_ratio" }
Number HeartPulse "HeartPulse" { withings = "heart_pulse" }

Synchronization

By default the Withings data is requested every 60 minutes. The interval can be configured in the openhab.cfg file. The interval must be specified in ms. The following snippet shows a data refresh interval configuration of 120 minutes:

withings:refresh=7200000 

Installation


User Interfaces


Community

(link to openHAB forum)

Development



Misc


Samples

A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Use case examples

Collections of Rules on a single page

Single Rules

Scripts


Release Notes

Clone this wiki locally