Shorten message

Hi guys,

i got the following msg from Kodi over MQTT
"{"val": "Titel"}"

and i just want to see the titel on the Dashboard without the rest.

My function works but its not flexible

Thanks in advance

Select output a parse object in the mqtt node.
then access the value at msg.payload.val

1 Like

Use a JSON node to change the string to a JS object OR set the MQTT node to parse JSON

Then simply use msg.payload.val

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.


1 Like

Thanks guys, now it works :slight_smile:
Both answers where perfekt and super fast!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.