Node-RED version: v2.0.6
Node.js version: v14.16.0
Darwin 20.6.0 x64 LE
Dashboard version 3.0.4
if you have a ui-button
with If msg arrives on input, emulate a button click:
checked on, and msg's arrive without a msg.payload, no output will exit the ui-button
node. But, once a msg with a msg.payload enters the ui-button
node, subsequent msg's without a msg.payload WILL generate a msg out of the ui-button
node.
The attached flow demonstraits the issue. Once msgs start flowing thru the ui-button
to recreate it, you have to stop/start Node-RED.
[{"id":"421b3dc8.1f3514","type":"ui_button","z":"29cdd42fc9595d19","name":"Case - emulate button click on","group":"7427e564.9f901c","order":1,"width":0,"height":0,"passthru":true,"label":"{{label}}","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"testing","payloadType":"str","topic":"","topicType":"str","x":450,"y":280,"wires":[["c13d6a6f.5650f"]]},{"id":"c13d6a6f.5650f","type":"debug","z":"29cdd42fc9595d19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":280,"wires":[]},{"id":"fcfa3931ade2d7e7","type":"inject","z":"29cdd42fc9595d19","name":"","props":[{"p":"label","v":"Case 2","vt":"str"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Has 'payload'","payload":"test","payloadType":"str","x":170,"y":300,"wires":[["421b3dc8.1f3514"]]},{"id":"f4c855ece15032a3","type":"inject","z":"29cdd42fc9595d19","name":"No 'payload'","props":[{"p":"label","v":"Case 2","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"No 'payload'","x":150,"y":240,"wires":[["421b3dc8.1f3514"]]},{"id":"bc7bb28fbafb1c5c","type":"comment","z":"29cdd42fc9595d19","name":"If first inject does not have a payload nothing comes out of ui-button","info":"","x":300,"y":60,"wires":[]},{"id":"f627c147286d39c5","type":"comment","z":"29cdd42fc9595d19","name":"BUT once a msg.payload enters the ui-button, the ui-button starts return a msg.","info":"","x":340,"y":100,"wires":[]},{"id":"6bd2e16122808b90","type":"comment","z":"29cdd42fc9595d19","name":"NOTE: this only happens utill a msg.payload is received. then to recreate it you have to stop/start Node-RED","info":"","x":430,"y":180,"wires":[]},{"id":"dd12d7a73e10ef96","type":"comment","z":"29cdd42fc9595d19","name":"Now the inject without a payload to the ui-button starts returning msg.","info":"","x":310,"y":140,"wires":[]},{"id":"7427e564.9f901c","type":"ui_group","name":"Default","tab":"d668501e.c0f0b8","order":1,"disp":true,"width":"6","collapse":false},{"id":"d668501e.c0f0b8","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
@dceejay shall I open an issue?