Skip to content

Add an estimated ready time sensor to Poolside - #1

Open
jaltmayerpizzorno wants to merge 5 commits into
PoolsideStan:poolside-integrationfrom
jaltmayerpizzorno:poolside-estimated-ready-time
Open

jaltmayerpizzorno wants to merge 5 commits into
PoolsideStan:poolside-integrationfrom
jaltmayerpizzorno:poolside-estimated-ready-time

Conversation

@jaltmayerpizzorno

Copy link
Copy Markdown

What

This adds an Estimated ready time timestamp sensor for each body of water, for example sensor.spa_estimated_ready_time. It shows when the controller predicts the water will reach its set point, which is the same prediction the Poolside app shows as "ready in …".

The value comes from the body of water's TemperatureRiseInformation push, specifically its TargetEndDateTime. The sensor is unknown:

  • while the controller is still sampling the water temperature, when TargetEndDateTime is the 0001-01-01… placeholder;
  • once ActualEndDateTime is set;
  • when the document is missing or malformed;
  • when no heat-up is in progress.

Why

People want to know when the spa will be ready, for a dashboard or for automations such as notifying guests. The controller already computes this, but the integration doesn't expose it.

Changes

  • sensor.py: a new PoolsideBodyReadyTimeSensor entity, created alongside the temperature and water-state sensors for each body of water, plus a small parser for the document.
  • const.py: the field and key names. They aren't in aiopoolside.const in 0.1.0, so the comment says to import them from there once they are. That library change is in Add TemperatureRiseInformation field constants aiopoolside#3.
  • strings.json / icons.json: the entity name and icon.

Tests

The tests were written first, from payloads captured on a live controller. In tests/components/poolside/test_sensor.py:

  • test_ready_time_sensor_reflects_temperature_rise covers six cases: a prediction, still sampling, target reached, no target, malformed, and not a document.
  • test_ready_time_sensor_follows_revisions checks that a revised prediction updates the sensor and that clearing the field resets it.
  • Entity lists: the two tests that list every expected sensor include the new one.

Results:

  • Tests: all 197 Poolside tests pass.
  • Coverage: the new code is fully covered.
  • Linters: ruff and hassfest are clean, and mypy reports nothing in poolside.

Tried on a real system

I ran the same change as a custom component on an Attendant controller. The sensor stayed unknown while the app said "mixing water…". Then it reported the predicted time, matching the app's "ready in" to within a minute, and followed the controller's revisions as heating progressed.

The same change is also prepared for PoolsideStan/poolside-official-integration, so it can ship there before the core integration lands.

🤖 Generated with Claude Code

jaltmayerpizzorno and others added 2 commits October 1, 2026 09:52
The controller pushes a TemperatureRiseInformation document under each body
of water while it heats toward its set point. Its TargetEndDateTime is the
prediction the Poolside app shows as "ready in ...". Expose it as a timestamp
sensor per body of water.

The value is unknown while the controller is still sampling the water
temperature (TargetEndDateTime is a 0001-01-01 placeholder), once
ActualEndDateTime is set, when the document is missing or malformed, and
when no heat-up is in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Show a ready time only when the vendor app does: TemperatureState
  SAMPLED and HeatingEventType NORMAL (no preliminary estimate while
  sampling, none while maintaining temperature or learning), and only while
  the target is ahead. A time that passes without a new prediction is
  cleared at that moment, rather than lingering as "x minutes ago".
- Drop the ActualEndDateTime check: the controller clears the document when
  a heat-up ends, so it's never set on the value read.
- Parse the document once per update, accepting a native value or an
  encoded string, and warn when it can't be parsed, like other JSON fields.
- Create the sensor the first time a body of water reports
  TemperatureRiseInformation, like the chemistry sensors, so bodies without
  a heater don't get one.

Tests first; coverage of the sensor's new code stays complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jaltmayerpizzorno added a commit to jaltmayerpizzorno/poolside-official-integration that referenced this pull request Oct 2, 2026
- Show a ready time only when the Poolside app does: TemperatureState
  SAMPLED and HeatingEventType NORMAL, and only while the target is ahead;
  a time that passes without a new prediction is cleared at that moment.
- Drop the ActualEndDateTime check (the controller clears the document when
  a heat-up ends).
- Parse the document once per update, accepting a native value or an
  encoded string, with a warning when it can't be parsed.
- Create the sensor the first time a body of water reports
  TemperatureRiseInformation, like the chemistry sensors.
- List the sensor in the README.

Same change as PoolsideStan/home-assistant-core#1, where it is tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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