Setting up Withings Binding

Made a look trough the README.
Looks much better.
I made some comments on your pull request.

I tried the following:

  • deleting everything that contains to withings binding.
  • A systemwide filemane search with * withings * endet up with no results
  • A search for files containing * withings * ended up with this:
    Search "withings" (12 hits in 2 files)
     \\OPENHAB2\openHAB-share\openhab2-userdata\etc\org.ops4j.pax.logging.cfg (6 hits)
    	Line 115:	log4j2.logger.withings.level = TRACE
    	Line 116:	log4j2.logger.withings.name = withings
    	Line 116:	log4j2.logger.withings.name = withings
    	Line 117:	log4j2.logger.org_openhab_binding_withings.level = TRACE
    	Line 118:	log4j2.logger.org_openhab_binding_withings.name = org.openhab.binding.withings
    	Line 118:	log4j2.logger.org_openhab_binding_withings.name = org.openhab.binding.withings
     \\OPENHAB2\openHAB-share\openhab2-userdata\config\org\ops4j\pax\logging.config (6 hits)
     	Line 60:	log4j2.logger.org_openhab_binding_withings.level="TRACE"
    	Line 61:	log4j2.logger.org_openhab_binding_withings.name="org.openhab.binding.withings"
    	Line 61:	log4j2.logger.org_openhab_binding_withings.name="org.openhab.binding.withings"
    	Line 82:	log4j2.logger.withings.level="TRACE"
    	Line 83:	log4j2.logger.withings.name="withings"
    	Line 83:	log4j2.logger.withings.name="withings"
    
    Thats clear so far, because I changed the logleve for this binding. I Think this has no effect on my problem
  • Now I threw the file org.openhab.binding.withings-1.10.0.jar to the addons folder endig up with this log:
     15:53:25.744 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent INSTALLED - org.openhab.binding.withings
     15:53:26.332 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent RESOLVED - org.openhab.binding.withings
     15:53:27.049 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent UNRESOLVED - org.openhab.binding.withings
     15:53:27.507 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent RESOLVED - org.openhab.binding.withings
     15:53:27.843 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent STARTING - org.openhab.binding.withings
     15:53:28.297 [DEBUG] [org.openhab.binding.withings         ] - BundleEvent STARTED - org.openhab.binding.withings
     15:53:28.718 [DEBUG] [org.openhab.binding.withings         ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.pid=org.openhab.withings-oauth, osgi.command.function=[startAuthentication,finishAuthentication], component.name=org.openhab.binding.withings.authenticator, component.id=333, osgi.command.scope=withings, service.id=1235, service.bundleid=219, service.scope=bundle} - org.openhab.binding.withings
     15:53:30.402 [ERROR] [org.apache.felix.configadmin         ] - [org.osgi.service.cm.ManagedService, id=1235, bundle=219/file:/usr/share/openhab2/addons/org.openhab.binding.withings-1.10.0.jar]: Updating property consumerKey of configuration org.openhab.withings-oauth caused a problem: The given configuration key is unknown!
     org.osgi.service.cm.ConfigurationException: consumerKey : The given configuration key is unknown!
          at org.openhab.binding.withings.internal.api.WithingsAuthenticator.updated(WithingsAuthenticator.java:251) [219:org.openhab.binding.withings:1.10.0]
          at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [7:org.apache.felix.configadmin:1.8.14]
          at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [7:org.apache.felix.configadmin:1.8.14]
          at java.lang.Thread.run(Thread.java:745) [?:?]
     15:53:30.404 [DEBUG] [org.openhab.binding.withings         ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.withings.WithingsBindingProvider}={component.name=org.openhab.binding.withings.genericbindingprovider, component.id=335, service.id=1236, service.bundleid=219, service.scope=bundle} - org.openhab.binding.withings
     15:53:34.954 [DEBUG] [org.openhab.binding.withings         ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.pid=org.openhab.withings, component.name=org.openhab.binding.withings.binding, component.id=334, service.id=1238, service.bundleid=219, service.scope=bundle} - org.openhab.binding.withings
    

I really don’t know what I am doing wrong or waht else I could do.

Do I need a withings.cfg before I drop the *jar-FIle into the addons folder?
If so, what has to be in there? I can’t find any details about it in the README
EDIT:
For clarification:
I saw that there are some mandatory parameters:

  • consumerkey
  • consumersecret
  • redirectUrl

The README just says "Your …"
Maybe I am a noob but I dont know what to fill in there and whats the correct typograpy.

Thanks alot for your help.

Can anyone help?
Someone around here having this binding working?

Yes, you need a withings.cfg. You should configure it before installing the binding to avoid various headaches, even though it should be theoretically modifiable any time.

Make sure to use the right keys from the updated readme.

2 Likes

I figured this out, at least for OpenHAB 2.4.0 M8 and Withings binding 1.13.0.201812120952

I found this page: https://github.com/openhab/openhab1-addons/wiki/withings-binding

It says " Furthermore: if there were no values stored into openhab.cfg yet the Binding itself saves it’s configuration into the file services/withings-oauth.cfg" - which none of the other readmes does.

So I moved all the config from services/withings.cfg to services/withings-oauth.cfg and things suddenly worked fine. (Or at least I got passed the auth - haven’t checked for any real data yet.)

Hope it helps.

/P

2018-12-16 00:49:23.747 [vent.ItemStateChangedEvent] - Weight changed from NULL to 108.20500183105469

Damn it… why didn’t I just leave it be?? :confused:

How did you installed the binding? I couldn’t find it in ‘Addons’. Also does it reports the device’s data (like battery percentage?)

Thanks!

I downloaded org.openhab.binding.withings-1.13.0-SNAPSHOT.jar from the OpenHAB1.X bindings.

No, it doesn’t report battery levels. It connects to the Nokia / Withings web service, and gives you the data from there (weight, height, fat numbers, blood poressure, heart pulse, sleep patterns, etc - depending on what devices you have).

Thanks!
However it seems that the API supports it! I will try to include this in my setup!

Hi,

This is the only topic that mentions about successful binding. That’s very optimistic :slight_smile: Can you share haw did you get the required credentials like userid, token and tokensecret etc.
According to Withings documentation
https://developer.withings.com/oauth2/#tag/getting-started
I created “Withings developer app”, so I have Client Id and Customer Secret, but I don’t know how to get access_token and refresh_token.
Provides instructions are not clear and there is no real example.

Best regard