Value through switch permanently

Where is it letting through messages when the switch is off?

on the debugs a,b,c,d

No, only a. Take another look

foo

Only a (or the first one) is passing messages.

Only one output is received per injection.
I am taking it you pressed the inject node twice when you took this picture.

Turn on all 4 and press the inject and you will see four messages.

There seems to be a serious confusion to what is wanted and what is being seen and expected.

Sorry wrong screen...

second payload set is while every switch is on "off"

(Bangs head against wall)
Ok, it happens.

Deep breath.

Ok. The switch says off. look at the function node state.

Go to the GUI (dashboard) and make sure the switches are set to the OFF position.
If they are, turn them on, the back to off and try again.

Do NOT use the indication of the switch node to determine what is going on.
The function node determines that. There may be a bit of a set up glitch so I strongly suggest you toggle the switches and make sure the graphical state of the switch matches the function node.

Mine is working fine. There is something happening somewhere which is causing a lot of grief.

I have tested it time and time again and it works.

By the way:
What do call ON and OFF on the graphic side of the switch node?

Screenshot from 2020-07-17 19-02-41

Screenshot from 2020-07-17 19-05-26

They match

I did it exactly like u wrote. But it works like i wrote.

on the graphic side i do not have any "on" or "off" like you have...

The on and off are there to show the difference and which I show as on and which is off.

So when you set the switches from the GUI side, what do the function nodes do?

They go on "Block" like intended i think…
ahh u inserted These on & off to the switches :slight_smile:
I didnt realized that...

Set the GUI switches as I had. (Take screen shot and post)
Then flip to the edit screen and show the state of the 4 function nodes.

Similar to what I did, but you can have the 4 switches are you want.

Oh, the screen shots. Please don't post JPG type. They are bad if I need to load, edit and re-post. Try PNG format please.

For you to do if you want, have two windows open. One is the GUI and one is the EDIT screen.

Then as you move the GUI switches you can see the function nodes change their state.
In fact you could have the two window on the screen shot if you want.

Something like:

As you move the switches you see the function nodes change their state.

Ok so here are the proofing screenshots :slight_smile:

  1. All to "off" as starting Point


    Switchtestall off switches

  2. After Setting two switches to "on"


    Switchtest 2xon 2xoff switches

  3. After the first inject (doesnt change with more injects)


    Switchtest after first inject switches

Debugs a & c keep going getting values.

Yes they will because the switches are still ON.

(What am I missing?)

The switches are ON, they allow the message. They are OFF the block the message.

That is what is happening.

the switches are off? i dont see switches at "on"

Point #2: After Setting two switches to "ON"
Which looks like it is per the picture below. #1 and #3 on.

Point #3: What do you mean? After the first inject.......

This is going to be getting .... a lot of messages a second from what you are telling me.
So?

Point #3 button picture.
What happened there? The two switches are now off. Are you saying you didn't do that?

Here is my system with multiple pressses of the inject node and the correct data is getting through and the switches are remaining the same.

  1. thats right
  2. thats right

my switches dont stay at theyre position. my flow behavior is different.
i dont know why but it is so :frowning:

Paste the code.....

There is no other way to work out the problem.

Ok here it is:

