History Graph - Value for NULL aka Nothing?

Hi @ all,

i am new to Blynk and i measuring temperature and showing it with a history graph.
if there is some error on the Sensor the line graph goes to 85 or -127, because the sensor is giving this “error”-values.

i am trying to filter this and showing a gap in the line instead of messing up the graph every time the sensor gives wrong values…

i tried something like this

if(pooltemp != 85.0 && pooltemp != -127.0)
  { 
    Blynk.virtualWrite(V1, pooltemp);
  }else   { 
    Blynk.virtualWrite(V1, NULL);
  }

sadly i had no success on this yet, the line drops to zero now… can anybody help?

Dont send a NULL. Instead just dont do a virtualWrite.

if(pooltemp != 85.0 && pooltemp != -127.0)
  { 
    Blynk.virtualWrite(V1, pooltemp);
  }
1 Like

ah… ok. maybe so easy :sweat_smile:

thx, i give it a try when i am at home.

@sturze I’m not a big fan of != especialy with an &&. Plus you would normally need to be informed that the sensor has failed in some way. So I would have:

if(pooltemp == 85.0 || pooltemp == -127.0) 
{ 
   // warn of error with Serial.println(), email / notify / Terminal / Display widgets etc
}
else{
  // do the virtualWrite() of sensor data from graphing purposes
}

@Costas != liking code && so make different… Gunner still not understand #$#@ symbols and must lookup reference each time used :stuck_out_tongue:

1 Like

yup, this definitely fixed the line dropping to zero. The thing is now, if i just dont write the value does not changes :disappointed: this means i cant see that its not measuring. is there no value for “nothing”? or how can i manage to display that?!

As time goes on, and you hit a range button: 1h, 6h, 1d, etc. you will see the blank spaces during the time of no data.

really?? but i display the same virtual pin on a labeled value and this seems to show just the last measured temerature… is this another problem?

I see… ok, if you last sent a value, then stop sending any data… then yes, I guess it will keep displaying that last value.

I suppose you could build in some logic that says send a " " the first time the NULL data happens and then nothing from then on… should blank out the Display Widget and show acordingly on the History graph.

1 Like

mhm! that seems to be better! thank you!