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

Target temperature should be rounded to climate's entity precision. #29

Open
jyavenard opened this issue Jul 27, 2020 · 5 comments
Open

Comments

@jyavenard
Copy link

Currently, the target temperature of the climate_group will be the average of all entities target temperature.
However, this becomes an issue if you want to change all temperature at once and it's not rounded as the system expects; you'll get an error.

Say you have a climate_group that is made of 3 entities;
target are respectively, 19, 19 and 18.
The average shows will therefore be: 18.66C

Now the precision used for each of those entity is 0.5C ; so attempting to modify the temperature of the group one, by clicking the up arrow will set the temperature to 18.6+0.5 = 19.16.
This will cause an error.

The temperature reported must be rounded according to the max(precisions).

For now, I've made this change to round to the nearest .5C (as this is the precision my system allows)

self._target_temp = round(_reduce_attribute(filtered_states, ATTR_TEMPERATURE) * 2) / 2
@daenny
Copy link
Owner

daenny commented Jan 21, 2021

I think this is related to #32, would that also be a solution?

@LucidityCrash
Copy link

I believe so, this looks like another effect of the fact that the target temp of the group is an average of the target temps of the members of the group, when really it should be its own value that is then pushed out to the members of the group irrespective of the individual target temps.

@Naustdal
Copy link

Naustdal commented Nov 14, 2021

self._target_temp = round(_reduce_attribute(filtered_states, ATTR_TEMPERATURE) * 2) / 2

Did't not work for me. Thermostat stop sync to each other. A group with 2 thermostat.
Added your line in climate.py under "class ClimateGroup(ClimateEntity):", wrong place?

@jascdk
Copy link

jascdk commented Mar 22, 2022

Currently, the target temperature of the climate_group will be the average of all entities target temperature. However, this becomes an issue if you want to change all temperature at once and it's not rounded as the system expects; you'll get an error.

Say you have a climate_group that is made of 3 entities; target are respectively, 19, 19 and 18. The average shows will therefore be: 18.66C

Now the precision used for each of those entity is 0.5C ; so attempting to modify the temperature of the group one, by clicking the up arrow will set the temperature to 18.6+0.5 = 19.16. This will cause an error.

The temperature reported must be rounded according to the max(precisions).

For now, I've made this change to round to the nearest .5C (as this is the precision my system allows)

self._target_temp = round(_reduce_attribute(filtered_states, ATTR_TEMPERATURE) * 2) / 2

@jyavenard Hi - where did you put this line in the code?

@alexeiw123
Copy link

For now, I've made this change to round to the nearest .5C (as this is the precision my system allows)

self._target_temp = round(_reduce_attribute(filtered_states, ATTR_TEMPERATURE) * 2) / 2

This issue was tripping me up as well, thanks for this adjustment above, I've got it working how I like it.

Hi - where did you put this line in the code?

In case you never got the answer, it's in the .py file of the custom integration.

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

6 participants