Silly me, I forgot to paste the flow I wrote.
[{"id":"fbc0b791.beb0b8","type":"inject","z":"8aae5d25.29cda","name":"BUTTON NODE","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":780,"wires":[["617bd3ee.854e0c"]]},{"id":"617bd3ee.854e0c","type":"function","z":"8aae5d25.29cda","name":"","func":"// Modify the `false` and `true` to what works\nlet x = context.get(\"count\") || 0;\nif (x === 0)\n{\n msg.payload = false;\n} else\nif (x === 1)\n{\n msg.payload = true;\n}\nx = (x + 1) % 2;\ncontext.set(\"count\",x);\n\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":780,"wires":[["8909dca0.245bf"]]},{"id":"8909dca0.245bf","type":"debug","z":"8aae5d25.29cda","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":730,"wires":[]}]
The button
node and the inject
node are the same in that they send a message when you press them.
The switch
node (dashboard) sends one of two messages, depending on where the switch is.
I think you are confusing yourself with what you want and how to do it.
The flow I have now just posted is a BASIC one. It can be made a lot more fancy and the button also indicate the state of the LED.
That isn't what you asked for.
Try the flow I just posted and explain what is wrong with it.