Skip to content

Normalize the no-sensor water-temperature placeholder to None - #93

Open
ajplotkin wants to merge 1 commit into
bachya:devfrom
ajplotkin:normalize-placeholder-water-temperature
Open

ajplotkin wants to merge 1 commit into
bachya:devfrom
ajplotkin:normalize-placeholder-water-temperature

Conversation

@ajplotkin

Copy link
Copy Markdown

The problem

A Flo Smart Water Shutoff with no water-temperature sensor does not omit tempF
from telemetry, it returns a constant placeholder — 225 on the units I have
access to. get_info passes it through, so consumers cannot tell it from a
measurement. 225 °F is above the boiling point of water and far above anything a
domestic supply carries.

Recorder data from one valve over nine days:

entity rows distinct values
water temperature 70 2225 (x60), unavailable (x10)

Over the same window flow logged 19 distinct values and pressure 18, so the
device was reporting live data. It simply never measures a temperature.

Across 168 consecutive hourly buckets from /water/metrics, averageTempF was
225 in 166 and null in 2, with no other value. It is also 225 in live
telemetry sampled at 15-second resolution during real water use, so it does not
vary with flow, time or usage.

The change

get_info sets telemetry.current.tempF to None when it is at or above
boiling. Nothing else in the block is modified.

The threshold is boiling rather than 225 so the check does not depend on every
unit using the same sentinel. Detectors report ambient air temperature through
the same field and cannot approach it.

Why here rather than downstream

Home Assistant's flo integration publishes this value as a
SensorDeviceClass.TEMPERATURE with SensorStateClass.MEASUREMENT, so it lands
in long-term statistics. I opened home-assistant/core#182004 to filter it there
and the review asked for it in the library instead, which is the right call:
every aioflo consumer has the same problem, and this is a protocol quirk rather
than a presentation choice.

Related: home-assistant/core#180671.

Tests

Parametrized across the boundary — 225, 212, 220 and 300 are suppressed; 70,
211.9 and 33 pass through unchanged. Full suite passes (35).

A shutoff valve with no water-temperature sensor does not omit tempF from
telemetry, it returns a constant placeholder (225 on the units this was written
against). Passed through, it is indistinguishable from a measurement:
consumers chart it, store it in long-term statistics, and trigger on it.

Recorder data from one valve over nine days: the temperature entity logged 70
rows with two distinct values, 225 and unavailable, while flow logged 19
distinct values and pressure 18 over the same window. The device reports live
data; it simply never measures a temperature. Across 168 consecutive hourly
buckets from /water/metrics, averageTempF was 225 in 166 and null in 2, with no
other value.

get_info now sets telemetry.current.tempF to None when it is at or above
boiling. The check is against boiling rather than 225 so it does not depend on
every unit using the same sentinel. Detectors report ambient air through the
same field and cannot approach it.

Tests are parametrized across the boundary (225/212/220/300 suppressed,
70/211.9/33 passed through) so the check cannot regress to special-casing the
one value seen in the wild.
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.

1 participant