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

Decimal Precision Differs on Climate entity vs related Temp and Humidity Entities. #174

Open
gregorymartin opened this issue Dec 8, 2024 · 6 comments

Comments

@gregorymartin
Copy link
Contributor

Is it possible to adjust the decimal precision to match across the entire Device? Right now I see:

  • Device current temp: rounded to nearest degree
  • Device point: one decimal place
  • Device humidity two decimal places
  • Current temp entity: one decimal
  • Current humidity entity: one decimal

I think 1 decimal all around would be appropriate.

Image to illustrate:
IMG_1913

@dlarrick
Copy link
Owner

I'll take a look through, but I'm not sure how much of this is under the integration's control. I recall one spot where we set precision but maybe there are others where we could.

@barndawgie
Copy link
Contributor

I get totally different precision on my install:
image

@gregorymartin
Copy link
Contributor Author

Ah, for the entities, I manually adjusted the precision in their settings. It’s the climate entity’s precisions that are really the question.

@dlarrick
Copy link
Owner

Hmm, all the sensors defined in https://github.com/dlarrick/hass-kumo/blob/master/custom_components/kumo/sensor.py declare that they are PRECISION_TENTHS. Are you sure you're using those sensors, not a template (as was necessary when this integration was first published)?

Also: the default precision for Climate entities is TENTHS for celsius, WHOLE for farenheit. I'm concerned that if we hard-code the precision there to TENTHS then adjusting setpoints will become difficult using up/down buttons. But feel free to experiment and share your findings here.

@zach-rosen
Copy link

Because Kumo seems to use a lookup table to convert from C to F, there's a lot of "rounding" that happens during conversion both ways. However, I've found (anecdotally) that controlling via F using tenths of a degree does allow a more accurate setting after Kumo has converted it internally back to C using its LOT.

I've added the following override kumo/climate.py

    @property
    def precision(self):
        """Return the precision of the system."""
        return PRECISION_TENTHS

adjusting setpoints will become difficult using up/down buttons

simple-thermostat lets you set this in the card, but it also looks like Climate entity has a target_temperature_step property you could customize.

@zach-rosen
Copy link

BTW, you SHOULD be able to customize precision from config.yaml…

  homeassistant:
    customize: 
      climate.kitchen:
        precision: 0.1
    def state_attributes(self) -> dict[str, Any]:
        precision = self.precision
        ATTR_CURRENT_TEMPERATURE: show_temp(hass, self.current_temperature, temperature_unit, precision)

... but state attributes don't look impacted by the setting:

	min_temp: 60
	max_temp: 80
	current_temperature: 70
	temperature: 65
	precision: 0.1

I think this is an HA bug but can't seem to track it down.

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

4 participants