Nokia Sleep senor support

@diplix OK so I adjusted the position of the Nokia sleep ever so slightly, not it appears to be functioning well. I have a slatted frame so perhaps it requires precise positioning over a sold base. If it keeps functioning well I will write a component for it.

Mine is also showing something like an hour of sleep. I’ll try to move.
Have you guys tried with IFTTT? On my would take forever to turn on the lights if I left the bed.

IFTTT is very flaky - I won’t even make the effort to setup

1 Like

@robmarkcole did you ever get around to writing a component?

I did not, yet. I recall finding that someone had written a custom component for it. Only thing I can find right now is https://github.com/LiamsGitHub/WithingsNokiaAPI

You now need OAuth 2.0 to communicate with the Nokia / Withings Sleep

I put a link to a fork with OAuth 2.0 support in the other Withings thread.
Hopefully it might prove useful?

Yes that is useful. The only thing stopping me is that I already have multiple projects on the go, if you want to start writing a component I’m happy to help out where I can, testing etc?

I wouldn’t know where to even start with making a component unfortunately. Programming and my self don’t get along to well.

We all started somewhere

Sounds like the majority of the code is done, now you just need to format it to something like json and send it over via mqtt

AFAIK there is one big problem with their API… You can get the “health” data, but not the IN / OUT bed trigger… The one that would be most useful for automations…

I’ve already mailed withings (it’s no longer Nokia’s) and does not look like they will be adding that trigger soon (they pointed me to IFTTT again). Maybe it would help if more people mail their support…

“We want the trigger” :slight_smile:

TBH I’ve stopped using my Nokia sleep sensor, readings were so unreliable it disgusted me and I have it in a draw now gathering dust

Weirdness… In my bed it works perfectly… Do you have a waterbed or something? :wink:

Nope, but if I get up in the middle of the night it will often ‘end’ my sleep session there and not recognise that when I get back in bed the session should continue

I’ve been using the mi band 3 for sleep tracking and it’s been working really great. Have to use tasker to get it into HA

I just wanted to provide a quick follow up to how these pads have done for me. I use the IFTTT trigger and it works 100% for me. I really wish there was a local API, but with that said since the IFTTT trigger has worked perfectly, its fine for now. Still hoping they change their stance on the in/out of bed API

I dont actually even look at the sleep tracking, so I cannot comment on how well it does. I use the triggers to turn on a virtual switch for me and for my wife. These pads sometimes come down to as low as $70. It might be a bit just to monitor if you’re in bed or not, and no local API, but… super easy.

I use these now to trigger my goodnight routines and to turn off bedside lamps after we get into bed. I also use them as conditions for other automations, like if one of us is in bed, dont turn on the bedside lamps.

Withings Sleep (formerly Nokia (formerly Withings)) support for home assistant is coming. Here is a link to the pull request.

Documentation on how to use it:

Full disclosure, I wrote it.

5 Likes

Awesome. I have a couple of these. Will this provide in and out of bed info. I seem to remember that a while ago that this was not offered in the api. I’ve been using ifttt for a while to I initiate my good night routines when we go to bed

I discovered something possibly useful today. I’ve been using these for about 6 months with IFTTT to turn on/off an input boolean to know when we get in and out of bed. I also have the asus device tracker, and noticed while doing some cleanup of some of the device tracker names I noticed the trackers were on my list. I gave them friendly names, but when paying closer attention, I noticed that they were “home” every time there was a IFTTT event. So, even if the IFTTT did nothing, I could use the presensce as another way to be more local, and not require internet access. What I still need to test is, does it connect to wifi every time there is an event even if I’m not using IFTTT.

Either way, this is kind of a nice hack to not be dependent on the cloud. Still need to be able to come up with a good way to know the difference between in and out though. The wifi connections are quick.

even with the last dev version of home-assistant, i can not add the “component” withings on WebUI of my HA instance.

Any ideas of how to do that ?