lukas-clarke / eight_sleep

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

away_mode_stop service not turning off Away Mode #23

Closed nitefly closed 8 months ago

nitefly commented 8 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 8 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 8 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 7 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 7 months ago

THANK YOU! That worked perfectly.

3rdStng commented 6 months 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.

Mrtenz commented 3 months ago

I can't figure out how to turn off away mode. I tried set_bed_side as suggested, but it doesn't seem to work:

action: eight_sleep.set_bed_side
target:
  entity_id: sensor.maarten_s_bed_temperature
data:
  bed_side_state: left

I tried bed_side_state set to both and right too, but nothing seems to work. Any suggestions?

lukas-clarke commented 3 months ago

@Mrtenz, see https://github.com/lukas-clarke/eight_sleep/issues/34 In the meantime try removing and readding the hub to HA, and see if that fixes your issue.

Mrtenz commented 3 months ago

Thanks, that worked!