lukas-clarke / eight_sleep

Home Assistant Eight Sleep integration that works with Eight Sleep's new API and OAUTH2
MIT License
62 stars 11 forks source link

away_mode_stop service not turning off Away Mode #23

Closed nitefly closed 3 months ago

nitefly commented 3 months ago

away_mode_start service call successfully turns on Away Mode however calling away_mode_stop does not turn it off. Wondering if anyone can confirm? My pod is configured with a single member.

service: eight_sleep.away_mode_stop
data: {}
target:
  entity_id: sensor.<XXX>_s_bed_temperature

Thanks.

lukas-clarke commented 3 months ago

You are correct. I looked into this and the API the app calls to stop away mode is the same one the for the "Eight Sleep: Set Bed Side".

So to stop away mode you need to call the "Eight Sleep: Set Bed Side" service, with any option, and it will take the user out of away mode.

I'm not sure why they removed the stop away mode API call, their new implementation seem unintuitive. There is actually a bug in it. It always sets the bed side for the user to "both" when you click "I'm back" to end away mode. So it would reset your bed side if you have it set to "left" or "right". This is tested for a solo user.

3rdStng commented 3 months ago

Thank you @nitefly - I was seeing this issue too, but hadn't dug into.

I'm having trouble getting the away mode to stop using the set_bed_side method though. It never seems to be setting me back to my side. I am not a solo user, so maybe that's part of the issue? This wasn't tested for a left or right user?

service: eight_sleep.set_bed_side
data: {}
target:
  entity_id: sensor.<XXX>_s_bed_temperature

Where does the 'left' go? If I include it in the data, it gives me errors. I've tried various '.left' or ':left' appended to the service, but it doesn't seem to like anything. I even tried "eight_sleep.set_bed_state" as left|right|solo is under that section

lukas-clarke commented 3 months ago

It should look something like:

service: eight_sleep.set_bed_side target: entity_id: sensor.laker_s_bed_temperature_2 data: bed_side_state: left

3rdStng commented 3 months ago

THANK YOU! That worked perfectly.

3rdStng commented 1 month ago

Just an FI update on the automations: Twice now my automation worked for setting the bed to away when 1 of the 2 were gone for X period of time. But the return would not. Turns out that setting only 1 side wasn't enough. (For those that have 2 zones for 2 people) I needed to define my side AND my wife's side for it to work. I have a feeling it is because while she was away I was set for "both" and just setting her for one side wasn't enough.