From where is this text coming?

FOUND IT!

(Missed the double click trick. Tried it and it works. Thanks)

(bit of eye strain and use of a notepad program) :wink:

Yeah, weird. It is pointing to that node.

Ok... But now I don't understand what I'm seeing.

There is only this flow (well and a mouse test flow) that use DB-2.0 so I hope it hasn't been used.

Expanding from the pervious piccie.

No mention of HOLD I can see.

OK that is the node you previously mentioned, and you said it never gets sent ui_update.label = "HOLD".

I would clear the browser cache and restart Node-red. Fingers crossed the problem disappears.

1 Like

Not wanting to dismiss what you said (rebooting is slow.)

Could I try from a private window?

I also may add a new text node and stick it where this one is/was.

(Hang on while I try the private window option)

Interesting

On ANOTHER track - detected by opening the dashboard in a private window the GUI kinda changes.

See if you can see it

Normal window.

Private window.

(What is this app is offline ready?)
(Sorry... Back to the problem at hand.)

Try a full deploy then open the dashboard in a different browser (An emergency situation like this is surely what God made the Edge browser for) :upside_down_face:

"Let There be a Browser that Nobody Wants"

1 Like

(The world can't be flat. If it was, the cats would have pushed everything over the edge.)

:wink:

I know the world is not flat, because when I went to Australia, Orion was upside down.
It might not be scientific proof but it's good enough for me.

1 Like

Using OPERA....

Same. :frowning:
And that message is in the bottom right corner.

Hang on while I replace the node and put a new on in there.

Did you look at the moon?

When I was up there (northern hemisphere) it was interesting looking at it and seeing it the wrong way up.

1 Like

ARGH! which are the DB-2 nodes? ui- or ui_ ?

Find the node which injects "Test string" and disable it and the widget it connects to.
Is HOLD still there?

Deleted the text node, put in a new one and it all works.

ARGH!

Maybe it is like that problem I had/mentioned a few weeks ago with subflows.

Thanks @jbudd

We scarred the problem away.

That's all that matters, I guess.

Yay! Well done.

1 Like

Well, the widget from the inject node was said text node.

No HOLD in there.

(it's ba-a-a--ck!)

Did a couple of things and went back to that page.

HOLD is back.

In your very first screenshot, HOLD was clearly a node's label and Test was the value. Time: was a different widget.
It looks like the offending widget then was the one named State. It has a lot of input wires.

Find them all and change them one by one HOLD 1, HOLD 2, ...

@jbudd
Yeah this PROBLEM manifested itself on two TEXT nodes.
Somehow it went away.

the TIME node only has a 2 inputs.
the STATE node still has a lot.
They are working now to adjust what is shown and it seems to be working.
(See recent picture)

Update - for all.

Oh, formalities:

{"nodered_version":"4.0.9","nodejs_version":"20.19.4","npm_version":"10.8.2","nr_started":"2025-07-31T20:49:30+10:00","hostname":"me-desktop","os_pretty":"Ubuntu 22.04.5 LTS","release":"Linux 5.15.0-144-generic x64 LE","os_installed":"2017-10-31T15:42:16+11:00","last_reboot":"2025-07-31T16:38:57+10:00","cpu":"Intel(R) Core(TM) i5-7260U CPU @ 2.20GHz","cores":4,"totalmem":"31.2 GB","freemem":"14.3 GB","loadAverage":{"load1min":1.58,"load5min":1.41,"load15min":1.28},"networkInterfaces":{"lo":[{"address":"127.0.0.1","netmask":"255.0.0.0","family":"IPv4","mac":"00:00:00:00:00:00","internal":true,"cidr":"127.0.0.1/8"},{"address":"::1","netmask":"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff","family":"IPv6","mac":"00:00:00:00:00:00","internal":true,"cidr":"::1/128","scopeid":0}],"eno1":[{"address":"192.168.17.6","netmask":"255.255.255.128","family":"IPv4","mac":"94:c6:91:11:55:10","internal":false,"cidr":"192.168.17.6/25"}]},"collected_at":"2025-07-31T11:26:48.164Z"}

(or)

I did a node-red-restart and the problem was fixed.

Ran the code a couple of times and it worked.

But it all went off the rails when I pressed the HOLD button.

Here's a timeline of screenshots.

All good here.
(well nearly, but we'll let it slide)

I press Test button.

Test complete and show values
See how the time is displayed.
Handy when taking screeshots for tracking when it was.

(I missed the quick screen when it says it is resetting)
Clear all things and back to normal.

Normally when it runs, the results are displayed for 10 seconds then wiped.
ORIGINALLY during this time I would/could press the HOLD button to stop it wiping the data.
I modified the flow so you can press the Hold button before the test is done and it still holds the data.

Now - before pressing the Start button and press the Hold button.
Ideally it should toggle to HOLD, but for reasons unknown when first sent a signal the selection is set to PASS (normal)
See how Pass is now shown where the TIME used to be.
The Pass in the STATUS part is ok, as that is kind of the status.

So, I now press the WIPE button - just to clear things.

Again, this is good as the STATUS is wiped.
but the PASS is somehow locked in the TIME part.

Running the test (pressing Test button)

The results

And the end.

Resetting (Caught the clear message this time)

and back to being ready.

So all the fields have been wiped.
But the TIME is still branded with PASS

Sorry, I goofed and got the PASS changed to HOLD (I think by pressing the HOLD button.

But then the PASS changed to HOLD.

Running

Result

So as you can see this problem is back.

This problem can be resolve if I restart NR.
But that isn't really a nice way to do it.

It seems like a problem I had a few months back.
Something - somewhere - is getting stuck.

I'll try to make a smaller flow to make it happen.

Stand by for more updates.

:wink:

As best I can....

This is a flow (small) that causes the problem.

(Sorry, there is a SUBFLOW in it. Mine.)

[{"id":"402169a8.8a791","type":"subflow","name":"B Toggle 2","info":"2025 07 31\n==========\nForgot to add msg2 to update status of node\n\n2025 06 07\n==========\nNEEDS WORK!\nChange `RELOAD` to `RESET`\nChanged to `RESET`, but old code left in\nfor backward compatability.\nPLEAES UPDATE CODE TO NEW COMMAND\n\n\n2024 02 06\n==\nFurther update:\n`msg.enabled = true` and `msg.payload = X` will ENABLE the button node.\n`msg.enabled = false` and `msg.payload = X` will DISABLE the button node.\nbut please noted `msg.payload` has to be `X` also!\n\n2023 12 20\n==\nRe-write code to allow force reloading of desired state.\n\nToggle output at receipt of message.\nConfigurable output and message to send back to button node.\n(2022 12 16)\n\nIf `msg.payload == 0` (number) the output is forced to the OFF condition.\n\nIf `msg.payload == 1` (number) the output is forced to the ON condition.\n\nIf `msg.payload == \"RELOAD\"` (text) the output is set to what you determined in the\n                             `StartMode` value.\n\nIf `msg.payload == \"RESEND\"` the current condition is resent to the output.\n(Handy if button mode is wiped with deploy)\n\nAny other input toggles the output.\n\n## ENV variables:\n```\nStartMode - set start condition (`0` off `1` on).\nOnCLR - the colour when ON condition active.\nOnTXT - the text when ON condition active.\nOffCLR - the colour when OFF condition active.\nOffTXT - the text when OFF conditin active.\nON - payload when ON condition active.\nOFF - payload when OFF condition active.\nCTOPIC - the topic of the output message.\n```\n\nOutputs:\n - 1 $OFF for OFF and $ON for ON.\n - 2 $ON for OFF and $OFF for ON.  (Opposite of 1)\n - 3 to be sent back to button with `msg.colour` to set buttons colour and `msg.txt` for the text to be displayed.\n","category":"","in":[{"x":140,"y":190,"wires":[{"id":"69ae694095adea75"}]}],"out":[{"x":860,"y":180,"wires":[{"id":"5a9848b4303ef8d2","port":0},{"id":"8c41e6c213bcdefe","port":0}]},{"x":860,"y":280,"wires":[{"id":"3a564786d2308bdd","port":0},{"id":"a2ec504194f78107","port":0}]},{"x":860,"y":380,"wires":[{"id":"f14d0daf4ad33691","port":0},{"id":"aff48be4199bcfab","port":0},{"id":"69ae694095adea75","port":1}]}],"env":[{"name":"StartMode","type":"num","value":"","ui":{"label":{"en-US":"Start Mode (0/1) (off/on)"},"type":"input","opts":{"types":["num"]}}},{"name":"OffTXT","type":"str","value":"","ui":{"type":"input","opts":{"types":["str","num"]}}},{"name":"OffCLR","type":"str","value":"","ui":{"type":"input","opts":{"types":["str"]}}},{"name":"OnTXT","type":"str","value":"","ui":{"type":"input","opts":{"types":["str","num"]}}},{"name":"OnCLR","type":"str","value":"","ui":{"type":"input","opts":{"types":["str"]}}},{"name":"OFF","type":"str","value":""},{"name":"ON","type":"str","value":""},{"name":"CTOPIC","type":"str","value":""}],"meta":{"desc":"Button toggle node with feedback to button"},"color":"#D8BFD8","outputLabels":["Normal output","Inverted output","To button"],"icon":"node-red-dashboard/ui_switch.png","status":{"x":860,"y":490,"wires":[{"id":"a5b2ad35ad8518e2","port":0}]}},{"id":"69ae694095adea75","type":"function","z":"402169a8.8a791","name":"toggle","func":"let a = msg.payload\nlet msg1 = {}\nlet msg2 = {}       //  STATUS\nlet x = context.get(\"counter\") || 0\n\nif (msg.enabled != undefined)\n{\n    //      Work to be done here.\n    const en = msg.enabled\n    if (en == true)\n    {\n        //   ENABLE\n        node.warn(\"Enabled = true\")\n        context.set(\"disabled\",0)\n        a = \"RESEND\"\n    }\n    else\n    if (en == false)\n    {\n        //    DISABLE\n        node.warn(\"Enabled = false\")\n        context.set(\"disabled\",1)\n        //msg1.txt = \"disabled\"\n        msg1.txt = '<font color = \"red\"><i class=\"fa fa-ban fa-3x\"></i></font>'\n        msg1.colour = env.get(\"OffCLR\")\n        //node.status({text:\"DISABLED\"})\n        msg2.payload = { \"text\":\"DISABLED\" }\n        return [null,msg1,msg2]\n    }\n}\n\nif (context.get(\"disabled\") == 1)\n{\n    //  Can't do anything.\n    //node.status({text:\"skipped\"})\n    msg2.payload = {\"payload\":\"skipped\"}\n    return[null,null,msg2]\n}\n\nif (a == \"RESET\")\n{\n    a = env.get(\"StartMode\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\n//      2025 06 07\n///     OLD CODE.   To be deleted ASAP\nif (a == \"RELOAD\")\n{\n    a = env.get(\"StartMode\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\nif (a == \"RESEND\")\n{\n    a = context.get(\"counter\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\nif (a == 0)\n{\n//    context.set(\"counter\",0)\n//    msg.payload = 0\n    //node.status({text:\"Force OFF\"})\n    msg2.payload = {\"text\":\"Force OFF\"}\n    return [msg,null,msg2]\n}\nif (a == 1)\n{\n    //node.status({ text: \"Force ON\" })\n    msg2.payload = {\"text\":\"Force ON\"}\n    return [msg,null,msg2]\n}\n\nif (x === 0)\n{\n    msg.payload = 1\n    //node.status({ text: \"ON\" })\n    msg2.payload = { \"text\": \"ON\" }\n} else\nif (x === 1)\n{\n    msg.payload = 0\n    //node.status({ text: \"OFF\" })\n    msg2.payload = { \"text\": \"OFF\" }\n}\n\nx = (x + 1) % 2\n\ncontext.set(\"counter\",x)\n\nreturn [msg,null,msg2]","outputs":3,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":190,"wires":[["0db7c2da3958ea2c"],[],["a5b2ad35ad8518e2"]],"outputLabels":["output","output inverted","status"],"info":"##  Outputs `1` or `0` for ON/OFF and `msg.colour` to send to button."},{"id":"f14d0daf4ad33691","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"colour","pt":"msg","to":"OffCLR","tot":"env"},{"t":"set","p":"txt","pt":"msg","to":"OffTXT","tot":"env","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":350,"wires":[[]]},{"id":"aff48be4199bcfab","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"colour","pt":"msg","to":"OnCLR","tot":"env"},{"t":"set","p":"txt","pt":"msg","to":"OnTXT","tot":"env","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":410,"wires":[[]]},{"id":"0db7c2da3958ea2c","type":"switch","z":"402169a8.8a791","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":540,"y":190,"wires":[["5a9848b4303ef8d2","3a564786d2308bdd","f14d0daf4ad33691"],["8c41e6c213bcdefe","a2ec504194f78107","aff48be4199bcfab"]]},{"id":"5a9848b4303ef8d2","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":160,"wires":[[]]},{"id":"8c41e6c213bcdefe","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":210,"wires":[[]]},{"id":"a2ec504194f78107","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":300,"wires":[[]]},{"id":"3a564786d2308bdd","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":250,"wires":[[]]},{"id":"a035346e85f036ba","type":"inject","z":"402169a8.8a791","name":"Start Mode","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"","payload":"StartMode","payloadType":"env","x":190,"y":140,"wires":[["69ae694095adea75"]]},{"id":"a5b2ad35ad8518e2","type":"junction","z":"402169a8.8a791","x":650,"y":490,"wires":[[]]},{"id":"e62ae55b7805711e","type":"inject","z":"b39000460508d582","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Test message","payloadType":"str","x":5460,"y":600,"wires":[["1e9960df0ae08524"]]},{"id":"1e9960df0ae08524","type":"junction","z":"b39000460508d582","x":5640,"y":600,"wires":[["3ad8ee846db55472","d356048ed30c9e9a"]]},{"id":"3ad8ee846db55472","type":"trigger","z":"b39000460508d582","name":"","op1":"","op2":" ","op1type":"nul","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":5695,"y":550,"wires":[["054dc0465cbdc6b9"]],"l":false},{"id":"d356048ed30c9e9a","type":"junction","z":"b39000460508d582","x":5950,"y":600,"wires":[["52ba28d889a8d6fb"]]},{"id":"054dc0465cbdc6b9","type":"gate","z":"b39000460508d582","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":5820,"y":550,"wires":[["d356048ed30c9e9a"]]},{"id":"3ba6151acfca02e4","type":"change","z":"b39000460508d582","name":"blank","rules":[{"t":"set","p":"payload","pt":"msg","to":" ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":5855,"y":510,"wires":[["d356048ed30c9e9a"]],"l":false},{"id":"52ba28d889a8d6fb","type":"ui-text","z":"b39000460508d582","group":"6f4a6f88bfbb219b","order":11,"width":"2","height":"1","name":"","label":"Test","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":6110,"y":600,"wires":[]},{"id":"fc1b87d32a19ece6","type":"subflow:402169a8.8a791","z":"b39000460508d582","name":"","env":[{"name":"StartMode","value":"1","type":"num"},{"name":"OffTXT","value":"HOLD","type":"str"},{"name":"OffCLR","value":"red","type":"str"},{"name":"OnTXT","value":"PASS","type":"str"},{"name":"OnCLR","value":"green","type":"str"},{"name":"OFF","value":"close","type":"str"},{"name":"ON","value":"open","type":"str"},{"name":"CTOPIC","value":"control","type":"str"}],"x":5695,"y":490,"wires":[["054dc0465cbdc6b9","0533dbcbf8e77a7a"],[],["03e108143aa23ce0","500994344ea0c0cb"]],"inputLabels":["from HOLD button"],"l":false},{"id":"0533dbcbf8e77a7a","type":"switch","z":"b39000460508d582","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":5785,"y":510,"wires":[["3ba6151acfca02e4"]],"l":false},{"id":"93fb80fe63634587","type":"inject","z":"b39000460508d582","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"X","payloadType":"str","x":5520,"y":490,"wires":[["fc1b87d32a19ece6"]]},{"id":"020352927c165a64","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"Hold","label":"","order":10,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"X","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":5480,"y":650,"wires":[["a888ea107ac7f3bb","fc1b87d32a19ece6"]]},{"id":"03e108143aa23ce0","type":"debug","z":"b39000460508d582","name":"debug 34","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":5860,"y":430,"wires":[]},{"id":"500994344ea0c0cb","type":"switch","z":"b39000460508d582","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":5205,"y":660,"wires":[["9ac368e01da4aa5f"],["e00e37f0d00a65c8"]],"l":false},{"id":"9ac368e01da4aa5f","type":"change","z":"b39000460508d582","name":"Normal","rules":[{"t":"set","p":"ui_update.label","pt":"msg","to":"PASS","tot":"str"},{"t":"set","p":"ui_update.buttonColor","pt":"msg","to":"blue","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":5310,"y":650,"wires":[["020352927c165a64"]]},{"id":"e00e37f0d00a65c8","type":"change","z":"b39000460508d582","name":"Hold","rules":[{"t":"set","p":"ui_update.label","pt":"msg","to":"HOLD","tot":"str"},{"t":"set","p":"ui_update.buttonColor","pt":"msg","to":"red","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":5300,"y":690,"wires":[["020352927c165a64"]]},{"id":"a888ea107ac7f3bb","type":"debug","z":"b39000460508d582","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":5680,"y":650,"wires":[]},{"id":"6f4a6f88bfbb219b","type":"ui-group","name":"Group 1","page":"b9b507aa5c5840c2","width":"10","height":1,"order":1,"showTitle":false,"className":"","visible":true,"disabled":"false","groupType":"default"},{"id":"b9b507aa5c5840c2","type":"ui-page","name":"Down/Up load speed tester","ui":"379027033ed5c83a","path":"/page1","icon":"home","layout":"flex","theme":"84a68e3f4c6f8cdc","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":1,"className":"","visible":true,"disabled":false},{"id":"379027033ed5c83a","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true,"allowInstall":true},{"id":"84a68e3f4c6f8cdc","type":"ui-theme","name":"Default Theme","colors":{"surface":"#63452c","primary":"#0094ce","bgPage":"#63452c","groupBg":"#63452c","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

Showing the problem:
This is all good.

I press the Pass button just to the left of where Test is.

A slightly modified script to the one that breaks.

It just adds some text injection too.

[{"id":"402169a8.8a791","type":"subflow","name":"B Toggle 2","info":"2025 07 31\n==========\nForgot to add msg2 to update status of node\n\n2025 06 07\n==========\nNEEDS WORK!\nChange `RELOAD` to `RESET`\nChanged to `RESET`, but old code left in\nfor backward compatability.\nPLEAES UPDATE CODE TO NEW COMMAND\n\n\n2024 02 06\n==\nFurther update:\n`msg.enabled = true` and `msg.payload = X` will ENABLE the button node.\n`msg.enabled = false` and `msg.payload = X` will DISABLE the button node.\nbut please noted `msg.payload` has to be `X` also!\n\n2023 12 20\n==\nRe-write code to allow force reloading of desired state.\n\nToggle output at receipt of message.\nConfigurable output and message to send back to button node.\n(2022 12 16)\n\nIf `msg.payload == 0` (number) the output is forced to the OFF condition.\n\nIf `msg.payload == 1` (number) the output is forced to the ON condition.\n\nIf `msg.payload == \"RELOAD\"` (text) the output is set to what you determined in the\n                             `StartMode` value.\n\nIf `msg.payload == \"RESEND\"` the current condition is resent to the output.\n(Handy if button mode is wiped with deploy)\n\nAny other input toggles the output.\n\n## ENV variables:\n```\nStartMode - set start condition (`0` off `1` on).\nOnCLR - the colour when ON condition active.\nOnTXT - the text when ON condition active.\nOffCLR - the colour when OFF condition active.\nOffTXT - the text when OFF conditin active.\nON - payload when ON condition active.\nOFF - payload when OFF condition active.\nCTOPIC - the topic of the output message.\n```\n\nOutputs:\n - 1 $OFF for OFF and $ON for ON.\n - 2 $ON for OFF and $OFF for ON.  (Opposite of 1)\n - 3 to be sent back to button with `msg.colour` to set buttons colour and `msg.txt` for the text to be displayed.\n","category":"","in":[{"x":140,"y":190,"wires":[{"id":"69ae694095adea75"}]}],"out":[{"x":860,"y":180,"wires":[{"id":"5a9848b4303ef8d2","port":0},{"id":"8c41e6c213bcdefe","port":0}]},{"x":860,"y":280,"wires":[{"id":"3a564786d2308bdd","port":0},{"id":"a2ec504194f78107","port":0}]},{"x":860,"y":380,"wires":[{"id":"f14d0daf4ad33691","port":0},{"id":"aff48be4199bcfab","port":0},{"id":"69ae694095adea75","port":1}]}],"env":[{"name":"StartMode","type":"num","value":"","ui":{"label":{"en-US":"Start Mode (0/1) (off/on)"},"type":"input","opts":{"types":["num"]}}},{"name":"OffTXT","type":"str","value":"","ui":{"type":"input","opts":{"types":["str","num"]}}},{"name":"OffCLR","type":"str","value":"","ui":{"type":"input","opts":{"types":["str"]}}},{"name":"OnTXT","type":"str","value":"","ui":{"type":"input","opts":{"types":["str","num"]}}},{"name":"OnCLR","type":"str","value":"","ui":{"type":"input","opts":{"types":["str"]}}},{"name":"OFF","type":"str","value":""},{"name":"ON","type":"str","value":""},{"name":"CTOPIC","type":"str","value":""}],"meta":{"desc":"Button toggle node with feedback to button"},"color":"#D8BFD8","outputLabels":["Normal output","Inverted output","To button"],"icon":"node-red-dashboard/ui_switch.png","status":{"x":860,"y":490,"wires":[{"id":"a5b2ad35ad8518e2","port":0}]}},{"id":"69ae694095adea75","type":"function","z":"402169a8.8a791","name":"toggle","func":"let a = msg.payload\nlet msg1 = {}\nlet msg2 = {}       //  STATUS\nlet x = context.get(\"counter\") || 0\n\nif (msg.enabled != undefined)\n{\n    //      Work to be done here.\n    const en = msg.enabled\n    if (en == true)\n    {\n        //   ENABLE\n        node.warn(\"Enabled = true\")\n        context.set(\"disabled\",0)\n        a = \"RESEND\"\n    }\n    else\n    if (en == false)\n    {\n        //    DISABLE\n        node.warn(\"Enabled = false\")\n        context.set(\"disabled\",1)\n        //msg1.txt = \"disabled\"\n        msg1.txt = '<font color = \"red\"><i class=\"fa fa-ban fa-3x\"></i></font>'\n        msg1.colour = env.get(\"OffCLR\")\n        //node.status({text:\"DISABLED\"})\n        msg2.payload = { \"text\":\"DISABLED\" }\n        return [null,msg1,msg2]\n    }\n}\n\nif (context.get(\"disabled\") == 1)\n{\n    //  Can't do anything.\n    //node.status({text:\"skipped\"})\n    msg2.payload = {\"payload\":\"skipped\"}\n    return[null,null,msg2]\n}\n\nif (a == \"RESET\")\n{\n    a = env.get(\"StartMode\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\n//      2025 06 07\n///     OLD CODE.   To be deleted ASAP\nif (a == \"RELOAD\")\n{\n    a = env.get(\"StartMode\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\nif (a == \"RESEND\")\n{\n    a = context.get(\"counter\")\n    context.set(\"counter\", a)\n    msg.payload = a\n}\n\nif (a == 0)\n{\n//    context.set(\"counter\",0)\n//    msg.payload = 0\n    //node.status({text:\"Force OFF\"})\n    msg2.payload = {\"text\":\"Force OFF\"}\n    return [msg,null,msg2]\n}\nif (a == 1)\n{\n    //node.status({ text: \"Force ON\" })\n    msg2.payload = {\"text\":\"Force ON\"}\n    return [msg,null,msg2]\n}\n\nif (x === 0)\n{\n    msg.payload = 1\n    //node.status({ text: \"ON\" })\n    msg2.payload = { \"text\": \"ON\" }\n} else\nif (x === 1)\n{\n    msg.payload = 0\n    //node.status({ text: \"OFF\" })\n    msg2.payload = { \"text\": \"OFF\" }\n}\n\nx = (x + 1) % 2\n\ncontext.set(\"counter\",x)\n\nreturn [msg,null,msg2]","outputs":3,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":190,"wires":[["0db7c2da3958ea2c"],[],["a5b2ad35ad8518e2"]],"outputLabels":["output","output inverted","status"],"info":"##  Outputs `1` or `0` for ON/OFF and `msg.colour` to send to button."},{"id":"f14d0daf4ad33691","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"colour","pt":"msg","to":"OffCLR","tot":"env"},{"t":"set","p":"txt","pt":"msg","to":"OffTXT","tot":"env","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":350,"wires":[[]]},{"id":"aff48be4199bcfab","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"colour","pt":"msg","to":"OnCLR","tot":"env"},{"t":"set","p":"txt","pt":"msg","to":"OnTXT","tot":"env","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":410,"wires":[[]]},{"id":"0db7c2da3958ea2c","type":"switch","z":"402169a8.8a791","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":540,"y":190,"wires":[["5a9848b4303ef8d2","3a564786d2308bdd","f14d0daf4ad33691"],["8c41e6c213bcdefe","a2ec504194f78107","aff48be4199bcfab"]]},{"id":"5a9848b4303ef8d2","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":160,"wires":[[]]},{"id":"8c41e6c213bcdefe","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":210,"wires":[[]]},{"id":"a2ec504194f78107","type":"change","z":"402169a8.8a791","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":300,"wires":[[]]},{"id":"3a564786d2308bdd","type":"change","z":"402169a8.8a791","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"env"},{"t":"set","p":"topic","pt":"msg","to":"CTOPIC","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":250,"wires":[[]]},{"id":"a035346e85f036ba","type":"inject","z":"402169a8.8a791","name":"Start Mode","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"","payload":"StartMode","payloadType":"env","x":190,"y":140,"wires":[["69ae694095adea75"]]},{"id":"a5b2ad35ad8518e2","type":"junction","z":"402169a8.8a791","x":650,"y":490,"wires":[[]]},{"id":"93fb80fe63634587","type":"inject","z":"b39000460508d582","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"X","payloadType":"str","x":5520,"y":490,"wires":[["fc1b87d32a19ece6"]]},{"id":"fc1b87d32a19ece6","type":"subflow:402169a8.8a791","z":"b39000460508d582","name":"","env":[{"name":"StartMode","value":"1","type":"num"},{"name":"OffTXT","value":"HOLD","type":"str"},{"name":"OffCLR","value":"red","type":"str"},{"name":"OnTXT","value":"PASS","type":"str"},{"name":"OnCLR","value":"green","type":"str"},{"name":"OFF","value":"close","type":"str"},{"name":"ON","value":"open","type":"str"},{"name":"CTOPIC","value":"control","type":"str"}],"x":5695,"y":490,"wires":[["054dc0465cbdc6b9","0533dbcbf8e77a7a"],[],["03e108143aa23ce0","500994344ea0c0cb"]],"inputLabels":["from HOLD button"],"l":false},{"id":"020352927c165a64","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"Hold","label":"","order":10,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"X","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":5480,"y":650,"wires":[["a888ea107ac7f3bb","fc1b87d32a19ece6"]]},{"id":"054dc0465cbdc6b9","type":"gate","z":"b39000460508d582","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":5820,"y":550,"wires":[["d356048ed30c9e9a"]]},{"id":"0533dbcbf8e77a7a","type":"switch","z":"b39000460508d582","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":5785,"y":510,"wires":[["3ba6151acfca02e4"]],"l":false},{"id":"03e108143aa23ce0","type":"debug","z":"b39000460508d582","name":"debug 34","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":5860,"y":430,"wires":[]},{"id":"500994344ea0c0cb","type":"switch","z":"b39000460508d582","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":5205,"y":660,"wires":[["9ac368e01da4aa5f"],["e00e37f0d00a65c8"]],"l":false},{"id":"9ac368e01da4aa5f","type":"change","z":"b39000460508d582","name":"Normal","rules":[{"t":"set","p":"ui_update.label","pt":"msg","to":"PASS","tot":"str"},{"t":"set","p":"ui_update.buttonColor","pt":"msg","to":"blue","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":5310,"y":650,"wires":[["020352927c165a64"]]},{"id":"e00e37f0d00a65c8","type":"change","z":"b39000460508d582","name":"Hold","rules":[{"t":"set","p":"ui_update.label","pt":"msg","to":"HOLD","tot":"str"},{"t":"set","p":"ui_update.buttonColor","pt":"msg","to":"red","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":5300,"y":690,"wires":[["020352927c165a64"]]},{"id":"a888ea107ac7f3bb","type":"debug","z":"b39000460508d582","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":5680,"y":650,"wires":[]},{"id":"3ad8ee846db55472","type":"trigger","z":"b39000460508d582","name":"","op1":"","op2":" ","op1type":"nul","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":5695,"y":550,"wires":[["054dc0465cbdc6b9"]],"l":false},{"id":"d356048ed30c9e9a","type":"junction","z":"b39000460508d582","x":5950,"y":600,"wires":[["52ba28d889a8d6fb"]]},{"id":"3ba6151acfca02e4","type":"change","z":"b39000460508d582","name":"blank","rules":[{"t":"set","p":"payload","pt":"msg","to":" ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":5855,"y":510,"wires":[["d356048ed30c9e9a"]],"l":false},{"id":"1e9960df0ae08524","type":"junction","z":"b39000460508d582","x":5640,"y":600,"wires":[["3ad8ee846db55472","d356048ed30c9e9a"]]},{"id":"52ba28d889a8d6fb","type":"ui-text","z":"b39000460508d582","group":"6f4a6f88bfbb219b","order":12,"width":"2","height":"1","name":"","label":"Test","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":6110,"y":600,"wires":[]},{"id":"e62ae55b7805711e","type":"inject","z":"b39000460508d582","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Test message","payloadType":"str","x":5460,"y":600,"wires":[["1e9960df0ae08524"]]},{"id":"82707be85485aa4f","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"Message","label":"Inject","order":11,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"Test message","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":5490,"y":550,"wires":[["1e9960df0ae08524"]]},{"id":"6f4a6f88bfbb219b","type":"ui-group","name":"Group 1","page":"b9b507aa5c5840c2","width":"10","height":1,"order":1,"showTitle":false,"className":"","visible":true,"disabled":"false","groupType":"default"},{"id":"b9b507aa5c5840c2","type":"ui-page","name":"Down/Up load speed tester","ui":"379027033ed5c83a","path":"/page1","icon":"home","layout":"flex","theme":"84a68e3f4c6f8cdc","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":1,"className":"","visible":true,"disabled":false},{"id":"379027033ed5c83a","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true,"allowInstall":true},{"id":"84a68e3f4c6f8cdc","type":"ui-theme","name":"Default Theme","colors":{"surface":"#63452c","primary":"#0094ce","bgPage":"#63452c","groupBg":"#63452c","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

Start:

Press the inject node.

Press the PASS node.
See how the text changes.

Press the inject node.

Alas I don't share your enthusiasm for subflows so I'm having trouble working out what the flow does.

However, the label of the Text node "Test" is changed by the message from your Change node "Hold", which sets ui_update.label to HOLD and ui_update.buttonColor to red.

Once the label is changed to HOLD, that's how it stays because there is no other ui_update.label.

Do you want the label or the value to change to HOLD?
If it's the label, you will have to reset it when that status is no longer relevant.

1 Like

Thanks. That is interesting what you said.

I thought that the ui_update.label was for that button/node.
Not the whole enchilada (Spanish food)

I'll dig around and see if I can get a bitter picture of what is happening.

THANKS!