PJCzx / homebridge-thermostat

Supports thermostat devices on HomeBridge Platform
Apache License 2.0
34 stars 71 forks source link

CurrentTemperature rounded to whole number #42

Closed JamesKnevitt closed 5 years ago

JamesKnevitt commented 5 years ago

Current temperature value displayed in HomeKit only displays whole number temperature values by rounding down I.e 22.8DegC is displayed as 22.0DegC.

PJCzx commented 5 years ago

Can you compare with the value from the logs ? The value is well defined as a float this.currentTemperature = parseFloat(json.currentTemperature);

phenotypic commented 5 years ago

This is partly to do with the HomeKit and partly to do with the plugin. HomeKit currently has a maximum resolution of 0.5 °C so you can't expect anything more than this.

However, the plugin is currently setting the resolution to 1 °C on line 276: minStep: 1. Thus, this issue can be partially resolved by changing the line to: minStep: 0.5.

It is worth noting that you could change the line to: minStep: 0.1 as I have done in my homebridge-web-thermostat plugin but this will have no further effect but could be useful in future versions of HomeKit where finer resolutions are supported.

JamesKnevitt commented 5 years ago

If I run Homebridge from command line then the output shows the following when getting status. 0|homebridge | [8/20/2019, 8:24:29 PM] [Thermostat-Livingroom] [*] currentTemperature: 22.4 but HomeKit shows 22.0.


Just seen your message @Tommrodrigues , that is interesting to know, I will look at that now.

JamesKnevitt commented 5 years ago

ok, I have updated this line as you suggested, now it works (to nearest 0.5), good enough for me for now.

Thanks 👍

PJCzx commented 5 years ago

Hello guys,

I just updated the code and published on NPM a version were both values are 0.5 instead of 1

Don't hesitate to perform pull request in such a situation ;)

Best,

smartechru commented 4 years ago

Hello @PJCzx

I could adjust minStep value but couldn't solve the temperature rounding issue yet. Currently, the temperatures are rounded. As example if homebridge finds 21.28°C from the API , it still shows 21.5 in the home app. Someone reported me that it is possible to show temperatures without rounding in Apple Home App. Do you have any idea to fix this? Thanks in advance.

PJCzx commented 4 years ago

Hello @smartechru, Unfortunately I have no more information than what @Tommrodrigues mentioned in his comment bellow.

https://github.com/PJCzx/homebridge-thermostat/issues/42#issuecomment-523184334

Best, @PJCzx