Skip to content

Add an estimated ready time sensor for bodies of water - #5

Merged
PoolsideStan merged 4 commits into
PoolsideStan:mainfrom
jaltmayerpizzorno:spa-ready-at-sensor
Oct 5, 2026
Merged

PoolsideStan merged 4 commits into
PoolsideStan:mainfrom
jaltmayerpizzorno:spa-ready-at-sensor

Conversation

@jaltmayerpizzorno

Copy link
Copy Markdown
Contributor

What

This adds an Estimated ready time timestamp sensor for each body of water. 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 …".

It's the same change as PoolsideStan/home-assistant-core#1, applied to the custom component. That PR has the details and the tests.

A note on syncing

I know this repo is synced from the core branch with scripts/sync-from-core.sh. I'm opening this PR purely as a convenience, in case you'd like to get the sensor to HACS users before the next sync. If you'd rather keep everything flowing from core and pick it up with your next sync, that makes complete sense. Feel free to just close this PR. Thanks for the integration!

Changes

  • sensor.py: a new PoolsideBodyReadyTimeSensor, created alongside the temperature and water-state sensors for each body of water. It reads TargetEndDateTime from the body's TemperatureRiseInformation push. It's unknown while the controller is still sampling (the 0001-01-01… placeholder), once ActualEndDateTime is set, and when no heat-up is in progress.
  • const.py: the field and key names, to be imported from aiopoolside.const once Add TemperatureRiseInformation field constants aiopoolside#3 is released.
  • strings.json, translations/en.json, icons.json: the entity name and icon.

Testing

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

🤖 Generated with Claude Code

jaltmayerpizzorno and others added 2 commits October 1, 2026 09:24
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 so automations and dashboards can show when the spa or pool will be
at temperature.

The value is unknown while the controller is still sampling the water
temperature (TargetEndDateTime is a 0001-01-01 placeholder), once
ActualEndDateTime is set, 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>
@PoolsideStan
PoolsideStan self-requested a review October 2, 2026 03:08
@PoolsideStan PoolsideStan self-assigned this Oct 2, 2026

@PoolsideStan PoolsideStan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The structure fits the integration well: it uses the group entity base, the same unique ID scheme, translation and icon keys, and the shared datetime parsing. A few things before merging:

Match when the official app shows a "ready in" time. Right now the sensor reports TargetEndDateTime whenever it's a real date. The official app only shows a ready time when TemperatureState == "SAMPLED" and HeatingEventType == "NORMAL", and the target is still in the future. Without that filter the sensor shows times the app hides:

  • During SAMPLING, the controller already fills in a preliminary estimate before the water has been properly sampled. This also contradicts the docstring's "unknown while sampling".
  • During MAINTAIN_TEMPERATURE and LEARNING, which don't represent a heat-up ETA.
  • After the target time has passed, which Home Assistant would render as "x minutes ago".

Suggestion: gate on those two fields plus a future check, and keep the 0001-01-01 placeholder guard.

ActualEndDateTime check. The controller clears the live document when a heat-up ends, so this field is never set on the value we read. The check can be dropped, or kept with a comment saying it's defensive.

Parsing consistency. Other JSON-in-string fields accept either a native value or an encoded string, and log a warning when parsing fails. It would be good to do the same here, and to parse the document once per read instead of once per key.

Entity creation. This adds the sensor to every body of water, including ones without a heater, where it would never have a value. Consider creating it the first time TemperatureRiseInformation is reported, the way the chemistry sensors work.

Nit: please add the new sensor to the sensor list in the README.

- 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>
@jaltmayerpizzorno

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review! All addressed in 3eea4e5 (and the same change in PoolsideStan/home-assistant-core#1, where it's tested):

  • The ready time now only shows for TemperatureState == "SAMPLED" and HeatingEventType == "NORMAL" while the target is ahead, and it's cleared at the target time if no new prediction arrives, so it never shows "x minutes ago".
  • Dropped the ActualEndDateTime check.
  • The document is parsed once per update, accepting a native value or an encoded string, with a warning when it can't be parsed.
  • The sensor is created the first time TemperatureRiseInformation is reported, like the chemistry sensors.
  • Added it to the README's sensor list.

@PoolsideStan
PoolsideStan merged commit 0378969 into PoolsideStan:main Oct 5, 2026
2 checks passed
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