Skip to content

Conversation

@burmistrzak
Copy link
Contributor

@burmistrzak burmistrzak commented Jan 25, 2026

According to the HA folks, it's current best practice to expose/discover an additional temperature sensor for each thermostat because the current_temperature attribute of climate entities is not kept for long-term statistics.

By implementing this using the homeassistant.ts extension, we avoid exposing fake sensors to other ecosystems while still improving the UX for HA users. 😊

Fixes #29686

@burmistrzak
Copy link
Contributor Author

This probably deserves a unit test.
We need to make sure that local_temperature is correctly discovered as an additional sensor for different kind of thermostats.

There's also a small number of devices that already do expose local_temperature outside of a climate feature, so this case should be covered as well.

@Koenkk
Copy link
Owner

Koenkk commented Jan 27, 2026

Could you extend

it("Should discover thermostat devices", () => {
?

@burmistrzak
Copy link
Contributor Author

@Koenkk AFAIK, there's no mock device in tests that already exposes climate and local_temperature or temperature.

Currently, my test only covers the most common case, i.e. discover local_temperature of climate as an additional temperature sensor if no separate sensor named local_temperature or temperature is exposed.

Is this good enough?

@Koenkk Koenkk merged commit 26a0fd4 into Koenkk:dev Jan 28, 2026
11 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jan 28, 2026

yes, thanks!

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