When reading more sensors in basic program and only one sensor (or no sensor) is connected basic show readings from other sensor
temp 0 curr
temp 1 curs
temp 2 curt
when You connect only one sensor you get same temperature on curr, curs, curt variable
so i made simple change (maybe this is bad change but it works for me)
if ( Param0 == "temp" | Param0 == "ti")
{
valParam1 = GetMeThatVar(Param1).toInt();
valParam3 = GetMeThatVar(Param3).toInt();
if(sensors.getAddress(tempDeviceAddress, valParam1)) {
if( valParam3 >= 9 && valParam3 <= 12 ) {
sensors.setResolution(tempDeviceAddress, valParam3);
}
sensors.requestTemperatures();
SetMeThatVar(Param2, String(sensors.getTempC(tempDeviceAddress)));
}
else
{
SetMeThatVar(Param2, String(F("No sensor")));
}
return;
}
I also add next parametr which set resolution of DS18B20 reading. For this You must declare variable tempDeviceAddress with
DeviceAddress tempDeviceAddress;