Withings sleep used for presence detection

Is it possible to use the sensor to trigger in an out of bed automations?

Will this work without webhooks? My network is not reachable from the outside and I guess this would be needed for webhooks.

The withings in-bed detection is relyant on webhooks, and with the current integration I couldn’t get it to work anyway. I finally used IFTTT as a workaround, but that is not an option if Home Assistant is not exposed to the outside world. I use Nabu Casa cloud for that.

So, there is no way to get that data locally?

There might be another solution, though:

I read that the integration polls every 10 minutes for the state if no webhook is available.
If this time could be shortened in times I might actually go to sleep/wake up it would be perfect.
For example if at home, trigger every minute in the evening and in the morning. I usually don’t sleep at day, so I don’t have to poll.

No, every sensor works, but the in_bed sensor remains unavailable. It is not updated though polling. Also, if you poll too much, the Withings service may hit a rate control limit. As far as I know there is no local API, only though the Withings cloud service.

Withings does state that the sleepmat goes off wifi if you’re on it, so maybe checking it’s IP is possible, but I haven’t tried and I do not know if it is online all the time when you’re not in bed either.

I recently bought a Sleep Analyzer to detect if I am in bed or not. Like Edwin I had no success with the Withings integration in HA and used IFTTT instead. The problem is that it takes around 15-20 secs to update the state (in or not in bed). I think the delay comes from the sensor itself and not IFTTT.

Like Edwin suggested you may could check if the mat is connected to your LAN in order to check its state.

Is anyone else having the same experience with the delay?

I was recently able to get the webhook set-up working (even without Nabu Casa), find more details here: Struggling to get Withings integrations fully operational - #18 by wilcymay