Ui template toggle switches

Thanks, but in this flow I am still not getting an output from the switch template (i.e. when I inject the defaults those commands are needed on the output of the switch template).

Also, don't quite understand all of the new functionality - the ui control node with two change nodes, the two functions setting flow data? The single UI template node was basically working, except for the issue of generating duplicate messages, which you mentioned you were able to address a few iterations ago? Sorry if I was unclear on something ..

The flow functions like this:

  1. The values of your switches are backuped server side by flow.data

  2. Every toggle switch is initialized by browser load or tab change. For this ui-control node sends a change message. A serialized change node reads the flow.data before reaching the ui-template-node. Every open browser will get an initialization with actual data from server side when it's needed.

  3. The ui-template node has a watch-function for messages. It sets the messages payload to the scope.data if the topic is 'change' or 'switch'.

  4. scope.data is the data-model of the toggle switches and this way they show the new value.

  5. If the switches are remotable triggered then the data is first written to flow.data and then dispatched to ui-template node (every open browser).

  6. If someone clicks a toggle switch then the browser sends the new data. On server side it is written to flow.data and then dispatched to all open browsers to get these synchronized.

How the watch function in ui-template works:

scope.$watch('msg', function(msg1, msg2) {...})

The first time you open your page in a browser the watch function is triggered. It gets only one parameter msg1. This message is the last one which reached the ui-template node. The next time the watch function is triggered its a new message. Then msg1 holds the new message and msg2 holds the one received before.

Your duplicate outputs were triggered by the first message when opening your page.

To get rid of this I connected an ui-control node to your ui-template node. It triggers a message when opening your page and then you can be shure that relevant information alwas has a msg2 parameter. It's filtered by:

 if (msg1 !== undefined && msg1 !== null && msg2 !== undefined){...}

Thank you for the explanation. Just to clarify, was the browser load / tab change function added just to deal with duplicate messages (which was the only issue with the earlier version) and this entire configuration is necessary for proper functionality? There is still no output when triggered programmatically.

I wonder if there is a misunderstanding of my use case. Originally I was simply using a bunch of standard node toggle switches (which worked as I needed them). The reason I wanted to implement a UI template version was to simply have more control over design - combine many switches into a small panel, CSS, and simplify the flow.

This is the function that was processing the switch output states. At this point I am confused which version I should use...

msgBSend = {};  msgBGate = {}; msgGSend = {};  msgGGate = {}; msgS = {}; msgCGate = {};

msgBGate.topic = "control"
msgGGate.topic = "control"
msgCGate.topic = "control"

if (msg.payload.b == "on") {

msgBSend.payload = "alwaysResendValue"
msgBSend.resend_force = true
msgBSend.resend_ignore = false
msgBSend.resend_interval = parseFloat(flow.get('freq'))*60

msgBGate.payload = "queue"


} else 

if (msg.payload.b == "off") {

msgBSend.resend_messages = false
msgBSend.resend_ignore = true

msgBGate.payload = "close"


} else 

if (msg.payload.g == "on") {

msgGSend.payload = "alwaysResendValue"
msgGSend.resend_force = true
msgGSend.resend_ignore = false
msgGSend.resend_interval = parseFloat(flow.get('freq'))*60

msgGGate.payload = "queue"


} else 

if (msg.payload.g == "off") {

msgGSend.resend_messages = false
msgGSend.resend_ignore = true

msgGGate.payload = "close"


} else

if (msg.payload.s == "on") {

msgS.payload = true

} else if 

(msg.payload.s == "off") {

msgS.payload = false


} else if 

(msg.payload.c == "on") {

msgCGate.payload = "open"

} else if 

(msg.payload.c == "off") {

msgCGate.payload = "close"

}

return [msgBSend, msgBGate, msgGSend, msgGGate, msgS, msgCGate];




Oh I see, perhaps I thought to complicated. I think it's like that:

