@Jpsy I was so glad to find your solution, but it doesn't work. I explicitely copied your code. What I have in my subflow:
// show status message at subflow node
let value = msg.payload === true ? "on" : "off";
let statusMsg = { fill:"green", shape:"dot", text:"Automatic: "+ value };
return {payload:statusMsg};
This is a working code in the case of getting my on/off result out of the subflow. But no status message and no output on "output 3".
What i find out:
I copied the flow out of subflow in a testflow. Of course I got an additional button on the dashboard. Using original switch, nothing happens as before. But if I use the new switch (from outside the subflow) I get also the message and status out of the subflow!?
I'm confused? What's wrong? Is it not allowed to use dashboard nodes inside subflows??
Here the whole subflow, but it need the gate-node:
[{"id":"bf2492af.6b49a8","type":"subflow","name":"invert boolean","info":"","category":"","in":[{"x":40,"y":80,"wires":[{"id":"9e8c468b.c1fd98"}]}],"out":[{"x":360,"y":80,"wires":[{"id":"9e8c468b.c1fd98","port":0}]}],"env":[],"meta":{},"color":"#DDAA99"},{"id":"9e8c468b.c1fd98","type":"function","z":"bf2492af.6b49a8","name":"invert boolean","func":"msg.payload = !msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":200,"y":80,"wires":[[]],"info":"Invertiert den boolschen Wert am Eingang"},{"id":"349f3267.282b16","type":"subflow","name":"auto on/off","info":"","category":"","in":[{"x":60,"y":420,"wires":[{"id":"e7642ff8.6ecc6"},{"id":"8050d627.fe0958"}]}],"out":[{"x":860,"y":360,"wires":[{"id":"196bf120.478bff","port":0}]},{"x":860,"y":420,"wires":[{"id":"8050d627.fe0958","port":0}]},{"x":840,"y":80,"wires":[{"id":"5bfd9175.e4ebb8","port":0}]}],"env":[],"meta":{},"color":"#DDAA99","status":{"x":840,"y":40,"wires":[{"id":"89b32369.7cf2a","port":0}]}},{"id":"150dfb6.a90a385","type":"ui_switch","z":"349f3267.282b16","name":"","label":"A-Boiler on/off","tooltip":"","group":"c14af889.9a4db","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"switch","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":440,"y":300,"wires":[["196bf120.478bff"]]},{"id":"5bfd9175.e4ebb8","type":"ui_switch","z":"349f3267.282b16","name":"","label":"Automatic mode","tooltip":"","group":"c14af889.9a4db","order":4,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"switch","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":160,"y":80,"wires":[["f3016ff7.47c398","6b7ffefc.0e89f8","36de4653.d2419a","89b32369.7cf2a"]]},{"id":"e3435a58.cf6b4","type":"change","z":"349f3267.282b16","name":"control switch","rules":[{"t":"set","p":"enabled","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":240,"wires":[["150dfb6.a90a385"]],"info":"Enable/disable switch and control on/off\n\n**Enable** when `automatic == off` \n**Disable** when `automatic == on` \n\nSet **switch ON**, when `automatic == off` \nSet **switch OFF**, when `automatic == on`"},{"id":"8050d627.fe0958","type":"jvmg_gate","z":"349f3267.282b16","name":"Boiler automatic","default":true,"trigger":"a94dd678.e92fe8","x":700,"y":420,"wires":[[]]},{"id":"196bf120.478bff","type":"jvmg_gate","z":"349f3267.282b16","name":"Boiler Manual","default":true,"trigger":"7efb2b1d.1838e4","x":700,"y":360,"wires":[[]]},{"id":"f3016ff7.47c398","type":"jvmg_key","z":"349f3267.282b16","name":"Automatic control","trigger":"a94dd678.e92fe8","x":690,"y":140,"wires":[]},{"id":"1ee5b905.b843df","type":"jvmg_key","z":"349f3267.282b16","name":"Manual control","trigger":"7efb2b1d.1838e4","x":680,"y":200,"wires":[]},{"id":"6b7ffefc.0e89f8","type":"subflow:bf2492af.6b49a8","z":"349f3267.282b16","name":"","env":[],"x":440,"y":180,"wires":[["1ee5b905.b843df","e3435a58.cf6b4"]]},{"id":"e7642ff8.6ecc6","type":"function","z":"349f3267.282b16","name":"latch","func":"\nif (msg.payload === 'repeat') {\n msg.payload = context.get(\"lastValue\");\n msg.topic = 'repeat'\n} else {\n context.set(\"lastValue\",msg.payload);\n}\nnode.status({text:msg.payload});\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Der Code hier wird ausgefĂźhrt,\n// wenn der Node gestartet wird\n\ncontext.set(\"lastValue\",false);","finalize":"","libs":[],"x":410,"y":360,"wires":[["8050d627.fe0958"]],"info":"\n\nSave the last value in a context variable. \nIf keyword 'repeat' received, this lase value will be send again."},{"id":"36de4653.d2419a","type":"switch","z":"349f3267.282b16","name":"if true","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":210,"y":240,"wires":[["4b0ce538.4978cc"]]},{"id":"4b0ce538.4978cc","type":"change","z":"349f3267.282b16","name":"send 'repeat'","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"repeat","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":320,"wires":[["e7642ff8.6ecc6"]]},{"id":"89b32369.7cf2a","type":"function","z":"349f3267.282b16","name":"","func":"// show status message at subflow node\nlet value = msg.payload === true ? \"on\" : \"off\";\nlet statusMsg = { fill:\"green\", shape:\"dot\", text:\"Automatic: \"+ value };\n\nreturn {payload:statusMsg};\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":40,"wires":[[]]},{"id":"c14af889.9a4db","type":"ui_group","name":"Ute","tab":"297873db.981d0c","order":1,"disp":true,"width":"6","collapse":false},{"id":"a94dd678.e92fe8","type":"jvmg_trigger","trigger":"Automatic"},{"id":"7efb2b1d.1838e4","type":"jvmg_trigger","trigger":"Manual"},{"id":"297873db.981d0c","type":"ui_tab","name":"Sonoff","icon":"dashboard","disabled":false,"hidden":false}]