Skip to content

Propagate "unavailable" and "unknown" states instead of preserving the last known state #429

@jasilvanus

Description

@jasilvanus

When a source sensor for temperature or humidity becomes unavailable or unknown, currently thermal comfort will not update its values and preserve the latest known value. To reproduce, one can add a simple template sensor, use it as both temperature and humidity in a thermal comfort device, and observe how the thermal comfort device only updates if the source sensor changes to a non-unknown, non-unavailable value.

I think we should instead update to unavailable or unknown in such cases, for the following reasons:

  • Currently, automations cannot rely on thermal comfort devices without risking to indefinitely use outdated data in case the underlying sensor (e.g. a battery-powered device) becomes unavailable. Automations could add extra checks against the underlying sensors, but that would be awkward and error-prone.
  • Propagating unavailable and unknown lets the thermal comfort device act more consistently with the underlying physical device: If the underlying phyical device could directly report e.g. absolute humidity, that sensor would also become unavailable if the physical device becomes unavailable.

This would be a breaking change, and there could be existing users relying on thermal comfort caching the latest known good value.
An alternative would be add an option to control this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions