How to change the button node name?

Dear All :

How to change?
Like red circle "switch" chane to another name? Can or not?

Thank u.

Dear Sir :

My mean is ... Change the "switch" from another node ex : function.
How to do?

Thank u.

Delete it and drag the one you want into the edit area.

Dear Sir :

Im stupid, very sorry ... can u show me more.

Thank u very much.

Select the node... press delete button on your keyboard and it is deleted.

Dera sir :

My mean is keep switch and

if(switc==on) show +;
else show -;

Thank u.

Sorry, you lost me.

I can't help.

If you mean you want to change the state of the switch (on/off) then click the node and read the help text for the node in the right hand pane.

Untitled 1

Select those three nodes and Export them and paste them here. See this post for how to post a flow here - How to share code or flow json

That's remarkably difficult to do on my phone. I hope it worked!

[{"id":"283b54b6.9ab9ac","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"ba99032b.af62f","type":"inject","z":"283b54b6.9ab9ac","name":"msg.name = \"+\"","props":[{"p":"name","v":"+","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":280,"y":120,"wires":[["5c8f7d68.5a528c"]]},{"id":"3282929.03d0d6e","type":"inject","z":"283b54b6.9ab9ac","name":"msg.name = \"-\"","props":[{"p":"name","v":"-","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":280,"y":160,"wires":[["5c8f7d68.5a528c"]]},{"id":"5c8f7d68.5a528c","type":"ui_button","z":"283b54b6.9ab9ac","name":"","group":"a6e358b.672ffa8","order":1,"width":"2","height":"1","passthru":false,"label":"{{name}}","tooltip":"","color":"#000","bgcolor":"#fff","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":470,"y":140,"wires":[[]]},{"id":"a6e358b.672ffa8","type":"ui_group","name":"Demo","tab":"4e528085.a1bfa","order":1,"disp":true,"width":"20","collapse":false},{"id":"4e528085.a1bfa","type":"ui_tab","name":"Demo","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Dear Colin :

Maybe it can be...
And I will try it, when I have time.

Thank u.

You can also change the color of the text and background color of the button.
Screen Shot 06-28-21 at 10.24 AM

[{"id":"ba99032b.af62f","type":"inject","z":"283b54b6.9ab9ac","name":"msg.name = \"+\"","props":[{"p":"name","v":"+","vt":"str"},{"p":"txtColor","v":"white","vt":"str"},{"p":"background","v":"#0797479","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":280,"y":120,"wires":[["5c8f7d68.5a528c"]]},{"id":"3282929.03d0d6e","type":"inject","z":"283b54b6.9ab9ac","name":"msg.name = \"-\"","props":[{"p":"name","v":"-","vt":"str"},{"p":"txtColor","v":"black","vt":"str"},{"p":"background","v":"yellow","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":280,"y":160,"wires":[["5c8f7d68.5a528c"]]},{"id":"5c8f7d68.5a528c","type":"ui_button","z":"283b54b6.9ab9ac","name":"","group":"a6e358b.672ffa8","order":1,"width":"2","height":"1","passthru":false,"label":"{{name}}","tooltip":"","color":"{{txtColor}}","bgcolor":"{{background}}","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":510,"y":140,"wires":[[]]},{"id":"d560cdec.c5e45","type":"comment","z":"283b54b6.9ab9ac","name":"Flow to change button text, text color and background","info":"","x":380,"y":60,"wires":[]},{"id":"a6e358b.672ffa8","type":"ui_group","name":"Demo","tab":"4e528085.a1bfa","order":1,"disp":true,"width":"20","collapse":false},{"id":"4e528085.a1bfa","type":"ui_tab","name":"Demo","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
1 Like

Your flow works for me. What version of node red and node-red-dashboard are you running? Also check a different browser.

I meant that when I posted the JSON from my phone it was invisible in the post.
I fixed it by posting again from a PC.
My example flow did work to change the button label to "+" or "-".
I think that's what jlian168 was hoping to achieve.

Ah, sorry, I thought that the image you originally posted was from @jlian168. I must pay more attention.

Dear jbudd :

Yeah, That is what I want.

Thank u.

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