thejayo
(Jay)
December 26, 2016, 12:39pm
1
I’m trying to setup my Withings scale and can’t figure out how to configure the Withings Binding.
On the wiki page it says the first time the binding is started it should print the following:
Withings Binding needs authentication.
Execute 'withings:startAuthentication “<'accountId>” on OSGi console.
I don’t get this, however. I’m assuming I need to ender the “accountID” in my config file. I’m assuming this is a authentication key I need to get from somewhere:
accountId is an arbitrary key also used in the openhab.cfg
Does anybody know what this account ID is and where I can get it from?
sihui
(SiHui)
December 26, 2016, 3:19pm
2
Just read a little bit further in the wiki:
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 "<accountId>" "<verifier>" "<user-id>" with filled parameters that is needed to finish the authentication.
thejayo
(Jay)
December 26, 2016, 5:07pm
3
Ok, but that’s step 2, I’m stuck on step 1 - I don’t have the URL
sihui
(SiHui)
December 26, 2016, 7:19pm
4
As far as I understand the wiki (I don’t use that binding) you can use for the accountId whatever you want, it is arbitrary. Just create something like U6fx92us.
Then on a console execute withings:startAuthentication U6fx92us and it should give you the url …
Good luck.
thejayo
(Jay)
January 1, 2017, 1:54pm
5
The still doesn’t work. I get the following message:
Couldn't find Credentials of Account 'U6fx92us'. Please check openhab.cfg or withings.cfg
sihui
(SiHui)
January 1, 2017, 3:26pm
6
It looks like @Dibbler42 is using that binding, maybe he can help …
Dibbler42
(Thomas Bail)
January 1, 2017, 3:48pm
7
No i am not using the binding, because Withings does not support the air quality data in the API. And my weight is use less. it is enough to see it once a day.
Thomas
thejayo
(Jay)
January 1, 2017, 7:37pm
9
Would be great if @ldaniel could help. I don’t know what else to try.
In my openhab.cfg file I have the following:
############################## Withings Binding ###############################$
#
# Data refresh interval in ms (optional, defaults to 60000)
withings:refresh=60000
withings:accountId=U6fgh
In the OSGi console I enter
withings:startAuthentication U6fgh
Is this all correct?
I’m assuming I don’t need a withings.cfg although I tried creating one and entered the same information, which didn’t change anything.
maze
(Magnus)
January 28, 2017, 2:27pm
10
Does the binding Work with OH2?
HFM
(Henning F. Mettge)
August 13, 2017, 4:41pm
11
@maze @thejayo
Hi guys,
anything new on this topic?
thejayo
(Jay)
August 15, 2017, 5:09pm
12
Unfortunately not. I never looked at this anymore as it wasn’t a priority.
mboremski
(Mboremski)
August 20, 2017, 11:04pm
14
Tried whole night to succed.
Issue posted:
opened 10:53PM - 20 Aug 17 UTC
closed 04:07AM - 01 Sep 17 UTC
documentation
pr-submitted
Binding throws the following exeption:
```
2017-08-21 00:08:45.350 [ERROR] [or… g.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, id=1171, bundle=217/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!
```
## Expected Behavior
After trowing "org.openhab.binding.withings-1.10.0.jar" to the addons-folder this binding should setup itself.
## Possible Solution / Context
* I am not sure about the reasons. I tried to restart the binding.
Found that withings is now NOKIA. But URLs used in binding (WithingsAuthenticator.java) are still alive.
Minimum there should be an Update of the URLs
* I also tried to use the steps here [NOKIA-Health-API](https://developer.health.nokia.com/api) with DEFAULT_CONSUMER_KEY and DEFAULT_CONSUMER_SECRET given in WithingsAuthenticator.java.
Was able to find my withings-data when followed every step.
* Tried also to build my own **withings.cfg** like that (used ***** for privacy reasons):
```
token=04d08e***********************39fdcd06b4fe054c04
tokensecret=02c3fb2*********************de33c1cb1bc836bf774994c1
```
That gives the same error-messages
* Using the WIKI-Page was not very helpful because there are some contradictory informations. eg.:
`To change the OAuth parameters for the Withings binding the user can specify the following values in the services/withings.cfg:
The OAuth configuration must be stored in the file services/withings-oauth.cfg`
## Environment
* Version used: org.openhab.binding.withings-1.10.0.jar
* Operating System: openHABian (latest snapshot 2.2.0~20170820133825-1 (Build #1020)
## [DEBUG] log of start / stop
```
2017-08-21 00:08:43.581 [DEBUG] [org.openhab.binding.withings ] - BundleEvent STARTING - org.openhab.binding.withings
2017-08-21 00:08:43.812 [DEBUG] [org.openhab.binding.withings ] - BundleEvent STARTED - org.openhab.binding.withings
2017-08-21 00:08:44.376 [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=309, osgi.command.scope=withings, service.id=1171, service.bundleid=217, service.scope=bundle} - org.openhab.binding.withings
2017-08-21 00:08:45.350 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, id=1171, bundle=217/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) [217: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) [?:?]
2017-08-21 00:08:45.444 [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=311, service.id=1172, service.bundleid=217, service.scope=bundle} - org.openhab.binding.withings
2017-08-21 00:08:47.763 [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=310, service.id=1174, service.bundleid=217, service.scope=bundle} - org.openhab.binding.withings
```
namraccr
(namraccr)
August 20, 2017, 11:35pm
15
Appears to be a bad configration key problem. See request in the logged issue.
mboremski
(Mboremski)
August 21, 2017, 9:14am
16
unfortunately it issn’t that easy.
The WIKI of the binding tells us it will generate its own config-file, but it doesn’t.
I also watched the code to make my own .cfg and tried nearly everything thinkable.
namraccr
(namraccr)
August 21, 2017, 11:22am
17
I searched the docs and did not find a statement about withings generating its own config file. Please quote the sentence you’re referring to.
Also, please show your binding configs.
I see there are a number of problems with the docs; I’ve started correcting those…
mboremski
(Mboremski)
August 22, 2017, 7:55pm
18
Look here .
I read the code and it looks like it generates its config-file itself if it is not there:
WhithingsAccount.java
138 if (!file.exists()) {
139 file.getParentFile().mkdirs();
140 file.createNewFile();
141 }
I dont have any binding configs (for withings)… Or what are you asking for?
namraccr
(namraccr)
August 22, 2017, 11:43pm
19
That section of code will only save out individual accounts, not the basic config.
eg. peter.userid, peter.token, etc.
namraccr
(namraccr)
August 23, 2017, 1:57am
20
Here’s a revised version of the withings README .
Look it over, maybe try redoing your setup based on it. Let me know what problems you see.