Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature of climate entities not taken into account #154

Open
SwishSwushPow opened this issue Dec 15, 2024 · 2 comments
Open

Temperature of climate entities not taken into account #154

SwishSwushPow opened this issue Dec 15, 2024 · 2 comments

Comments

@SwishSwushPow
Copy link

SwishSwushPow commented Dec 15, 2024

Heyo everyone!

I came back to this after a while because I noticed that development had picked up a bit and gave it a go. For me one of the main use cases would be to control the thermostats around the house. When testing I noticed that the target temperature of my thermostats does not influence the "on/off" state of the stateful scene. Only the heating mode does I think.

I'm using the latest version of HA and of stateful scenes. I had a short look at the code but couldn't spot the issue immediately. I'll see if I have some more time to look into this. Until then, please let me know if I can test anything or provide more information. :)

Edit: Ok some more information as I did some more testing. The state of the scene is reflected correctly if I set the tolerance to 0. With tolerance 1 I get the following behavior: Say I set one thermostat to 21°C in my scene. If I change it to 20.5°C the scene is still on (as expected). Now when I set it from 20.5°C to 19.5°C, the scene remains activated. So probably the issues lies here where it compares the current value with a wrong base value?

@hugobloem
Copy link
Owner

Hi,

What is happening here is that when an entity updates, its new and old state are compared to check whether the change was "interesting" (i.e. change from on to off or value change larger than the tolerance). This is done to implement the debounce feature that prevents storing states when an entity is transient, such as when a light transitions to a different colour. Inadvertently, when you change an entity in increments smaller than the tolerance the updates are never considered "interesting" and therefore the stateful scene does not update.

There are multiple solutions to this:

  • set the tolerance value to 0 for the scenes using a climate entity
  • update stateful scenes to ignore this specific case
  • update stateful scenes to not judge state changes as interesting or not when the debounce time is set to 0

The first option would work for you (if there are no other entities requiring the tolerance) but it is perhaps too unclear to the user why this is happening. I am not sure which of the other options to go for here.

@SwishSwushPow
Copy link
Author

Hi and thanks for your reply!

For my use case I set the tolerance to 0 which helps already. I also set the debounce time to 5 seconds I think because the thermostats take a little bit of time to adjust (now it is shown as 0, not sure, maybe a reload of the scenes has reset it?).

When looking at the tolerance value, my first impression was that a value is accepted as long as it is within the scene value +/- the tolerance. So the behavior described by you is a bit different.

I would also not handle this case differently. Ideally we could find something that works for every case. What issues would occur if every change is deemed relevant and then we check if the new value is within scene value +/- tolerance? I assume it will be an issue together with the debounce value. I haven’t had time to look at the code yet (holiday break was quite packed), but hopefully I get a chance in the coming week.

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

No branches or pull requests

2 participants