SteidlD / homebridge-inkbird-bt-thsensor

A homebridge-plugin for the Inkbird bluetooth temperature and humidity sensors.
GNU General Public License v3.0
8 stars 2 forks source link

Incorrect temperature #7

Closed Yurius38 closed 3 years ago

Yurius38 commented 3 years ago

Thanks for new version, but there is a new problem with temperature below zero. Log: [22/02/2021, 15:25:01] [Temperature] Info - Peripheral with MAC f8:33:31:6a:fa:8c found - stop scanning [22/02/2021, 15:25:01] [Temperature] Info - Sending temperature -2.5°C [22/02/2021, 15:25:01] [homebridge-inkbird-bt-thsensor] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: number -2.5 exceeded minimum of 0. See https://git.io/JtMGR for more info. As a result, homekit only displays 0 degrees.

SteidlD commented 3 years ago

Hi,

sorry it took me so long to react. Had a lot of projects to do first ;-) I had a look at it now and I think I found the problem. As a standard the homebridge limits temperatures to 0-100°.

Adding the "setProps" line shown below to the file "InkbirdBtTHSensorAccessory.js" should solve the problem. I tested with a bag of ice cubes and I got -1,9° now without problems. I'll release a new version 0.4.1 soon.

  //-----------------------------------------------------------
  // Temperature service
  //------------------------
  self.cTemperatureService
      .getCharacteristic(global.cCharacteristic.CurrentTemperature)
      .setProps({minValue: -273.15, maxValue: 1000.0})
      .on("get", self.getTemperature.bind(self));
SteidlD commented 3 years ago

Fixed in version 0.4.1