Parse Json data into sensor

Hello,

i want to update a device_tracker by sending an mqtt message with the location and using the device_tracker.see service.

My Problem is how to send the data as a variable in the node:

This is the mqtt message in Json format

{“acc”:20,“batt”:51,“conn”:“w”,“lat”:47.1555555,“lon”:7.255555,“tst”:1496413492}

and here i Need to get the lat and lon data into the node

{“dev_id”:“giannis_giannis”,“location_name”:“home”,“gps”:[“lon”,“lon”]}

However the variables are not getting through. What am i missing?

If you need help with Node-Red, you should provide you flow, it will help
anyway shooting in the dark here
assuming
{“acc”:20,“batt”:51,“conn”:“w”,“lat”:47.1555555,“lon”:7.255555,“tst”:1496413492}
is your payload
have you tried
{“dev_id”:“giannis_giannis”,“location_name”:“home”,“gps”:[“{{payload.lat}}”,“{{payload.lon}}”]}

1 Like

Thx that worked

bulls eye
down to the pub to play darts !