openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

Add Withings Binding #4395

Closed PanderMusubi closed 3 years ago

PanderMusubi commented 5 years ago

Expected Behavior

Withings smart scales are supported.

Current Behavior

Unsupported, but supported in version 1, see https://www.openhab.org/addons/bindings/withings1/

Possible Solution

Port https://github.com/openhab/openhab1-addons/tree/master/bundles/binding/org.openhab.binding.withings

Steps to Reproduce (for Bugs)

  1. Install version 1 and it works.
  2. Install version 2 and it doens't works.

Your Environment

wborn commented 5 years ago

Did you try adding the org.openhab.binding.withings-1.14.0-SNAPSHOT.jar to the addons directory? This community thread suggests it should work.

Because it is an OH1 addon you won't have discovery or Things in Paper UI. So you'd have to configure the binding with a .cfg file and setup items as shown in the documentation. If the OH1 binding works we can add a feature for it so it is easily installable using Paper UI (like other supported OH1 addons).

PanderMusubi commented 5 years ago

I would like to have discovery and support in Paper UI. In order to get this binding ported to OH2, I'm willing to put up a small bounty at https://www.bountysource.com/

wborn commented 5 years ago

Yes I agree it would be nice to have a native OH2 binding with all the nice features! :+1:

If we know that the 1.x binding works with OH2, we can still add it as a supported and installable binding while the full featured OH2 binding is being implemented. :wink:

PanderMusubi commented 5 years ago

Super. The bounty posted is for including discovery support.

wborn commented 5 years ago

Thanks for adding the bounty @PanderMusubi !

mgbowman commented 5 years ago

I might take a stab at this.

I have a Withings Body+ scale, 2x (old) Sleep Trackers (with the Aura alarm clock), 2 of the new Sleep trackers (without the clock but with IFTTT integration) and their blood pressure cuff 🤓

Will browse through the OH1 binding and go from there.

wborn commented 5 years ago

Does the OH1 addon work for you with OH2 @mgbowman?

hakan42 commented 5 years ago

Excellent timing, I was just about to start myself :)

If you do, I can concentrate on getting my other stuff working...

I talked with @teichsta in April 2017, and at that time he told me that he had no intentions to work on the OH1 binding and the code could be taken over.

mgbowman commented 5 years ago

@wborn I haven’t tried it to be honest.

I do know there’s Withings IFTTT integration and there’s OH2 IFTTT integration. I’m pretty sure a native binding would be preferred but I wonder if it isn’t easier to just setup IFTTT as a bridge between Withings and OH2.

Either way the data is read only and going to be fairly spaced apart (one doesn’t step on the scale more than once, maybe twice a day).

hakan42 commented 5 years ago

This is basically the way I am using Withings. Expose a string item via myopenhab, have IFTTT push the Withings data as a sort-of human readable data into that item, and in OH2 parse that string with rules.

The bad thing is, the IFTTT action is very unreliable, sometimes I get my data pushed in five minutes, sometimes a whole day is just skipped. That was my main reason why I wanted to start up my own binding back in April 2017.

PanderMusubi commented 5 years ago

Some people, like me, try to avoid IFTT and prefer a native binding, especially when there is already one in OH1.

hakan42 commented 5 years ago

@PanderMusubi , yes, I would love to avoid IFTTT as well as I don't like that my medical data travels to some other third party (bad enough that Withings holds the data, and at some time Nokia had it).

Using that bridge was a short-term solution, which lasted, as all short-term solutions do, for two years now :)

Guys, what do you think, should we open a thread over at the community forums to discuss the specifics?

PanderMusubi commented 5 years ago

If OH2 support Withings, I'm also interested in a configuration rule for my FOSS router to block sending this info to Nokia/Withings.

mgbowman commented 5 years ago

If OH2 support Withings, I'm also interested in a configuration rule for my FOSS router to block sending this info to Nokia/Withings.

