Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull device_id from json payload #155

Open
chuckb7 opened this issue Dec 3, 2024 · 0 comments
Open

Pull device_id from json payload #155

chuckb7 opened this issue Dec 3, 2024 · 0 comments

Comments

@chuckb7
Copy link

chuckb7 commented Dec 3, 2024

I have a json formatted message coming from Meshtastic that looks like the message below. I would like to use the json .from field as the device_id or a unique label/location that is associated with the payload data.

Since all of the sensors reporting have the MQTT topic of the gateway node, the .from field is the only way to distinguish .payload.* data from each sensor.

It appears that device_id and relabel regex both rely on the topic path, not anything within the json payload itself. Am I mis-reading the documentation? Is there another way to accomplish what I want? Would this be a new enhancement request?

{
"channel": 1,
"from": 1568714334,
"hop_start": 3,
"hops_away": 0,
"id": 202947538,
"payload": {
"current_ch1": 0,
"current_ch2": 25.6000003814697,
"current_ch3": 0,
"voltage_ch1": 0,
"voltage_ch2": 2.55999994277954,
"voltage_ch3": 0
},
"rssi": -33,
"sender": "!da6a55de",
"snr": 6.5,
"timestamp": 1732741620,
"to": 42937465,
"type": "telemetry"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant