Skip to content

Conversation

@tanvach
Copy link

@tanvach tanvach commented Dec 23, 2025

Previously, when the Pod was turned off, the API would report a "Target Heating Level" of 0 (approx 27°C). The integration read this value directly, causing two issues:

  1. UI Glitch: The thermostat card would drop to show "27°C" immediately after turning off, losing the visual context of the user's setting.
  2. State Loss: When turning the device back on, it would resume operation at this "Level 0" (27°C) because the
    turn_on command did not explicitly restore the last known target temperature.

The Solution This PR improves the state management in climate.py to be more robust:

  1. Restore on Turn On: Modified async_set_hvac_mode to explicitly send the last known target temperature when turning the device on, ensuring it doesn't default to Level 0.
  2. Preserve State When Off: Updated the target_temperature property to return the locally stored target (_attr_target_temperature) when hvac_mode is OFF, rather than reading the API's "0" value.
  3. Autopilot Sync: Added _handle_coordinator_update to sync the local _attr_target_temperature with the API only when the device is ON. This ensures that if Autopilot or the official app modifies the schedule, Home Assistant captures that change and correctly restores it after a power cycle.

Note: I'm using an AI assistant to help with the coding. I've checked the generated code and tested on our pods (we have two) and it's now displaying and holding the bed temp states much better.

…entity, and display the last known target when off.
@lukas-clarke
Copy link
Owner

@tanvach, thanks for the contribution! I should be able to get to this PR sometime early next year.

- Implemented RestoreEntity in EightSleepThermostat to save target temperature
- Added logic to fetch 'smart' Autopilot schedule from API
- Fixed issue where 'off' state would default to 27C by falling back to Autopilot/Stored value
- Corrected unit conversion bug for Autopilot temperatures
@tanvach
Copy link
Author

tanvach commented Dec 30, 2025

I've pushed additional improvements to handle edge cases and Autopilot integration more robustly

Persistence Across Restarts: Implemented RestoreEntity. Now, if Home Assistant restarts while the Pod is off, it correctly restores the last known target temperature instead of reverting to the API default (27°C).

Smart Schedule Fallback: If no local state is saved (e.g., on a fresh install) and the device is off, the integration now fetches the actual "Smart Schedule" target (e.g., bedTimeLevel) from the API. This ensures the UI always displays the correct upcoming target temperature instead of a misleading default.

Unit Conversion Fix: Fixed an issue where Autopilot temperatures were incorrectly converted when using Celsius units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants