Withings sleep monitor. Is anyone still working on an integration

Admittedly the eight sleep is really a sleep monitor. The bed presence is actually determined by the HA integration using data from the API. It is not a feature of the eight sleep API itself which is much more focused on sleep monitoring than bed presence. I use it for example to turn off the TV in the bedroom if I fall asleep watching… This does not need to occur within seconds. The component might be tunable to be more sensitive? I don’t know, I have not looked at the code in quite some time.

I was actually speaking about the withings sleep monitor. It’s pretty decent with the IFTTT integration, justy would be nice not to have to rely on it. :wink:

yeah I got that… and indeed, to me IFTTT is not an option. It’s a matter of (design) principle. :stuck_out_tongue_winking_eye:
I remember now that the lack of integration was what got me to not consider Withings to begin with.

1 Like

Hello, I’m looking for assistance with the in_bed binary sensor. I’ve added Withings a couple of times in the past, and never had any luck with it providing me anything useful, so I’ve removed it. I noticed the in_bed sensor was added (not sure when), so I went ahead and set it back up.

The instructrions were a tiny bit confusing so I wanted to make sure I had it all set up correctly. I was able to add the integrtation, it saw my two users, it added sensors, and pulled a bit of info (weight for example), but the bed sensor does not do anything. Just stays as away.

I have my own domain, the external URL is set to that domain.

My withings set up is like this

My internal/enternal URL settings are as so

I’m running behind ngnix. I do have webhooks set to true.

Anyone else have the in_bed sensor working?

1 Like

Yea, I’m sitting on 4 eights. Bout to return for withings. Too slow

I’m happy with withings in general. Just as a matter of principle I’d love to get rid of the IFTTT part. It’s plenty fast though. Some day. One thing I did notice a while back might be another way to get around IFTTT. I track the sleep pad with my router too. When there is an in bed event, it changes from away to home. Stays active for about 10 minutes and then goes back to sleep

I have not tested to see how accurate it is, but I suspect I could use this as a trigger vs IFTTT.

Weird that they are all out of stock. Wonder if they are coming out with a newer version.

The in bed sensor works fine for me in my limited testing (like you, I’ve only re-installed it recently). I use Nabu Casa / HA Cloud though. I have the webhooks set to true in Withings config, and it updates within a couple of seconds of me getting on the sleep pad.

Seems to be around the same quickness as what I’m seeing with IFTTT method (no more than 10-15 seconds). So although it’s not noticeably faster in my experience so far, it cuts IFTTT out as the middle man and eliminates a potential point of failure which is great.

2 Likes

Good deal. I’m wondering if it’s my NGNIX proxy?

This is what my config looks like, is this what you’re looks like

withings:
  client_id: !secret withings_id
  client_secret: !secret withings_secret
  use_webhook: true

And can you confirm that your withings dev looks the same as mine above, other than the domain being nabu for you on on the callback URI

Thanks

Do you really use sleep monitors just for bed presence? I assume you do since this is the only event provided by IFTTT.

I bought Withings sleep mats to be able to react on going sleep and waking up events. Unfortunately withings api used by HA integration doesn’t provide reliable sleeping data anymore and has been excluded from the integration.

Now the question is: is there any chance to update the integration to make use of withings webhooks api?

I do use it for nothing more than bed presense. Kind of a waste, but it’s fun/neat. haha.
Two main automations for me
When my wife and I turn off the TV at night, the lamps on our bedside turn on. When each of us get into bed the lights turn off.
When both of us are in bed, my goodnight routine runs. ( I have a failsafe that runs later, just in case this does not work, but it almost always does work)

Oh, also when the last person gets out of bed, I get an alexa "goodmorning, PERSON X, here is your commute, weather, etc

If the goal is bed presence alone, there are much better ways to do it locally without cloud involvement and writing a component and an API for it. You could just add a pressure switch with a zwave or zigbee relay under the mattress and you would get instant signal. Seems like a very complicated solution to a simple problem… Indeed the interesting part of these devices is really the sleep monitor portion and getting them integrated into HA.

I generally agree. It’s a common topic. Some people like to build things (relay, scales, other devices), and some people like to buy things already made. I actually am kinda in the middle, but when I bought these several years ago, it was so simple, and I did not mind IFTTT. I did not build the API, but others have since withings also supports many other device types. If I was starting fresh, maybe I’d go another route, but scrapping it at this point would not be the best move for me.

Yep, my config is 100% identical to yours, both the YAML and Withings website fields (with the exception of my callback URI being Nabu Casa obviously). Hopefully you can get it working.

The sleep data isn’t completely excluded from the integration, those entities were just disabled by default for the reason you mentioned (unreliable data/updates from the API). But you can re-enable them if you want.

Ideally all that data would work reliably, but the most important thing for me is the binary sensor for in/out of bed. As long as that part works well (and so far it has), then you can kind of recreate much of the data that Withings provides within Home Assistant.

For example, to recreate the “Wakeup Count” sensor you can just increment a counter when the state of the binary sensor goes from on to off. You can log the times of when you got in/out of bed with input_datetime integration and track how long you slept with history_stats integration etc.

You will not be able to recreate snoring data, but in some ways that’s a good thing haha :stuck_out_tongue:

1 Like

Thanks for confirmation. I went ahead and deleted the integration and recreated it. My only thought was that when I first set it up, the use webhooks was not enabled, I added it to the configuration.yaml afterwards. Either way, removing and readdig the integration worked, and its; about 1 second faster than IFTTT, ha. Good deal, thanks again

1 Like

I didn’t know I can enable those data. However in my case the readings were completly off. and I don’t mean delayed or something. It looked like from different person from another time-zone (ie indicating deep sleep when we were at work). I rised this issue on Withings support but never succeed.

Do you a link for this type of project

Is your External URL with a Port like 8123? Cause this isn’t supported by Whitings Callback URL 👋 Welcome | Withings

No, just the internal. I actually got it working. My best guess was a bad order of operations.

What I did (wrong)
Add config to configuration.yaml
Add withings intergration
realized I wanted webhook to be true
added webhook true to config.yaml
NO WORKIE.

What I did (right?)
removed the integration, restarted
Had my correct config.yaml including the webhook true
added the integration back
WORKS!

1 Like

I reinstalled this integration but I’m surprised I cannot see sleep state entity among all other sleep ones (hiden by default). I can see counters for particular sleep phases but no indicator of current one. Is this something expected?