[
    {
        "id": "ee8099c2e47c91c1",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "2b60c3632b00a3c1",
        "type": "ui_template",
        "z": "ee8099c2e47c91c1",
        "group": "589e25a60e4fbcd4",
        "name": "3 Switches",
        "order": 1,
        "width": 0,
        "height": 0,
        "format": "<style>\n    .sw md-switch.md-checked .md-thumb-container {\n        transform: none !important;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch.md-checked:not([disabled]) .md-thumb {\n        background-color: #ccc;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-bar .myswitch {\n        background-color: rgba(111, 111, 111, 0.5);\n        display: none;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch.md-checked:not([disabled]) .md-thumb {\n        background-color: #609f70;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-bar {\n        background-color: rgba(111, 111, 111, 0.5);\n        display: none;\n    }\n\n    .sw md-switch .md-container {\n        margin-right: 3px;\n        width: 25px;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-thumb {\n        background-color: red;\n    }\n\n    md-switch {\n        align-items: center;\n        height: 30px;\n        line-height: 18px;\n        margin: 0px;\n        margin-left: inherit;\n        margin-right: 16px;\n    }\n\n    .sw md-switch .md-label {\n        font-size: 13px;\n        color: #728faa;\n        letter-spacing: 1px;\n        font-weight: bold;\n    }\n\n    md-switch .md-thumb .md-ripple-container {\n        display: none;\n    }\n</style>\n\n<div class=\"sw\" style=\"margin-top: 1px\" layout=\"row\">\n    <div style=\"margin-left: 7px\" ng-cloak>\n        <md-switch id=\"C\" ng-model=\"data.c\" aria-label=\"C\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('c')\">C</md-switch>\n    </div>\n    <div style=\"margin-left: 7px\" ng-cloak>\n        <md-switch id=\"B\" ng-model=\"data.b\" aria-label=\"B\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('b')\">B</md-switch>\n    </div>\n    <div style=\"margin-left: 5px\" ng-cloak>\n        <md-switch id=\"G\" ng-model=\"data.g\" aria-label=\"G\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('g')\">G</md-switch>\n    </div>\n    <div style=\"margin-left: 15px\" ng-cloak>\n        <md-switch id=\"S\" ng-model=\"data.s\" aria-label=\"G\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('s')\">SIM</md-switch>\n    </div>\n\n</div>\n\n<script>\n    (function(scope) {\n        scope.data = {\n            c: 'off',\n            b: 'off',\n            g: 'off',\n            s: 'off'\n        };\n\n        scope.onChange = function(key) {\n            scope.send({topic:'switch', payload:scope.data, switch:key, value:scope.data[key]});\n        };\n        \n        //handle arriving messages\n        scope.$watch('msg', function(msg) {\n            if(msg !== undefined && msg !== null){\n                try{\n                    switch(msg.topic) {\n                        case \"switch\":\n                            scope.data = msg.payload;\n                            break;\n                        default:\n                            break;\n                    }\n                }catch(err){\n                    console.error(err);\n                }\n            }\n        });\n    })(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 870,
        "y": 460,
        "wires": [
            [
                "44d0a7ae835a5465"
            ]
        ]
    },
    {
        "id": "d1c52a884a979ca7",
        "type": "ui_button",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "group": "2cad8ed8b01011d8",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "button",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1630,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "d3b058c0990ce6de",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "Switch all",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "switch",
        "payload": "{\"c\":\"off\",\"b\":\"on\",\"g\":\"on\",\"s\":\"off\"}",
        "payloadType": "json",
        "x": 700,
        "y": 460,
        "wires": [
            [
                "2b60c3632b00a3c1"
            ]
        ]
    },
    {
        "id": "3d794b2f2131b5b4",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgBSend",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 360,
        "wires": []
    },
    {
        "id": "18b67b41f34d8625",
        "type": "function",
        "z": "ee8099c2e47c91c1",
        "name": "function 1",
        "func": "\nlet msgBSend = {}; \nlet msgBGate = {}; \nlet msgGSend = {}; \nlet msgGGate = {}; \nlet msgS = {}; \nlet msgCGate = {};\n\nmsgBGate.topic = \"control\"\nmsgGGate.topic = \"control\"\nmsgCGate.topic = \"control\"\n\nif (msg.payload.b == \"on\") {\n\n    msgBSend.payload = \"alwaysResendValue\"\n    msgBSend.resend_force = true\n    msgBSend.resend_ignore = false\n    msgBSend.resend_interval = parseFloat(flow.get('freq')) * 60\n\n    msgBGate.payload = \"queue\"\n\n\n} else\n\n    if (msg.payload.b == \"off\") {\n\n        msgBSend.resend_messages = false\n        msgBSend.resend_ignore = true\n\n        msgBGate.payload = \"close\"\n\n\n    } else\n\n        if (msg.payload.g == \"on\") {\n\n            msgGSend.payload = \"alwaysResendValue\"\n            msgGSend.resend_force = true\n            msgGSend.resend_ignore = false\n            msgGSend.resend_interval = parseFloat(flow.get('freq')) * 60\n\n            msgGGate.payload = \"queue\"\n\n\n        } else\n\n            if (msg.payload.g == \"off\") {\n\n                msgGSend.resend_messages = false\n                msgGSend.resend_ignore = true\n\n                msgGGate.payload = \"close\"\n\n\n            } else\n\n                if (msg.payload.s == \"on\") {\n\n                    msgS.payload = true\n\n                } else if\n\n                    (msg.payload.s == \"off\") {\n\n                    msgS.payload = false\n\n\n                } else if\n\n                    (msg.payload.c == \"on\") {\n\n                    msgCGate.payload = \"open\"\n\n                } else if\n\n                    (msg.payload.c == \"off\") {\n\n                    msgCGate.payload = \"close\"\n\n                }\n\nreturn [msgBSend, msgBGate, msgGSend, msgGGate, msgS, msgCGate];\n",
        "outputs": 6,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1180,
        "y": 460,
        "wires": [
            [
                "3d794b2f2131b5b4"
            ],
            [
                "e0905309cf9ffcb4"
            ],
            [
                "343330fb1acf23de"
            ],
            [
                "03fd276c98a1b3bb"
            ],
            [
                "68d9272c615d5471"
            ],
            [
                "078d4fc1e511e860"
            ]
        ]
    },
    {
        "id": "e0905309cf9ffcb4",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgBGate",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 400,
        "wires": []
    },
    {
        "id": "343330fb1acf23de",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgGSend",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 440,
        "wires": []
    },
    {
        "id": "03fd276c98a1b3bb",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgGGate",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 480,
        "wires": []
    },
    {
        "id": "68d9272c615d5471",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgS",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1390,
        "y": 520,
        "wires": []
    },
    {
        "id": "078d4fc1e511e860",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgCGate",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 560,
        "wires": []
    },
    {
        "id": "44d0a7ae835a5465",
        "type": "switch",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "switch",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 1030,
        "y": 460,
        "wires": [
            [
                "18b67b41f34d8625"
            ]
        ]
    },
    {
        "id": "589e25a60e4fbcd4",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "29d816a6f2669734",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "2cad8ed8b01011d8",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "fdade815ef4911c1",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "29d816a6f2669734",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    },
    {
        "id": "fdade815ef4911c1",
        "type": "ui_tab",
        "name": "Tab 2",
        "icon": "dashboard",
        "order": 2
    }
]