[{"id":"4499275c.a97338","type":"function","z":"af61c022.bc96e","name":"","func":"msg = {\"topic\":\"ATESTEO/Wolfsburg/W16\",\"payload\":{\"MQTTWert1\":\"25.1\",\"MQTTWert1name\":\"T_BoxenLuft\",\"MQTTWert2\":\"-101\",\"MQTTWert2name\":\"N_EMA_VL\",\"MQTTWert3\":\"932\",\"MQTTWert3name\":\"n_Antrieb\",\"MQTTWert4\":\"269\",\"MQTTWert4name\":\"M_Antrieb\",\"Status\":\"Läuft\"},\"qos\":1,\"retain\":false,\"_topic\":\"ATESTEO/Wolfsburg/W16\",\"_msgid\":\"3f4512b0.dc5bee\",\"kColor\":\"black\",\"vColor\":\"black\",\"template\":\"<html>\\n<head>\\n<style>\\ntable.FixedTable\\n{\\n    table-layout: fixed;\\n    border: 0;\\n}\\n</style>    \\n</head>\\n<body>\\n<table class=\\\"FixedTable\\\">\\n <tbody>\\n  <tr ng-repeat=\\\"(k,v) in msg.payload\\\" ng-if=\\\"k != 'Item'\\\">\\n   <td style=\\\"width: 250; color:{{msg.kColor}}\\\">{{k}}</td>\\n   <td style=\\\"text-align:justify; color:{{msg.vColor}}\\\">{{v}}</td>\\n  </tr>\\n </tbody>\\n</table>\\n</body>\\n</html>\",\"color\":\"lime\"};\nreturn msg;","outputs":1,"noerr":0,"x":3740,"y":1860,"wires":[["cdd158f.53ff5a8","fb660729.4f3078","3bce696a.0ad486","9235f258.0d0fa","80a585c.1926578"]]},{"id":"fed3f617.6dba38","type":"inject","z":"af61c022.bc96e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":3580,"y":1860,"wires":[["4499275c.a97338"]]},{"id":"cdd158f.53ff5a8","type":"debug","z":"af61c022.bc96e","name":"A","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":3720,"y":1920,"wires":[]},{"id":"fb660729.4f3078","type":"change","z":"af61c022.bc96e","name":"Part 1","rules":[{"t":"set","p":"value","pt":"msg","to":"payload.MQTTWert1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"payload.MQTTWert1name","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3910,"y":1740,"wires":[["a038ac37.4bf61","ad1d2ea7.89726"]]},{"id":"3bce696a.0ad486","type":"change","z":"af61c022.bc96e","name":"Part 2","rules":[{"t":"set","p":"value","pt":"msg","to":"payload.MQTTWert2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"payload.MQTTWert2name","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3910,"y":1820,"wires":[["1579598d.e8fe96","d542a959.78c438"]]},{"id":"9235f258.0d0fa","type":"change","z":"af61c022.bc96e","name":"Part 3","rules":[{"t":"set","p":"value","pt":"msg","to":"payload.MQTTWert3","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"payload.MQTTWert3name","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3910,"y":1910,"wires":[["397de4.6c65021c","82057e6e.fa098"]]},{"id":"80a585c.1926578","type":"change","z":"af61c022.bc96e","name":"Part 4","rules":[{"t":"set","p":"value","pt":"msg","to":"payload.MQTTWert4","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"payload.MQTTWert4name","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3910,"y":1980,"wires":[["9055e4cd.054608","d6b3b106.10e2b"]]},{"id":"a038ac37.4bf61","type":"function","z":"af61c022.bc96e","name":"","func":"//  Look for message from `switch`\n//  and set context.\n\nif (msg.payload == \"true\")\n{\n    context.set(\"ONOFF\",\"1\");\n    node.status({fill:\"green\",shape:\"dot\",text:\"PASS\"});\n    return;\n} else\nif (msg.payload == \"false\")\n{\n    context.set(\"ONOFF\",\"0\");\n    node.status({fill:\"red\",shape:\"dot\",text:\"BLOCK\"});\n    return;\n}\nvar pass = context.get(\"ONOFF\") || 0;\nif (pass == \"0\")\n{\n    //msg.payload = 0;\n    return;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":4370,"y":1740,"wires":[["6c991197.d1a23","17d63c2a.a5a5f4"]]},{"id":"ad1d2ea7.89726","type":"ui_switch","z":"af61c022.bc96e","name":"","label":"{{msg.topic}}","tooltip":"","group":"4590e919.a4d868","order":1,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":4040,"y":1710,"wires":[["a038ac37.4bf61","72738f62.28c0a"]]},{"id":"1579598d.e8fe96","type":"ui_switch","z":"af61c022.bc96e","name":"","label":"{{msg.topic}}","tooltip":"","group":"4590e919.a4d868","order":2,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"ATESTEO/Wolfsburg/W16","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":4040,"y":1780,"wires":[["d542a959.78c438"]]},{"id":"d542a959.78c438","type":"function","z":"af61c022.bc96e","name":"","func":"//  Look for message from `switch`\n//  and set context.\n\nif (msg.payload == \"true\")\n{\n    context.set(\"ONOFF\",\"1\");\n    node.status({fill:\"green\",shape:\"dot\",text:\"PASS\"});\n    return;\n} else\nif (msg.payload == \"false\")\n{\n    context.set(\"ONOFF\",\"0\");\n    node.status({fill:\"red\",shape:\"dot\",text:\"BLOCK\"});\n    return;\n}\nvar pass = context.get(\"ONOFF\") || 0;\nif (pass == \"0\")\n{\n    //msg.payload = 0;\n    return;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":4370,"y":1820,"wires":[["6353f523.ae4e5c","85063ef8.41c77"]]},{"id":"397de4.6c65021c","type":"ui_switch","z":"af61c022.bc96e","name":"","label":"{{msg.topic}}","tooltip":"","group":"4590e919.a4d868","order":3,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"ATESTEO/Wolfsburg/W16","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":4040,"y":1870,"wires":[["82057e6e.fa098"]]},{"id":"82057e6e.fa098","type":"function","z":"af61c022.bc96e","name":"","func":"//  Look for message from `switch`\n//  and set context.\n\nif (msg.payload == \"true\")\n{\n    context.set(\"ONOFF\",\"1\");\n    node.status({fill:\"green\",shape:\"dot\",text:\"PASS\"});\n    return;\n} else\nif (msg.payload == \"false\")\n{\n    context.set(\"ONOFF\",\"0\");\n    node.status({fill:\"red\",shape:\"dot\",text:\"BLOCK\"});\n    return;\n}\nvar pass = context.get(\"ONOFF\") || 0;\nif (pass == \"0\")\n{\n    //msg.payload = 0;\n    return;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":4370,"y":1910,"wires":[["8f38ba64.dc5d38","8cd5d1b6.95fcf"]]},{"id":"9055e4cd.054608","type":"ui_switch","z":"af61c022.bc96e","name":"","label":"{{msg.topic}}","tooltip":"","group":"4590e919.a4d868","order":4,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"ATESTEO/Wolfsburg/W16","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":4040,"y":1950,"wires":[["d6b3b106.10e2b"]]},{"id":"d6b3b106.10e2b","type":"function","z":"af61c022.bc96e","name":"","func":"//  Look for message from `switch`\n//  and set context.\n\nif (msg.payload == \"true\")\n{\n    context.set(\"ONOFF\",\"1\");\n    node.status({fill:\"green\",shape:\"dot\",text:\"PASS\"});\n    return;\n} else\nif (msg.payload == \"false\")\n{\n    context.set(\"ONOFF\",\"0\");\n    node.status({fill:\"red\",shape:\"dot\",text:\"BLOCK\"});\n    return;\n}\nvar pass = context.get(\"ONOFF\") || 0;\nif (pass == \"0\")\n{\n    //msg.payload = 0;\n    return;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":4370,"y":1980,"wires":[["475a584d.85b9b8","57d50499.2e0bac"]]},{"id":"6c991197.d1a23","type":"debug","z":"af61c022.bc96e","name":"1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4500,"y":1740,"wires":[]},{"id":"17d63c2a.a5a5f4","type":"debug","z":"af61c022.bc96e","name":"a","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":4500,"y":1770,"wires":[]},{"id":"72738f62.28c0a","type":"debug","z":"af61c022.bc96e","name":"From switch","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4390,"y":1710,"wires":[]},{"id":"6353f523.ae4e5c","type":"debug","z":"af61c022.bc96e","name":"2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4500,"y":1820,"wires":[]},{"id":"85063ef8.41c77","type":"debug","z":"af61c022.bc96e","name":"b","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":4500,"y":1850,"wires":[]},{"id":"8f38ba64.dc5d38","type":"debug","z":"af61c022.bc96e","name":"3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4500,"y":1910,"wires":[]},{"id":"8cd5d1b6.95fcf","type":"debug","z":"af61c022.bc96e","name":"c","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":4500,"y":1940,"wires":[]},{"id":"475a584d.85b9b8","type":"debug","z":"af61c022.bc96e","name":"4","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":4500,"y":1980,"wires":[]},{"id":"57d50499.2e0bac","type":"debug","z":"af61c022.bc96e","name":"d","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":4500,"y":2010,"wires":[]},{"id":"4590e919.a4d868","type":"ui_group","name":"Group 3","tab":"1ef82eaa.71cac1","order":3,"disp":true,"width":6},{"id":"1ef82eaa.71cac1","type":"ui_tab","z":"","name":"W16-Chart","icon":"dashboard","order":11,"disabled":false,"hidden":false}]

But i have a working solution with my changed flow...

There is something happening which either you aren't telling me, or is systemically doing things you don't know.

I load the code and it works exactly as expected.

I turn on switch 1 and 3 and sit there bashing the inject node and only get a and c outputs. Repeatedly.

How your switches are being turned off is way beyond my skills.

I have another thing to mention but will do it in another post to help keep things separate.

The message which is being injected:

It is a cut down version which will contain 18 messages.

You will be receiving a few messages at a pretty good rate which will require a lot of number crunching.

The sample message you gave me has a lot of overhead which you say is needed.... for.....? Dunno.

Stripping this at the start will greatly help with processing the messages later on.

I am sorry, i cant tell you why this happens.
I agree to cuting the msg down to needed payload at the entry of that part of the flow.
but i think i dont know how. u want to get rid of the remplate as i understand?
For the payload : i thought deleting with a Change node is enough...

It is what it is.

I can't help you any more.

What I posted works to do what you want - as best I can understand - yet it does weird things on your machine, which it doesn't do on mine.

Good luck.