[FEEDBACK] Building a Withings Integration

Was talking about this in another thread and don't want to steal that. Working on a direct integration between HE and Withings devices (cutting out IFTTT as a middleman). I know people will definitely want the ability to get in-bed/not-in-bed status, but anything else? Here is the information available to pull Withings API

Note too that I can also access Withings Scale and blood pressure data. I have a Withings Scale that I could test with too. Can anyone think of what (if any) use data from a smart scale would provide in HE??? Withings API is the measurement data available

@JustinL @marktheknife @spalexander68 FYI since you were chatting a bit there.

4 Likes

I was really interested in the get in/get out of bed to trigger some automations in the master bedroom.

Having said that, I too, have a Withings smart scale. Could maybe create a tile or something to track weight loss or gain. Might motivate me to get on the treadmill a little more or lay off the homemade ice cream. Although I am not too sure I would want to see it in reality though......

1 Like

LOL. I like it. Tile on the dashboard that shows me and my wife and who gained/lost the most weight that day. I expect I'll be divorced by the end of the month :slight_smile:

5 Likes

Yes sir! Make it where it wouldn't unlock the wine or liquor cabinet until you lost xx number of pounds LOL.

Other than being something to do because you can and might be nice to look out, I don't really see an "automation" type real-case for a scale..... Might be wrong though.

Looking through the api documentation, it doesn't look too hard to expose the scale or other devices. Might be worthwhile to expose it and let the end user determine what the need for it may be.

1 Like

When I saw you were working on an integration I added these to my buy list. So thank you very much!!

I can hear the alexa announcements now - "Youve gained 5 pounds you lazy ***. Grab the leash and take the dog for a walk!"

Edit - There is a large amount of data available - could see some interesting use tracking sleep cycles and using some of the new graphing apps to display some cool stuff on dashboards.

Yeah I may do it just because I'm bored NOW and I won't have a Sleep Sensor till Saturday. If I build out the scale it means I can prove everything works. Looks like I can get weight in realtime. I'm going to use that to test out how fast the integration really is. It does say it can take up to 10 minutes which would be WAY slower than IFTTT. My hope is that's just them having a CYA

1 Like

Huh they have a baby monitor in the API... I could see that being something useful...

I think it would be useful to expose the data from Getsummary, for at least the last night. So could have attributes like:
lastSleepScore
lastSnoringTime
lastSnoringEpisodeCount
lastWakeUpCount
lastWakUpDuration

I would find it useful to set up notifications to notify me if my sleep score dropped below a threshold or if my snoring time got too high. That way I can stay in tune with how my sleep is going without having to ever open the Sleep mobile app.

If there's enough interest, too, showing the last 7 days of sleep score or snoring metrics on a dashboard or calendar seems doable.

Perfect! So happy you will work on this. I have 2 sleep pads and the scales too. Would love to get direct access to the in/out of bed switch instead of having to go via IFTTT and would like to be able to graph the various parameters out of the scales using Hubigraph (weight, bone mass, muscle mass, water etc).

One thing please to consider is the ability to reset the sleep pad because sometimes they get stuck in the wrong mode. So maybe something like we get in some motion sensor drivers where you can reset the driver to active or inactive, we maybe will need the same to reset to in or out of bed.

But if we have a direct integration, would it stop the devices from posting to the Withings Cloud "HealthMate" app? It would be a shame to lose all of that capability (like the sleep diagnostics for example)? Or that would still work in parallel?

There is nothing like this in the API, unfortunately. All I can do is pull data. The API doesn't support sending commands to the devices as far as I can see.

It will be using their official API, I can't say for sure until I build it but I'd be shocked if it disabled the HealthMate app

1 Like

OK, makes sense. Actually I'm guessing for motion the drivers don't do that either. It just sets/overrides the state of the device in Hubitat I suppose.

Do you have an example of a device that does what you're saying? Maybe I'm misunderstanding. If I can see an example it'd help

Sure. The Xiaomi zigbee motion sensor drivers have it. For example...

https://raw.githubusercontent.com/markus-li/Hubitat/release/drivers/expanded/zigbee-xiaomi-aqara-motion-sensor-expanded.groovy

1 Like

Ok, yeah that just updates it in HE, it doesn't send anything to the device

Yeah, I guessed as much. But still useful for sticky device situations :smile:

Well I only tested once, but stepping on the scale I got the data in HE within 3 seconds. So I'm guessing their note of " Important: Please note that we do not guarantee any real-time notification. Delays are typically less than 10 minutes but can reach as long as several hours." is just a "please don't email our support team if it's not instant!"

Also can confirm, yes it still shows up in HealthMate even when the API is setup.

1 Like

You've already connected to their api?????

Not yet pulling actual data, but grabbed the device list and able to subscribe to receive notifications:


That was when I stepped on the scale. I wasn't sure if the scale would report heartrate, but it does!

4 Likes

Love this. I have a scale and a heart rate monitor. Can't wait to test it.
Anyway to integrate with Google Fit and update weight data? I seriously dislike the Withings app...

Cool, you'll be able to help test the heart rate monitor then :slight_smile:
Unfortunately I know nothing about Google Fit but I believe the only way to integrate with it (if it's anything like Apple HealthKit) is with a native Android app so I doubt it. All this API gives you is the ability to pull data out of Withings into HE.

1 Like

Download the Hubitat app