Thx, the outputs are all good ... but did you remove the ability to set switch states individually? In this last version if I am just sending "g": "on" all the other switches get turned off ?

It should be that:

[
    {
        "id": "ee8099c2e47c91c1",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "2b60c3632b00a3c1",
        "type": "ui_template",
        "z": "ee8099c2e47c91c1",
        "group": "589e25a60e4fbcd4",
        "name": "3 Switches",
        "order": 1,
        "width": 0,
        "height": 0,
        "format": "<style>\n    .sw md-switch.md-checked .md-thumb-container {\n        transform: none !important;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch.md-checked:not([disabled]) .md-thumb {\n        background-color: #ccc;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-bar .myswitch {\n        background-color: rgba(111, 111, 111, 0.5);\n        display: none;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch.md-checked:not([disabled]) .md-thumb {\n        background-color: #609f70;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-bar {\n        background-color: rgba(111, 111, 111, 0.5);\n        display: none;\n    }\n\n    .sw md-switch .md-container {\n        margin-right: 3px;\n        width: 25px;\n    }\n\n    .nr-dashboard-theme .nr-dashboard-template md-switch .md-thumb {\n        background-color: red;\n    }\n\n    md-switch {\n        align-items: center;\n        height: 30px;\n        line-height: 18px;\n        margin: 0px;\n        margin-left: inherit;\n        margin-right: 16px;\n    }\n\n    .sw md-switch .md-label {\n        font-size: 13px;\n        color: #728faa;\n        letter-spacing: 1px;\n        font-weight: bold;\n    }\n\n    md-switch .md-thumb .md-ripple-container {\n        display: none;\n    }\n</style>\n\n<div class=\"sw\" style=\"margin-top: 1px\" layout=\"row\">\n    <div style=\"margin-left: 7px\" ng-cloak>\n        <md-switch id=\"C\" ng-model=\"data.c\" aria-label=\"C\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('c')\">C</md-switch>\n    </div>\n    <div style=\"margin-left: 7px\" ng-cloak>\n        <md-switch id=\"B\" ng-model=\"data.b\" aria-label=\"B\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('b')\">B</md-switch>\n    </div>\n    <div style=\"margin-left: 5px\" ng-cloak>\n        <md-switch id=\"G\" ng-model=\"data.g\" aria-label=\"G\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('g')\">G</md-switch>\n    </div>\n    <div style=\"margin-left: 15px\" ng-cloak>\n        <md-switch id=\"S\" ng-model=\"data.s\" aria-label=\"G\" ng-true-value=\"'on'\" ng-false-value=\"'off'\"\n            ng-change=\"onChange('s')\">SIM</md-switch>\n    </div>\n\n</div>\n\n<script>\n    (function(scope) {\n        scope.data = {\n            c: 'off',\n            b: 'off',\n            g: 'off',\n            s: 'off'\n        };\n\n        scope.onChange = function(key) {\n            scope.send({topic:'switch', payload:scope.data, keys:[key]});\n        };\n        \n        //handle arriving messages\n        scope.$watch('msg', function(msg) {\n                if(msg !== undefined && msg !== null){\n                    try{\n                        switch(msg.topic) {\n                            case \"remote\":\n                                let keys = [];\n                                Object.keys(msg.payload).forEach((element)=>{\n                                    keys.push(element);\n                                    scope.data[element] = msg.payload[element];\n                                })\n                                scope.send({topic:'switch', payload:scope.data, keys:keys});\n                                break;\n                            case \"switch\":\n                                Object.keys(msg.payload).forEach((element)=>{\n                                    scope.data[element] = msg.payload[element];\n                                })\n                                break;\n                            default:\n                                break;\n                        }\n                    }catch(err){\n                        console.error(err);\n                    }\n                }\n        });\n    })(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 830,
        "y": 460,
        "wires": [
            [
                "44d0a7ae835a5465"
            ]
        ]
    },
    {
        "id": "d1c52a884a979ca7",
        "type": "ui_button",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "group": "2cad8ed8b01011d8",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "button",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1630,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "d3b058c0990ce6de",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "Switch all",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "remote",
        "payload": "{\"c\":\"off\",\"b\":\"on\",\"g\":\"on\",\"s\":\"off\"}",
        "payloadType": "json",
        "x": 380,
        "y": 460,
        "wires": [
            [
                "2b60c3632b00a3c1"
            ]
        ]
    },
    {
        "id": "3d794b2f2131b5b4",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgBSend",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 340,
        "wires": []
    },
    {
        "id": "18b67b41f34d8625",
        "type": "function",
        "z": "ee8099c2e47c91c1",
        "name": "function 1",
        "func": "\nlet msgBSend = {}; \nlet msgBGate = {}; \nlet msgGSend = {}; \nlet msgGGate = {}; \nlet msgS = {}; \nlet msgCGate = {};\n\nmsgBGate.topic = \"control\"\nmsgGGate.topic = \"control\"\nmsgCGate.topic = \"control\"\n\nif (msg.payload.b == \"on\") {\n\n    msgBSend.payload = \"alwaysResendValue\"\n    msgBSend.resend_force = true\n    msgBSend.resend_ignore = false\n    msgBSend.resend_interval = parseFloat(flow.get('freq')) * 60\n\n    msgBGate.payload = \"queue\"\n\n\n} else\n\n    if (msg.payload.b == \"off\") {\n\n        msgBSend.resend_messages = false\n        msgBSend.resend_ignore = true\n\n        msgBGate.payload = \"close\"\n\n\n    } else\n\n        if (msg.payload.g == \"on\") {\n\n            msgGSend.payload = \"alwaysResendValue\"\n            msgGSend.resend_force = true\n            msgGSend.resend_ignore = false\n            msgGSend.resend_interval = parseFloat(flow.get('freq')) * 60\n\n            msgGGate.payload = \"queue\"\n\n\n        } else\n\n            if (msg.payload.g == \"off\") {\n\n                msgGSend.resend_messages = false\n                msgGSend.resend_ignore = true\n\n                msgGGate.payload = \"close\"\n\n\n            } else\n\n                if (msg.payload.s == \"on\") {\n\n                    msgS.payload = true\n\n                } else if\n\n                    (msg.payload.s == \"off\") {\n\n                    msgS.payload = false\n\n\n                } else if\n\n                    (msg.payload.c == \"on\") {\n\n                    msgCGate.payload = \"open\"\n\n                } else if\n\n                    (msg.payload.c == \"off\") {\n\n                    msgCGate.payload = \"close\"\n\n                }\n\n//return [msgBSend, msgBGate, msgGSend, msgGGate, msgS, msgCGate];\n",
        "outputs": 6,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1180,
        "y": 460,
        "wires": [
            [
                "3d794b2f2131b5b4"
            ],
            [
                "e0905309cf9ffcb4"
            ],
            [
                "343330fb1acf23de"
            ],
            [
                "03fd276c98a1b3bb"
            ],
            [
                "68d9272c615d5471"
            ],
            [
                "078d4fc1e511e860"
            ]
        ]
    },
    {
        "id": "e0905309cf9ffcb4",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgBGate",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 380,
        "wires": []
    },
    {
        "id": "343330fb1acf23de",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgGSend",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 420,
        "wires": []
    },
    {
        "id": "03fd276c98a1b3bb",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgGGate",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 460,
        "wires": []
    },
    {
        "id": "68d9272c615d5471",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgS",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1410,
        "y": 500,
        "wires": []
    },
    {
        "id": "078d4fc1e511e860",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "msgCGate",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 540,
        "wires": []
    },
    {
        "id": "44d0a7ae835a5465",
        "type": "switch",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "switch",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 990,
        "y": 460,
        "wires": [
            [
                "18b67b41f34d8625",
                "42babbf18e629479"
            ]
        ]
    },
    {
        "id": "44f0e986cc1f44a6",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "b",
        "payload": "on",
        "payloadType": "str",
        "x": 390,
        "y": 380,
        "wires": [
            [
                "86696ae4089992d9"
            ]
        ]
    },
    {
        "id": "86696ae4089992d9",
        "type": "change",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\t    topic:payload\t}",
                "tot": "jsonata"
            },
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "remote",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 630,
        "y": 300,
        "wires": [
            [
                "2b60c3632b00a3c1"
            ]
        ]
    },
    {
        "id": "fe92bb87d069c48d",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "c",
        "payload": "on",
        "payloadType": "str",
        "x": 390,
        "y": 320,
        "wires": [
            [
                "86696ae4089992d9"
            ]
        ]
    },
    {
        "id": "3b646e91c80f71be",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "g",
        "payload": "on",
        "payloadType": "str",
        "x": 390,
        "y": 260,
        "wires": [
            [
                "86696ae4089992d9"
            ]
        ]
    },
    {
        "id": "3d0bb2a570294877",
        "type": "inject",
        "z": "ee8099c2e47c91c1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "s",
        "payload": "on",
        "payloadType": "str",
        "x": 390,
        "y": 200,
        "wires": [
            [
                "86696ae4089992d9"
            ]
        ]
    },
    {
        "id": "42babbf18e629479",
        "type": "debug",
        "z": "ee8099c2e47c91c1",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1160,
        "y": 280,
        "wires": []
    },
    {
        "id": "589e25a60e4fbcd4",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "29d816a6f2669734",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "2cad8ed8b01011d8",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "fdade815ef4911c1",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "29d816a6f2669734",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    },
    {
        "id": "fdade815ef4911c1",
        "type": "ui_tab",
        "name": "Tab 2",
        "icon": "dashboard",
        "order": 2
    }
]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.