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

[Question] Parsing Object in the MQTT payload #1155

Open
henjoe opened this issue Apr 15, 2024 · 4 comments
Open

[Question] Parsing Object in the MQTT payload #1155

henjoe opened this issue Apr 15, 2024 · 4 comments

Comments

@henjoe
Copy link

henjoe commented Apr 15, 2024

Hi @unocelli ,
how can I parse data when the data format of my MQTT is in an object (nested object)? How can I drill down to that object so I can only choose one of its data?

image

@bogdanvaduva
Copy link

bogdanvaduva commented Apr 19, 2024

The only way of doing it (at least how I did it) was to create a new option within TagOptions

image

and then define the mqttTagConverter function within FUXA scripts.

Note: all above require changing FUXA (programming)

@henjoe
Copy link
Author

henjoe commented Apr 19, 2024

Hi @bogdanvaduva ,

Thanks for suggesting. Care to share your code, client and server to achive this?

This is interesting. I actually managed it too (I adjust the server program) so simply add the "/" for every JSON key.

For example, if I have a JSON payload of
data:{
temp: {
value: 23.5
}
}

I just simply set the address to be
data/temp/value

But I am interested on scripting too.
Thanks!

Regards,
Henjoe

@bogdanvaduva
Copy link

You can find the code at https://github.com/bogdanvaduva/FUXA-B

@henjoe
Copy link
Author

henjoe commented Apr 19, 2024

Thank you very much.

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

2 participants