climate_group icon indicating copy to clipboard operation
climate_group copied to clipboard

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

Open jyavenard opened this issue 4 years ago • 5 comments

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 avatar Jul 27 '20 03:07 jyavenard

I think this is related to https://github.com/daenny/climate_group/issues/32, would that also be a solution?

daenny avatar Jan 21 '21 18:01 daenny

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.

LucidityCrash avatar Jul 24 '21 10:07 LucidityCrash

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?

Naustdal avatar Nov 14 '21 19:11 Naustdal

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?

jascdk avatar Mar 22 '22 22:03 jascdk

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.

alexeiw123 avatar May 26 '23 06:05 alexeiw123