Report Bugs Here

Moderator: Mmiscool

User avatar
By grzesiu
#46341 Hi,
When reading more sensors in basic program and only one sensor (or no sensor) is connected basic show readings from other sensor

Code: Select alltemp 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)
Code: Select all  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
Code: Select allDeviceAddress tempDeviceAddress;
User avatar
By forlotto
#48431 Hrmmm interesting another fella is having a problem with temp sensors too... This one in particular I wonder if it is not an update that possibly scrambled stuff up?

www.esp8266.com/viewtopic.php?f=153&t=1 ... 430#p48430