Register null data into bucket


I have this simple part of my code to send data from an ds18b20 to

   void setup() {
          thing["temp"] >> [](pson & out) {
                  out["TEMPERATURA"] = sensors.getTempCByIndex(0);

    void loop(void) {

My question is how to send a null or error value wen the sensor is disconected.
ds18b20 sends -127 in error cases, how could I show it in a dashboard or bucket?

Thanks in advance!


I would try something like this:

thing["temp"] >> [](pson & out) {
                   int tempRead = sensors.getTempCByIndex(0);
                   if (tempRead != -127)
                     out["TEMPERATURA"] = tempRead;

In this way the “thing” will send a value only if its different to -127.

Hope this helps

Problem ploting Data

Thanks a lot, it’s the best solution, I also could make a default range.