Generic Temperature sensor script ,JSON , Ds18b20

Hi , I use this script for generic temperature sensor ,

if (topic == “tele/tasmota_2657C7/SENSOR”) {
genericSensor1.value = (1.0 * data.DS18B20.Temperature + 20) / 70

It works if the temperature is up to 50C . If I change the limit to 100C the temperature in the generic sensor is not the same with the Ds18b20 sensor .
I changed the script from +20 to -12 and it is close enough but not the same.
What is the correct calculation please?

Thanks !

Should be +20 / 120, no?

First+20 tp align it to 0, and then divided by the total range (-20 to 100 => 120)

That is correct , thank you !

I can change the temperature limits in the generic Temperature sensor but I can not change the maximum temperature limit in the thermostat. Is it possible to change the limit from 50C to 100C ?


Yes, I suppose that can be done. Would you mind letting us know about the use case you have for this?

Done: Thermostat: Allow a wider range for min/may values by mzanetti · Pull Request #9 · nymea/nymea-plugins-genericthings · GitHub

I use Nymea to control the temperature in the fridges from 0 to 5C . I want to control the compressor oil temperature for the main chiller system too , 60-80C approximately .Right now I use “magic” for the max and min temperature limit but via thermostat will be more useful .

1 Like