Help with dashboard text node

I am trying a simple dashboard item. a switch node feeds a MQTT out node that controls a smart switch. The smart switch sends an MQTT back with the status like this.

stat/tasmota_F21D23/RESULT : msg.payload : string[14]
"{"POWER":"ON"}"

This I feed to a JASON node to get this.

tstat/tasmota_F21D23/RESULT : msg.payload : Object
{ POWER: "ON" }

Now I want to display the word ON next to the switch on the dashboard but I can't get a text node to display just the value "ON" and not the whole payload. Help with how the formating works would be appreciated.

User the copy path button on the debug the paste it into the field & surround it with 2 curly brackets.

something like {{payload.POWER}} or {{msg.payload.POWER}}

Alternatively, use a change node to move msg.payload.POWER into msg.payload.


Canned text...

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.

BX00Cy7yHi

Thank you for the pointer to the docs. I need to do some studying.
I got this to work with the following in the text node.
{{payload.POWER}} I think my lack of knowledge of HTML and Javascript
make understanding this difficult.

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

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