Automatically set bed presence

Just wanted to share an excellent trick for setting presence in bed using a sweet little Android app I found called Automate. Basically it offers a huge range of automation options, is a piece of cake to use, and is completely free. I use Withings sleep pads which are pretty reliable but sometimes the connection times out and I have to reauthenticate the connection. So I wanted another method in addition which is more reliable. It looks like this works nicely with not too much battery degradation the way I've set it up.

The app allows you to create flows with an amazing number of methods that tap into various parameters of your phone such as power status, GPS location, device orientation. That's what got me thinking.

I created two flows. Each one starts with a power status change. When I go to bed I plug my phone in to USB power and likewise when I get out of bed I unplug the charger. So this is a good start. The next step of the flow then automatically gets evaluated, which is to check my GPS location to make sure I'm at home so that this thing doesn't end up putting me to bed if I'm not at home. If I am then the next step is to check the orientation of my phone. In the go to bed routine, the flow will wait for the phone to go face down and will then send an endpoint to an HE flow trigger which sets my in-bed presence to present. In the out of bed routine the flow instantly checks the device orientation and if its not face down it sends the end point to set me out of bed. Then I set the device volume to 50% and activate a 2 bleep confirmation sound. Finally at the end of each flow, I re-start the other flow again.

Literally 5 minutes to set up and works perfectly.

Enjoy!

1 Like

I understand the Android part as I run a similar automation app on my phone. But I don't understand the http call that then tells HE to act. Could you please expand on how you make HE act?
Thank you.

RuleMachine can create something called cloud endpoints for a trigger. Any request to this cloud URL will trigger the RM routine.

Correct!