Page 1 of 1

null values in custom logs

Posted: Thu 16 Jan 2025 5:51 am
by HansR
I am working on null values in custom logs and for that I created a Soilmoisture customlog:
    Schermafbeelding 2025-01-16 063450.png
      Then I disable the SoilMoisture1 sensor
      In the ExtraSensors log it correctly becomes null (after restarting CMX):
        Schermafbeelding 2025-01-16 064552.png
          But the output of the customlog then becomes:
            Schermafbeelding 2025-01-16 064821.png
              I think the customlog should log the zerostring just as it does in the ExtraSensor log. That would be consistent.
              What do you think?

              Or should I make the webtag:

              Code: Select all

              <#SoilMoisture1 nv=''>

              Re: null values in custom logs

              Posted: Fri 17 Jan 2025 2:42 pm
              by mcrossley
              HansR wrote: Thu 16 Jan 2025 5:51 am Or should I make the webtag:

              Code: Select all

              <#SoilMoisture1 nv=''>
              Nearly, it should be nv="". The nv= accepts a string, so "null" may be valid for say SQL inserts, but not for this CSV usage, you want an empty string.

              BUT I just checked, and the token parser does not accept empty strings! Fixed for the next build :(

              Re: null values in custom logs

              Posted: Mon 20 Jan 2025 9:13 pm
              by HansR
              OK. Thanks.