Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

climate.pyvicare_heating current_temperature rounded #87

Open
Pampasgras opened this issue Feb 6, 2022 · 7 comments
Open

climate.pyvicare_heating current_temperature rounded #87

Pampasgras opened this issue Feb 6, 2022 · 7 comments

Comments

@Pampasgras
Copy link

The climate.pyvicare_heating entity is showing:

current_temperature: 21
room_temperature: 20.6

I want my lovelace thermostat to show 20.6 (not 21)

current_temperature & room_temperature are set in climate.py (line 188) to the same value

            if _room_temperature is not None:
                self._current_temperature = _room_temperature
...
            self._attributes["room_temperature"] =  _room_temperature

I have to change PRECISION_WHOLE to PRECISION_TENTHS in climate.py (line 26)
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
and climate.py (line 309)

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

When I do that, I can see the current_temperature in my thermostat with tenth precision:
image
(also resulting in nicer history graphs)

Is there a reason for using PRECISION_WHOLE and not PRECISION_TENTHS?

@oischinger
Copy link
Owner

Did you try to set a temperature? I assume it will also change temp in 0.1 steps now which the api does not support.
Can you please check?

@Pampasgras
Copy link
Author

Pampasgras commented Feb 6, 2022

The thermostat target temperature always changes in steps of 0.5°C, both with the PRECISION_WHOLE and PRECISION_TENTHS configuration.
My vicare app allows only whole target temperatures, but setting a target temperature to 20,5°C in lovelace thermostat for example results in 20°C in my vicare app. (and will reflect back as 20°C in my thermostat setting within a minute)
No errors are generated in my logfiles when I specify 20,5°C using the thermostat.

I also tried using Service climate.set_temperature with setting 21,9°C, no errors are generated and target temperature in vicare changes to 21°C

(My vicare app supports tenth precision for current_temperature and whole precision for target temperatures)

@oischinger
Copy link
Owner

This is thightly connected to home-assistant/core#64282
I just found out that HA supports different precisions for current and target temperature.
I'll create a PR to test it out a bit.

@oischinger
Copy link
Owner

Please see #88
This is a proposal which should resolve the current problems but as a result it will only allow whole precision when setting the temperature.

@adorobis
Copy link
Contributor

adorobis commented Feb 8, 2022

I've just noticed that the same applies to the water_heater entity. The API returns current temperature value with .1 precision but the entity config is defined as PRECISION_WHOLE. Could we also separate the target temperature precision from current temperature for water_heater?

@adorobis
Copy link
Contributor

adorobis commented Feb 8, 2022

Btw, I've just tested and adjusting water_heater.py in exactly the same way works :)

@adorobis
Copy link
Contributor

adorobis commented Feb 9, 2022

Just a small observation after several hour with the decimals for current room and water heater temperature. Although the room temperature seems to be updated pretty ok, with recorded entry for every 0.1 degree change the water heater is not getting updates every 0.1 see below graph for water_heater:
image
and for comparison the climate entity one:
image
In theory on the first graph the new value should be coming after every 0.1 change or at least in 1 minute intervals - this is not the case, overnight the temp was droping every 1 degree and the interval was almost 1 hour. Is that someting in the design of the integration or PyViCare modules?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants