Skip to content

Non-existing sensors get added to json payload with 0 values by default #7047

@oscgonfer

Description

@oscgonfer

In some first tests for the work we are currently doing as part of the Smart Citizen meets Meshtastic Hackathon, the telemetry payload received in our MQTT broker has potentially misleading values. In the payload below, only temperature and humidity was present, but we see that all environment sensors are included, with a value of 0, which makes it difficult to know whether or not there is a sensor present. All sensors there, could potentially have a value of 0, and whether or not is a logical value, I believe they should not be sent (or made NULL)

/mesh12/2/json/LongFast/!da741924
{"channel":0,"from":3665041700,"hop_start":3,"hops_away":0,"id":1913147084,"payload":{"barometric_pressure":0,"current":0,"gas_resistance":0,"iaq":0,"lux":0,"relative_humidity":63.6100006103516,"temperature":29.8299999237061,"voltage":0,"white_lux":0,"wind_direction":0,"wind_gust":0,"wind_lull":0,"wind_speed":0},"sender":"!da741924","timestamp":1750022954,"to":4294967295,"type":"telemetry"}

I am opening a PR to work on this, hopefully is in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions