jchassin / homebridge-owfs

Home bridge plugin interfaced to OWFS (1-wire)
MIT License
5 stars 3 forks source link

Negative temperature values saturated to zero for DS18B20 #4

Closed wolfiesax closed 6 years ago

wolfiesax commented 6 years ago

Hi. I can't get negative (Celsius) values to show when using OWFS_DS18B20, instead values seem to be saturated to 0.0.

I suspect this issue may be related to the (minValue) definition of Characteristic.CurrentTemperature in gen/HomeKitTypes.js of HAP-NodeJS:

Characteristic.CurrentTemperature = function() {
Characteristic.call(this, 'Current Temperature', '00000011-0000-1000-8000-0026BB765291');
this.setProps({
format: Characteristic.Formats.FLOAT,
unit: Characteristic.Units.CELSIUS,
maxValue: 100,
minValue: 0,
minStep: 0.1,
...

mentioned as an issue here.

Could anyone else reproduce the problem? If the problem is due to the HAP-NodeJS issue, how can I update HAP-NodeJS and or homebridge-owfs to fix this? The solution seems very simple by just changing the min value from 0 to -100 for instance.

//Ulf

jchassin commented 6 years ago

Hi, I've never tried negative values, in principle, it is handled in lines 143 to 148.

I am going to perform a test and tell you

jchassin commented 6 years ago

Fixed in 1.3.3

jchassin commented 6 years ago

and tested in my freezer ;-)

wolfiesax commented 6 years ago

Verified ok here as well. Well done jchassin!!!

tmur11 commented 2 years ago

@jchassin, @wolfiesax I believe this is an issue again.