robertklep / homebridge-nefit-easy

DEPRECATED — Homebridge plugin for Nefit Easy™
14 stars 3 forks source link

Temperature is off by 0.1 degrees #13

Closed MarijnDoeve closed 6 years ago

MarijnDoeve commented 6 years ago

When setting the thermostat to 18 or 20 degrees form my iPhone (iOS 12.0.1) or Mac (10.14), the thermostat is off by 0.1 degrees, so 17.8 or 18.1 or 19.9. Running on a Rasperry Pi 2 node.js v10.12.0 (but the same problem with v8.x) Homebridge v0.4.45 homebridge-nefit-easy v2.1.0

Oct 30 15:44:58 raspberrypi homebridge[959]: [10/30/2018, 3:44:58 PM] [Thermostaat] Setting temperature to 18.1
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting target temperature...
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting current state..
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting current temperature...
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...target temperature is 18.1
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...current temperature is 18.1
Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...current state is off
Oct 30 15:45:55 raspberrypi homebridge[959]: [10/30/2018, 3:45:55 PM] [Thermostaat] Setting temperature to 19.9
Oct 30 15:46:01 raspberrypi homebridge[959]: [10/30/2018, 3:46:01 PM] [Thermostaat] Setting temperature to 17.9
robertklep commented 6 years ago

That's umm strange. I'll have to take a closer look how this can happen, I'm not using Homebridge myself anymore but do use it's main HK component in a different app and I've never come across this issue myself.

On 30 Oct 2018, at 16:55, Marijn Jansen notifications@github.com wrote:

When setting the thermostat to 18 or 20 degrees form my iPhone (iOS 12.0.1) or Mac (10.14), the thermostat is off by 0.1 degrees, so 17.8 or 18.1 or 19.9. Running on a Rasperry Pi 2 node.js v10.12.0 (but the same problem with v8.x) Homebridge v0.4.45 homebridge-nefit-easy v2.1.0

Oct 30 15:44:58 raspberrypi homebridge[959]: [10/30/2018, 3:44:58 PM] [Thermostaat] Setting temperature to 18.1 Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting target temperature... Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting current state.. Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] Getting current temperature... Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...target temperature is 18.1 Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...current temperature is 18.1 Oct 30 15:45:39 raspberrypi homebridge[959]: [10/30/2018, 3:45:39 PM] [Thermostaat] ...current state is off Oct 30 15:45:55 raspberrypi homebridge[959]: [10/30/2018, 3:45:55 PM] [Thermostaat] Setting temperature to 19.9 Oct 30 15:46:01 raspberrypi homebridge[959]: [10/30/2018, 3:46:01 PM] [Thermostaat] Setting temperature to 17.9 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

robertklep commented 6 years ago

The value that is used to set the temperature is the value passed in by Homebridge, so either Homebridge or Homekit is sending these weird values.

dbeltman commented 6 years ago

I am a complete noob to the code, but when i set it to the minimum- and maximum values allowed in the control center (10 degrees C and 37 degrees C respectively), it does map them correctly in the homebrige log. When i set it to 10, it will set the thermostat to exactly 10C.

It almost feels like the temperature slider in ios12 is very exact in its value measuring, but it still rounds the value off in the overview of your devices so it makes you think this plugin is the problem. No way to debug this as far as my knowledge goes though.

Maybe a hacky workaround would be rounding off the values that Nefit-easy-homebridge receives and passes onto the Nefit API?

robertklep commented 6 years ago

Maybe a hacky workaround would be rounding off the values that Nefit-easy-homebridge receives and passes onto the Nefit API?

Yeah, sounds like this might be required, round off the the nearest half or full degree. Should be a relative easy fix, will take a look at it later today or tomorrow.

dbeltman commented 6 years ago

Great, thanks for maintaining this product!

robertklep commented 6 years ago

Okay, that was easy.

If any of you want to test:

npm i robertklep/homebridge-nefit-easy -g

If it works as expected, I'll publish it to the NPM repo.

dbeltman commented 6 years ago

I've tried it, and it works perfectly!

robertklep commented 6 years ago

Thanks for testing! Just published as homebridge-nefit-easy@2.1.1.