I don't think this is going to be possible. I think the data will have to get to Withings (no longer Nokia) sooner or later. I think the only thing we can do is poll / pull the data from Withings into OH2.

Guys, what do you think, should we open a thread over at the community forums to discuss the specifics?

I think this is a good idea. Maybe we should all list what devices we have and what data points we're interested in seeing integrated into OH2.

hakan42 commented 5 years ago

I think this is a good idea. Maybe we should all list what devices we have and what data points we're interested in seeing integrated into OH2.

Here we go...

https://community.openhab.org/t/withings-reimplementation-as-a-openhab2-binding/60603

radokristof commented 5 years ago

I have tried the OH1.x binding, installation is not so easy (was one of the worst ones I have ever done in openHab, because of the OAuth), but it works. However I don't know why, but it only supports a few data (maybe API was updated since then), I mainly (as I described it on the forum) need this binding to fetch device battery life and get a report. I just only has a scale and blood pressure monitor (so nothing else could be used in OH), but others who have Sleep tracker or Withings Home or any other sensor could use this binding for automation.

victorhip commented 4 years ago

Hi, can you describe the intstalation process?

PanderMusubi commented 4 years ago

Who is working on OH2 implementation (without IFTTT)?

hakan42 commented 4 years ago

I am planning to, but not finding time for it ( as usual, getting distracted by $WORK )

PanderMusubi commented 4 years ago

Hope you can find it in 2020 :-)

PanderMusubi commented 4 years ago

Interesting to know, you can also connect the scale with USB, the ID is https://usb-ids.gowdy.us/read/UD/1fb2/0001 Should be possible to read out the data via e.g. a Raspberry Pi, but I have no idea how to interact with the device over USB? Somebody else know how to go about that?

PanderMusubi commented 4 years ago

Ah, there is a pairing wizard (Linux/Windows/macOS) that uses it.

Novanic commented 3 years ago

Hello, is someone currently working on it? I think with the release of OpenHAB 3, this binding will get broken. I worked recently on the Innogy SmartHome and Netatmo binding and would now like to start with the Withings binding, because I'm owning a Withings Body Analyzer / scale and Withings Sleep. And I would like to see the discovery and other features like trigger channels.

radokristof commented 3 years ago

@Novanic I think only @hakan42 said that he started working on this, but I think he did not had time to finish it (I also started looking into the implementation, but I also did not had time to get any valuable result). It would be great if someone would look into this. openHAB3 will completely break this binding, however I was not able to get this working even in openHAB2 and also the features it supports is very limited. Would be great to get battery operated devices battery level, react on Sleep phases with Withings Sleep, etc...

Novanic commented 3 years ago

I have now started with a rewrite of the binding on OpenHAB 2.5 and it looks very good so far. The authorization process and the discovery of scales is already working. But there is of course a lot of work to do.

kaikreuzer commented 3 years ago

Sounds awesome! But I'd suggest to directly write it for openHAB 3, since this is where new bindings are being included now.

Novanic commented 3 years ago

Sounds awesome! But I'd suggest to directly write it for openHAB 3, since this is where new bindings are being included now.

But I would like to use and test it within my productive system which is still on 2.5. ;-) I will migrate it later. When is the first stable release of OpenHAB 3 expected? December 2020?

kaikreuzer commented 3 years ago

Yes.

Novanic commented 3 years ago

I have now realized a version which supports scales and sleep monitors and the some useful measures. Please check if that is good / ok / usable. :-) I have now tested it for a few weeks and it seems to run very stable.

https://github.com/openhab/openhab-addons/pull/9154

chris400 commented 3 years ago

@PanderMusubi are you still interested in the binding?

PanderMusubi commented 3 years ago

Yes, but haven't tested it yet. Thanks for the great work.

fabitom commented 3 years ago

@Novanic does your first version will work on openhab 2 ? the problem is with openhab 3 ?

hmerk commented 3 years ago

closed due to inactivity and according PR was closed too.