hi i have 2 sleep sensors coming in shortly, however 2 questions. How do i set 2 of them up? do i need to use 2 separate accounts and can i add to withing accounts in home assistant.
secondly, to use them as in bed sensor do we still need to use IFTT, or is it now natively working?
I have two of the sleep sensors.
You only need one account. You can add both sensors to that one account.
You do not need to use IFTTT anymore. Not sure exactly when, but the intergration now supports in bed and out of bed. It is still not “local” control, but it does work well. Mine usually reports in or out of bed within 5-10 seconds
The question is not detailed enough so answer is not obvious.
Maybe just give you more insight how it works.
Devices are usually registered to user accounts (to allow tracking own sleep by personal applications). So usually there are as many user accounts as devices. Likely it’s possible to own many devices too.
To make integration working, “owner” of the device must allow your HA integration to access its data.
The access is given to application defined in development account. To do that HA operator (you) must create development account on Withings pages and create an “application” which will represent connection during acceptance process.
Once you own such one, you can use it for integration with as many Withings devices as you wish. At this point the owner of the device must allow access to his device (which is obviously simplified if you are the owner).
If you configure the integration to use WebHook, IFTTT is not needed because webhook provides the same what IFTTT does. In fact IFTTT uses the same webhook so it adds an additional hop to transmission.
A great, i got my own setup now and working with webhooks, but i was wondering of i could connect the second one to my same account and assign it to my girlfriend. The reason why is that i dont think its possible to sync 2 withing accounts with ha?
Anyone else using this integration for the in bed sensor, having issues since .114
I’ve submited an issue, but also wanted to see if others are also noticing these issues.
Bottom line: After a restart of HA, my in bed sensor becomes unavailble until I activate it by getting into bed. It was not like this before .114 . Possibly .113.
it is result of the fix of issue I have reported.
Before that, HA restart was resulting in bed occupancy status always being set to off, regardless it’s occupied or not.
Simply put, the integration has no up to date occupancy data at the moment of system start. This is why it’s set to unknown making the behaviour predictable and consistent. I can imagine some heuristics helping in avoiding unknown state, but from pure data point of view there is no other way to get bed occupancy status other than waiting for next event
So are you saying that the component was updated and this is the new default behavior? Or are you saying that you like the current state of the compoent? I get what you are saying. Better safe than sorry, but I’d at least prefer a configuration option, Like Default to off or default to unknown. Maybe I’m not the normal user, but I have not restarted HA very often while I’m sleeping.
Edit: Ugg I see the PR and the change now. Not a fan, but it not wrong. I finally had withings sleep senor working great with no extra templates or additional sensors, or IFTTT, etc. And now I feel like this is step backwards for what seems to be to be an edge case. I may be wrong. I guess people could be restarting their HA instance at night with an automation, while they or sleeping, or maybe some household members are in bed, while others are restarting HA during the day. Here’s some input though. Unknown could also mean in bed or not.
If I am sleeping and HA is restarted, the status will be unknown. If im not in bed and HA is restarted the state will be unknown. Technically this is correct since there was no web activity until someone get’s in or out of bed, but I’m not sure how much better it is. I feel like this probably hurts more people than it helps. You could make a binary sensor based on HA being restarted to provide the same fix.
Ok, Sorry I’m done ranting. I’ll just make yet another binary template sensor.
I completly understand your feelings. I had the same seeing response on my report.
But after a while I figured out it’s the best choice. It opens door for further improvements. leaving it cheating the data, would result in spiral of hacking (it’s how I call the process when programmer must implement hacks over hacks there is no way back)
TBH current state of integration allows you to do the same providing the result you want.
I know it’s additional work for a user. and likely it could be done automatically by the integration too, as an option for example.
I believe it’s good foundation for further changes.
Personally I’m angry more on Withings for what they did to their API.
And installed the pythons script and then wrote this automation. For me it will solve my problem. Who knows might solve other problems I did not even know I needed to solve.
Same here. I just set up the integration yesterday and I am experiencing the same. The sensor shows up with a red exclamation mark on the integrations page and the in_bed_sensor shows “unavailable”.
What I’ve read here in the forums is that the state “unavailable” is expected after Home Assistant was restarted, but should change after a bed-in or bed-out event occurs. Well: I went to bed yesterday and left it this morning but the state did not change.
I examined the log files of my reverse proxy and did not see any incoming request from Withings (as configured in https://account.withings.com/partner/add_oauth2). So I guess I cannot blame Home Assistant, because it just received no updates from Withings. But how to troubleshoot that?
Yeah, true. I also suspect they’ll introduce artificial delays on their free plan in order to upsell people to premium. They are irrelevant in my eyes now.
You might be able to get around the free plans limitation by creating another two unique IFTTT accounts for your other two sensors. But that’s admittedly a really crummy workaround.
Let my quote myself as it’s still not working for me:
I’ve contacted Withings support and this is what they replied:
After consulting with our API team, they had confirmed that you need to subscribe to notification for each of its users, using "Notify - Subscribe" : https://developer.withings.com/oauth2/#operation/notify-subscribe
UPDATE: I just found Withings webhook for in_bed state not working · Issue #37290 · home-assistant/core · GitHub right after having posted here and it says “Setting use_webhook, client_id or client_secret does not affect existing configs. You’ll have to re add the integration to make that work.”
That’s why there still was "use_webhook": false in core.config_entries. Let’s see what will happen when I sneak in my bed this evening …