I use Template UI node a lot
and instead of entering code directly, I sometimes like to feed it from the Template node:
Sometimes I will like to put the Template node (the brown one) into a subflow along with some function nodes, so it can be re-used with multiple instances. The Template UI node (cyan colour) must stay outside of the subflow, so I can set the location of the template node (i.e. where it lives on the Dashboard):
I have done this quite a lot in the past and I have existing ones that work fine. But the one I just created now has a problem. It doesn't show on the dasboard. Well, sometimes it shows, but when I refresh the page, it disappears. Sometimes I can get it to show again by removing connections between nodes, and re-adding them, and hitting deploy. Then it shows on the dashboard, but again disappears when I refresh the dash. And then it stays gone and won't come back again.
(Note this happens when I use a subflow AND when I don't use a subflow.)
I have posted the example here, I wonder if someone can replicate the problem?
[{"id":"3d8b6d50.81d902","type":"subflow","name":"Multisensor","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"51791c41.49b794"}]}],"out":[{"x":700,"y":80,"wires":[{"id":"6d74ffdf.4d7e1","port":0}]}],"env":[{"name":"sensorid","type":"str","value":""}],"meta":{},"color":"#DDAA99"},{"id":"51791c41.49b794","type":"function","z":"3d8b6d50.81d902","name":"","func":"if (typeof msg.payload.Switch1.Action != undefined) {\n if (msg.payload.Switch1.Action == \"ON\") {\n // PIR on\n \n } else if (msg.payload.Switch1.Action == \"OFF\") {\n // PIR off\n \n }\n} \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":80,"wires":[["6d74ffdf.4d7e1"]]},{"id":"6d74ffdf.4d7e1","type":"template","z":"3d8b6d50.81d902","name":"Sensor UI","field":"template","fieldType":"msg","format":"handlebars","syntax":"plain","template":"<style>\n input {\n width:150px;\n margin:0 22px 0 0;\n display:inline;\n border-color: #eeeeee;\n color: #eeeeee;\n border-bottom-width: 1px;\n font-family: inherit;\n background: none;\n padding: 2px 2px 1px;\n border-width: 0 0 1px;\n line-height: 26px;\n height: 40px;\n -ms-flex-preferred-size: 26px;\n border-radius: 0;\n border-style: solid;\n box-sizing: border-box;\n float: left;\n }\n md-select span {\n color:#eee;\n }\n md-select .md-select-value.md-select-placeholder {\n border-bottom-color: #eee;\n }\n .md-select-value .md-select-icon:after {\n border-bottom-color: #eee;\n color:#eee;\n }\n md-select.md-default-theme .md-select-value, md-select .md-select-value {\n border-bottom-color: #eee;\n }\n md-select.md-default-theme:not([disabled]):focus .md-select-value, md-select:not([disabled]):focus .md-select-value {\n border-bottom-color: #0eb8c0;\n border-bottom-width: 1px;\n }\n .md-button {\n height:38px;\n }\n .md-container {\n }\n .sensorbutton {\n display:inline !important;\n padding:0px;height:38px !important;\n width:85px;\n margin:0 6px 0 0 !important;\n background-color: #3b3b3b !important;\n }\n .triggered {\n border-width:2px !important;\n border-style:solid !important;\n }\n .pir {\n background-color:rgb(33, 109, 55) !important;\n border-color:rgb(99,200,100);\n border-style: none;\n }\n .microwave {\n background-color:rgb(134, 54, 54) !important;\n border-color:rgb(241, 110, 110);\n border-style: none;\n }\n .audiotrig {\n background-color:rgb(153, 71, 0) !important;\n border-color:rgb(244, 152, 73);\n border-style: none;\n }\n .audioextend {\n background-color:rgb(153, 144, 0) !important;\n border-color:rgb(236,228,99);\n border-style: none;\n }\n .leds {\n background: -webkit-linear-gradient(left, orange , yellow, green, cyan, blue, violet); /* For Safari 5.1 to 6.0 */\n background: -o-linear-gradient(right, orange, yellow, green, cyan, blue, violet); /* For Opera 11.1 to 12.0 */\n background: -moz-linear-gradient(right, orange, yellow, green, cyan, blue, violet); /* For Firefox 3.6 to 15 */\n background: linear-gradient(to right, #a52a2a, #ff8c00, #006400); /* Standard syntax (must be last) */\n }\n .control-row {\n display:inline-flex; margin: 10px 0 10px 0\n }\n\n</style>\n\n<!--New Scene-->\n<div class=\"control-row\">\n <!-- classes as follows: sensorbutton is a button. pir/microwave/etc lights it up. triggered gives it a border -->\n <md-button class=\"sensorbutton pir triggered\" ng-click=\"send({action: 'toggle_arm_pir', sensorid: msg.sensorid})\">PIR</md-button>\n <md-button class=\"sensorbutton microwave triggered\" ng-click=\"send({action: 'toggle_arm_microwave', sensorid: msg.sensorid})\">Micro</md-button>\n <md-button class=\"sensorbutton audiotrig triggered\" ng-click=\"send({action: 'toggle_arm_audiotrig', sensorid: msg.sensorid})\">Aud Trig</md-button>\n <md-button class=\"sensorbutton audioextend triggered\" ng-click=\"send({action: 'toggle_arm_audioextend', sensorid: msg.sensorid})\">Aud Ext</md-button>\n <md-button class=\"sensorbutton leds triggered\" ng-click=\"send({action: 'toggle_arm_leds', sensorid: msg.sensorid})\">LEDS</md-button>\n</div>\n\n\n<div class=\"slider-container\">\n \n</div>\n","output":"str","x":520,"y":80,"wires":[[]]},{"id":"c25b3610.bca118","type":"subflow:3d8b6d50.81d902","z":"a0c2f06d.bcd7a","name":"","env":[{"name":"sensorid","value":"multisensor-003","type":"str"},{"name":"zonename","value":"3f_bedroom","type":"str"}],"x":750,"y":780,"wires":[["4b825b88.78ecf4"]]},{"id":"4b825b88.78ecf4","type":"ui_template","z":"a0c2f06d.bcd7a","group":"363d1eb5.19b652","name":"","order":13,"width":0,"height":0,"format":"","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":900,"y":780,"wires":[[]]},{"id":"26b3f65a.a8338a","type":"inject","z":"a0c2f06d.bcd7a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":".1","topic":"","payload":"","payloadType":"date","x":590,"y":780,"wires":[["c25b3610.bca118"]]},{"id":"363d1eb5.19b652","type":"ui_group","name":"Sense","tab":"79f7425a.a73e1c","order":3,"disp":true,"width":"6","collapse":false},{"id":"79f7425a.a73e1c","type":"ui_tab","name":"Bedroom","icon":"dashboard","order":2}]