I've got an issue, only on one device so suspect it must be the driver, where negative values (temperature in this case) show in, what i refer to as, "scientific notiation"
ie, value of -1.5 shows as value=0E+1 which doesnt translate when i wish to send a numeric value as a GET command. (positive values work as expected)
The device for which this happens is the Fibaro FGBS-222 Child Temperature Sensor using the driver:
Looking at the code (and being a numbskull when it comes to driver code) does Hubitat retrieve the driver code on demand from the URL shown or is it permanently located/stored locally in the Hubitat?
A copy is stored on the hub. The importUrl is used to do a quick re-import of the code from the source for refreshes if you want to do this manually instead of using an app like HPM.
thanks, @thebearmay , that's useful to know.
If the driver-developer updates the code might this mean i could have modified code in my hubitat, for better or worse?
There is all sorts of stuff going on here in the Fibaro FBGS-222 Smart Implant.groovy
Calling another functions to do all sorts of conversions, etc....
Section starting at Line 423 and 465 look the same so you will need to fix both
case [7,8,9,10,11,12,13]:
(finalVal,units) = convertTemperature(cmd)
finalVal = finalVal.toFloat() + settings["${"sensorOffset" + (endpoint-7).toString()}"]
finalVal = Math.round(finalVal* 10.0)/10.0
target?.sendEvent(name: "temperature", value: finalVal, unit: units, descriptionText:"${target} temperature is ${finalVal}${units}" )
break
I think the issue is probably with the toFloat, Float values are odd in Groovy especially when you start doing math with them. In my driver that deals with temperatures I use BigDecimal types.
You could try replacing the line that has the toFloat (in both sections) with this, and also comment out the rounding bit right after that.