Payload is showing zeros for data points in error

Data for various sensors is bouncing between the correct values and zero. It goes to zero when there is no data for that data point in a payload. Can the zero values be ignored, why is there a zero when there is no data for that data point in the payload?

Hi connectiva,

For me, an incorrect value will result in a 0, such as writing 0.89 to an integer.
“no data for that data point in a payload”, can you be a little more specific, what protocol are you using?
If the specific variable is completely left out of the payload, it should simply not update.

Wouter

Hi Wouter

I am also working on this with Connectiva. The sensor data is uplinking over LoRaWAN to Chirpstack. We are consuming the json payload from Chirpstack via a MQTT Agent and subscribing to the uplink topic for the device. We have set up assets to log the various measurements e.g. $.object.temperature which is working fine. The issue is when the device uplinks a payload without the specific temperature value openremote logs a ‘0’ value. We have tried setting the attribute as numbers, integers, positive integers etc but still getting the 0s.
Thanks
Clint

it might help if you show us exactly how the point is configured and the exact payload that is causing the 0

Sure. This is how we have configured it in the asset. I will try and capture the json payload when it has a temperature value and when it does not. It has just occurred to me that the issue may be in the Chirpstack decoder pushing a null which is getting converted to 0 in openremote???

yup I suspect that is the problem. I use The Things Industry and don’t have this problem. you might want to modify your decoder to no include the properties that are not in the payload.

Thanks - just made this change and will advise if it fixes the issue or not:

     if (temperature !== null) {
            decoded.temperature = temperature;
        }

Clint

Still getting the 0’s stored for the various measurements when the payload is {} as per the image below.
I have also posted the attribute history for the payload and temperature attributes below.



As an update, I have followed this tutorial which seems to resolved the issue Tutorial: Open Weather API using HTTP Agent · openremote/openremote Wiki · GitHub and “Setting multiple attributes with one agent link”.
In summary, I created an attribute called ‘payload’ as a json object and then added the agent link configuration item to received the entire json payload. I then used Attribute Links to push the specific measurement to individual attributes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.