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.
I found this
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.
- alias: Fix Withings after Restart
initial_state: 'on'
trigger:
- platform: homeassistant
event: start
action:
- service: python_script.set_state
data_template:
entity_id: binary_sensor.withings_in_bed_tracy
state: 'off'
- service: python_script.set_state
data_template:
entity_id: binary_sensor.withings_in_bed_paul
state: 'off'
Any body else experiencing this unavailable issue? Mine won’t show up regardless of if I get out of bed or not…
I have the same issue that the sleep is unavailable.
Glad I’m not going crazy. I was really counting on this to help activate a bunch of my home automation.
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?
With IFTT basically nuking their free service, this integration is now the only way to get data from these sensors into HA.
Well you’d still be able to use IFTTT’s free tier for this as it only requires two applets (one for “got in bed” another for “got out of bed”).
But basically you wouldn’t be able to do anything else as you’re limited to 3 applets total on their free tier.
You are correct. This is what I meant by “nuking”. I should have been more precise.
I have 3 of these sensors in my house, I currently have one in IFTTT, but that leaves the other 2 currently doing nothing.
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.
Not that it could help you but on my end the integration works without problem (HA 0.114.3). I mean in-bed notifications
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
I am not a developer at all (but have some basic IT knowledge ^^), but 👋 Welcome | Withings says that you do have to do a POST to https://wbsapi.withings.net/notify with various parameters.
So I had a look at core/homeassistant/components/withings at dev · home-assistant/core · GitHub and was not able to find a refernce to that URL. This might explain why it is not working in my case. But it does not explain why it does work for others.
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 …
Mine does as well. I’ve got 2 sensors going. Both working great.
It works for me now as well (after removing and readding the Integration - Details see above).
Mine is still unavailable.
Are there specific steps needed?
I just tried to remove and readd it work no luck.
I suppose the state will be unavailable until you trigger change of its state. So after reconfiguring just sit down on bed for a while