FUXA
FUXA copied to clipboard
Add JSONPATH exstraction from MQTT topic to define tags
Describe the feature Most of the data loggers that send data to MQTT do that with a structured message. Example: { "node": "modbus", "group": "CNC", "timestamp": 1702552760680, "values": {"A": 1, "B": 5, "C": 0, "D": 0, "E": 0}, "errors": {}, "metas": {} }
I think it could be very useful to introduce the possibility to enter inside the "values" sub-json to be able to parse A, B, C etc as Tags-values.
Describe the solution you'd like This can be easily done introducing the JSONPATH (https://www.npmjs.com/package/jsonpath) utility in the MQTT parsing page. We could like introduce a jsonpath box in which one can write the query (like, "$.values") to be able to exstract tags from the topic.
I also looked at this expecting BCV/Service_Water[values] to return the sub JSON. Luckily i am in control of my publisher and was able to change to a single level JSON
Yep, but if you'r for example taking over a job done by others just for the interface or HMI you need to have a little of room for manoeuvre in what you'r reading.
I have played around many a time with mqtt, and message formatting has always caused a headache.
Just shove it through something like node red and make your edits there.