Comments (6)
@Just-another-pleb, I'm not clear on what you are trying to achieve. I take it that you want the option for the node to accept several alternative forms of control messages, at least for open
and close
if not for toggle
and default
. However, I don't understand how one would use this capability. Please try to describe an example that would help me see the value of this change and how often it is likely to be used.
My first thought is that each gate
node could be preceded by a change
node that replaces any of the alternative forms of a control message by the one that is programmed into the gate. This means extra nodes, but you might not have to do it often.
A general approach to dealing with a "complicated gate layout" would be my node-red-contrib-remote-gate
node. This has not been published to npm, but is available on GitHub. Please take a look at the section on Complex Control in the README and let me know whether either of these ideas can meet your requirement.
from node-red-contrib-simple-gate.
Yeah, ok. I maybe didn't explain it the best.
And typically when I look in my flows, I can't find the example (existing) where I have to write extra nodes/code to get around the "problem".
I have scenarios where I could have multiple source signals (functions) from which I want to select only one.
This is a bigger picture of what I am wanting to do.
It isn't 100% wired correctly. But it is to show the connections, and given that the gate
node can accept multiple "off" signals.
So each gate
will OPEN only when it receives a specific signal.
Any other signal (or specified to keep the toggle
option active) it becomes CLOSED
I just found part of the flow where I need this.
Green rectangle different input selections.
Red rectangle control of the signals to control gate
nodes.
Purple (I goofed and missed one of the gate
nodes just to the left of the ractangle) the gate
nodes and output.
from node-red-contrib-simple-gate.
With only a screenshot and not the actual flow, I have some difficulty working out exactly the logic you are trying to achieve. If what you want is to use a single message to set the state of an arbitrary number of gate
nodes, something like this flow should work:
[{"id":"93e298aa.fbe5e","type":"inject","z":"78950230.f70e94","name":"toggle/close/default","topic":"","payload":"[{\"gate\":\"1\",\"payload\":\"toggle\",\"topic\":\"control\"},{\"gate\":\"2\",\"payload\":\"close\",\"topic\":\"control\"},{\"gate\":\"3\",\"payload\":\"default\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":540,"wires":[["e8d97bdc.a58d18"]]},{"id":"48eea3b3.aa7934","type":"switch","z":"78950230.f70e94","name":"","property":"gate","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":490,"y":580,"wires":[["994cd5c.beea628"],["e98400af.d710c8"],["5cf5f18b.04a11"]]},{"id":"e8d97bdc.a58d18","type":"function","z":"78950230.f70e94","name":"split","func":"return [msg.payload];","outputs":1,"noerr":0,"x":370,"y":580,"wires":[["48eea3b3.aa7934"]]},{"id":"994cd5c.beea628","type":"gate","z":"78950230.f70e94","name":"gate #1","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":640,"y":520,"wires":[[]]},{"id":"e98400af.d710c8","type":"gate","z":"78950230.f70e94","name":"gate #2","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":640,"y":580,"wires":[[]]},{"id":"5cf5f18b.04a11","type":"gate","z":"78950230.f70e94","name":"gate #3","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":640,"y":640,"wires":[[]]},{"id":"6f8d50b6.77df2","type":"inject","z":"78950230.f70e94","name":"toggle/toggle/toggle","topic":"","payload":"[{\"gate\":\"1\",\"payload\":\"toggle\",\"topic\":\"control\"},{\"gate\":\"2\",\"payload\":\"toggle\",\"topic\":\"control\"},{\"gate\":\"3\",\"payload\":\"toggle\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":580,"wires":[["e8d97bdc.a58d18"]]},{"id":"650587e9.0d79f","type":"inject","z":"78950230.f70e94","name":"default/default/default","topic":"","payload":"[{\"gate\":\"1\",\"payload\":\"default\",\"topic\":\"control\"},{\"gate\":\"2\",\"payload\":\"default\",\"topic\":\"control\"},{\"gate\":\"3\",\"payload\":\"default\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":620,"wires":[["e8d97bdc.a58d18"]]},{"id":"34fba7e0.148568","type":"inject","z":"78950230.f70e94","name":"open/close/open","topic":"","payload":"[{\"gate\":\"1\",\"payload\":\"open\",\"topic\":\"control\"},{\"gate\":\"2\",\"payload\":\"close\",\"topic\":\"control\"},{\"gate\":\"3\",\"payload\":\"open\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":460,"wires":[["e8d97bdc.a58d18"]]},{"id":"5c9a0ff7.5c06c8","type":"inject","z":"78950230.f70e94","name":"close/open/close","topic":"","payload":"[{\"gate\":\"1\",\"payload\":\"close\",\"topic\":\"control\"},{\"gate\":\"2\",\"payload\":\"open\",\"topic\":\"control\"},{\"gate\":\"3\",\"payload\":\"close\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":500,"wires":[["e8d97bdc.a58d18"]]},{"id":"20dc7f9d.d3614","type":"inject","z":"78950230.f70e94","name":"gate #2 close","topic":"","payload":"[{\"gate\":\"2\",\"payload\":\"close\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":660,"wires":[["e8d97bdc.a58d18"]]},{"id":"232e0150.7ae7d6","type":"inject","z":"78950230.f70e94","name":"gate #2 toggle","topic":"","payload":"[{\"gate\":\"2\",\"payload\":\"toggle\",\"topic\":\"control\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":700,"wires":[["e8d97bdc.a58d18"]]}]
As an example, each of the inject
nodes gives you a different set of states or transitions for some or all of the gates. I hope this helps.
from node-red-contrib-simple-gate.
Yeah, ok. (Again)
That flow has "extra" buttons to do things.
Basically the idea is you have a button to activate that input.
This is a better flow to demonstrate the idea.
- Note: All gates are closed.
Pressing a button activates that gate.
Pressing another button, deactivates that button which was active and activates the new button.
The flow doesn't.
So ideally (example) button 1 is turned off if it sees: 2 (or) 3 (or) 4 (or) 5
And button 2 is turned off when it sees" 1 (or) 3 (or) 4 (or) 5
There is a second flow. It works. Slightly better but it has a set of extra function nodes.
[{"id":"4f772739.62817","type":"function","z":"accbdb61.d75918","name":"Function 1","func":"\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":1910,"wires":[["90118dfa.82f268"]]},{"id":"248cfe64.5ef93a","type":"function","z":"accbdb61.d75918","name":"Function 2","func":"\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":1950,"wires":[["a2805d19.58b318"]]},{"id":"7375f758.6b8538","type":"function","z":"accbdb61.d75918","name":"Function 3","func":"\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":1990,"wires":[["1cc9c59.72b9a3a"]]},{"id":"ff6fa1ee.932948","type":"function","z":"accbdb61.d75918","name":"Function 4","func":"\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":2030,"wires":[["71c265b7.8c9734"]]},{"id":"dad44b99.6f4d2","type":"function","z":"accbdb61.d75918","name":"Function 5","func":"\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":2070,"wires":[["b0fc7c8b.7ede78"]]},{"id":"90118dfa.82f268","type":"gate","z":"accbdb61.d75918","name":"Gate 1","controlTopic":"control","defaultState":"closed","openCmd":"1","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":460,"y":1910,"wires":[["150206e.89538f9"]]},{"id":"a2805d19.58b318","type":"gate","z":"accbdb61.d75918","name":"Gate 2","controlTopic":"control","defaultState":"closed","openCmd":"2","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":460,"y":1950,"wires":[["150206e.89538f9"]]},{"id":"1cc9c59.72b9a3a","type":"gate","z":"accbdb61.d75918","name":"Gate 3","controlTopic":"control","defaultState":"closed","openCmd":"3","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":460,"y":1990,"wires":[["150206e.89538f9"]]},{"id":"71c265b7.8c9734","type":"gate","z":"accbdb61.d75918","name":"Gate 4","controlTopic":"control","defaultState":"closed","openCmd":"4","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":460,"y":2030,"wires":[["150206e.89538f9"]]},{"id":"b0fc7c8b.7ede78","type":"gate","z":"accbdb61.d75918","name":"Gate 5","controlTopic":"control","defaultState":"closed","openCmd":"5","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":460,"y":2070,"wires":[["150206e.89538f9"]]},{"id":"e9462bf8.88ceb8","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1760,"wires":[["a2805d19.58b318","1cc9c59.72b9a3a","b0fc7c8b.7ede78","90118dfa.82f268"]]},{"id":"1f3d167a.60de9a","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"4","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1800,"wires":[["1cc9c59.72b9a3a","71c265b7.8c9734","90118dfa.82f268","a2805d19.58b318"]]},{"id":"38934543.66f6ca","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1840,"wires":[["71c265b7.8c9734","b0fc7c8b.7ede78","a2805d19.58b318","1cc9c59.72b9a3a"]]},{"id":"5c0a251d.f3eaac","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":241,"y":1723,"wires":[["90118dfa.82f268","a2805d19.58b318"]]},{"id":"c2e45264.5bb368","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1680,"wires":[["90118dfa.82f268","a2805d19.58b318","1cc9c59.72b9a3a","71c265b7.8c9734","b0fc7c8b.7ede78"]]},{"id":"150206e.89538f9","type":"function","z":"accbdb61.d75918","name":"The next stage","func":"\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":1990,"wires":[[]]}]
Second flow.
[{"id":"4f772739.62817","type":"function","z":"accbdb61.d75918","name":"Function 1","func":"\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":1910,"wires":[["90118dfa.82f268"]]},{"id":"248cfe64.5ef93a","type":"function","z":"accbdb61.d75918","name":"Function 2","func":"\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":1950,"wires":[["a2805d19.58b318"]]},{"id":"7375f758.6b8538","type":"function","z":"accbdb61.d75918","name":"Function 3","func":"\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":1990,"wires":[["1cc9c59.72b9a3a"]]},{"id":"ff6fa1ee.932948","type":"function","z":"accbdb61.d75918","name":"Function 4","func":"\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":2030,"wires":[["71c265b7.8c9734"]]},{"id":"dad44b99.6f4d2","type":"function","z":"accbdb61.d75918","name":"Function 5","func":"\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":2070,"wires":[["b0fc7c8b.7ede78"]]},{"id":"90118dfa.82f268","type":"gate","z":"accbdb61.d75918","name":"Gate 1","controlTopic":"control","defaultState":"closed","openCmd":"1","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":660,"y":1910,"wires":[["150206e.89538f9"]]},{"id":"a2805d19.58b318","type":"gate","z":"accbdb61.d75918","name":"Gate 2","controlTopic":"control","defaultState":"closed","openCmd":"2","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":660,"y":1950,"wires":[["150206e.89538f9"]]},{"id":"1cc9c59.72b9a3a","type":"gate","z":"accbdb61.d75918","name":"Gate 3","controlTopic":"control","defaultState":"closed","openCmd":"3","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":660,"y":1990,"wires":[["150206e.89538f9"]]},{"id":"71c265b7.8c9734","type":"gate","z":"accbdb61.d75918","name":"Gate 4","controlTopic":"control","defaultState":"closed","openCmd":"4","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":660,"y":2030,"wires":[["150206e.89538f9"]]},{"id":"b0fc7c8b.7ede78","type":"gate","z":"accbdb61.d75918","name":"Gate 5","controlTopic":"control","defaultState":"closed","openCmd":"5","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":660,"y":2070,"wires":[["150206e.89538f9"]]},{"id":"e9462bf8.88ceb8","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1760,"wires":[["f47fd25a.a001c"]]},{"id":"1f3d167a.60de9a","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"4","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1800,"wires":[["d7efa399.1043b"]]},{"id":"38934543.66f6ca","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1840,"wires":[["f6b96acb.1a70b8"]]},{"id":"5c0a251d.f3eaac","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1720,"wires":[["67dbe99a.054d58"]]},{"id":"c2e45264.5bb368","type":"inject","z":"accbdb61.d75918","name":"","topic":"control","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1680,"wires":[["22f1a8aa.be72e"]]},{"id":"150206e.89538f9","type":"function","z":"accbdb61.d75918","name":"The next stage","func":"\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":1990,"wires":[[]]},{"id":"22f1a8aa.be72e","type":"function","z":"accbdb61.d75918","name":"Function 1","func":"msg = {payload: \"1\", topic:\"control\"};\nvar msg1 = {payload: \"close\",topic:\"control\"};\nreturn [msg,msg1];","outputs":2,"noerr":0,"x":400,"y":1680,"wires":[["90118dfa.82f268"],["a2805d19.58b318","1cc9c59.72b9a3a","71c265b7.8c9734","b0fc7c8b.7ede78"]]},{"id":"67dbe99a.054d58","type":"function","z":"accbdb61.d75918","name":"Function 2","func":"msg = {payload: \"2\", topic:\"control\"};\nvar msg1 = {payload: \"close\",topic:\"control\"};\nreturn [msg,msg1];","outputs":2,"noerr":0,"x":400,"y":1720,"wires":[["a2805d19.58b318"],["90118dfa.82f268","1cc9c59.72b9a3a","71c265b7.8c9734","b0fc7c8b.7ede78"]]},{"id":"f47fd25a.a001c","type":"function","z":"accbdb61.d75918","name":"Function 3","func":"msg = {payload: \"3\", topic:\"control\"};\nvar msg1 = {payload: \"close\",topic:\"control\"};\nreturn [msg,msg1];","outputs":2,"noerr":0,"x":400,"y":1760,"wires":[["1cc9c59.72b9a3a"],["90118dfa.82f268","a2805d19.58b318","71c265b7.8c9734","b0fc7c8b.7ede78"]]},{"id":"d7efa399.1043b","type":"function","z":"accbdb61.d75918","name":"Function 4","func":"msg = {payload: \"4\", topic:\"control\"};\nvar msg1 = {payload: \"close\",topic:\"control\"};\nreturn [msg,msg1];","outputs":2,"noerr":0,"x":400,"y":1800,"wires":[["71c265b7.8c9734"],["90118dfa.82f268","a2805d19.58b318","1cc9c59.72b9a3a","b0fc7c8b.7ede78"]]},{"id":"f6b96acb.1a70b8","type":"function","z":"accbdb61.d75918","name":"Function 5","func":"msg = {payload: \"5\", topic:\"control\"};\nvar msg1 = {payload: \"close\",topic:\"control\"};\nreturn [msg,msg1];","outputs":2,"noerr":0,"x":400,"y":1840,"wires":[["b0fc7c8b.7ede78"],["90118dfa.82f268","a2805d19.58b318","1cc9c59.72b9a3a","71c265b7.8c9734"]]}]
from node-red-contrib-simple-gate.
@Just-another-pleb, sorry I missed your latest post. I've been busy recovering from an injury and careless about other things. Here are two flows that do what you want or at least the same thing as your second flow. The first generates error messages that you can ignore.
[{"id":"f0848b6b.9ad248","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":40,"wires":[["2e051e66.953c6a"]]},{"id":"2e051e66.953c6a","type":"trigger","z":"cbcaa22d.71b9a8","op1":"close","op2":"","op1type":"str","op2type":"pay","duration":"1","extend":false,"units":"ms","reset":"","bytopic":"all","name":"","x":310,"y":120,"wires":[["7d0b91cf.5f581","f0e8772d.1a1648","beaab8cf.c20b6","3b39a222.7ce936","94c77ec2.8a9d6"]]},{"id":"7d0b91cf.5f581","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 1","controlTopic":"control","defaultState":"closed","openCmd":"1","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":40,"wires":[[]]},{"id":"f0e8772d.1a1648","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 2","controlTopic":"control","defaultState":"closed","openCmd":"2","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":80,"wires":[[]]},{"id":"beaab8cf.c20b6","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 3","controlTopic":"control","defaultState":"closed","openCmd":"3","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":120,"wires":[[]]},{"id":"3b39a222.7ce936","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 4","controlTopic":"control","defaultState":"closed","openCmd":"4","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":160,"wires":[[]]},{"id":"94c77ec2.8a9d6","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 5","controlTopic":"control","defaultState":"closed","openCmd":"5","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":200,"wires":[[]]},{"id":"4256133f.ca811c","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":80,"wires":[["2e051e66.953c6a"]]},{"id":"97474ba3.858a4","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":120,"wires":[["2e051e66.953c6a"]]},{"id":"5b4a7e2d.529528","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"4","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":160,"wires":[["2e051e66.953c6a"]]},{"id":"dcd4124.7ed6a7","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":200,"wires":[["2e051e66.953c6a"]]}]
The second avoids the error messages at the cost of a fairly simple function node.
[{"id":"daa6d3bd.d20898","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 1","controlTopic":"control","defaultState":"closed","openCmd":"1","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":670,"y":260,"wires":[[]]},{"id":"b7d1e81f.3e441","type":"function","z":"cbcaa22d.71b9a8","name":"","func":"let output = [null,null,null,null,null];\nif (msg.payload === 'close') {\n node.send([msg,msg,msg,msg,msg]);\n} else {\n output[msg.payload - 1] = msg;\n node.send(output);\n}\n","outputs":5,"noerr":0,"x":510,"y":340,"wires":[["daa6d3bd.d20898"],["8eb41d4f.fc7cf"],["12c8ce71.b134d2"],["b205dca7.0f9de"],["b7519c20.1f4d88"]]},{"id":"8eb41d4f.fc7cf","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 2","controlTopic":"control","defaultState":"closed","openCmd":"2","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":670,"y":300,"wires":[[]]},{"id":"12c8ce71.b134d2","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 3","controlTopic":"control","defaultState":"closed","openCmd":"3","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":670,"y":340,"wires":[[]]},{"id":"b205dca7.0f9de","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 4","controlTopic":"control","defaultState":"closed","openCmd":"4","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":670,"y":380,"wires":[[]]},{"id":"b7519c20.1f4d88","type":"gate","z":"cbcaa22d.71b9a8","name":"Gate 5","controlTopic":"control","defaultState":"closed","openCmd":"5","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":670,"y":420,"wires":[[]]},{"id":"548ecdf.fe888b4","type":"trigger","z":"cbcaa22d.71b9a8","op1":"close","op2":"","op1type":"str","op2type":"pay","duration":"1","extend":false,"units":"ms","reset":"","bytopic":"all","name":"","x":350,"y":340,"wires":[["b7d1e81f.3e441"]]},{"id":"b6f4cc12.7160e8","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":300,"wires":[["548ecdf.fe888b4"]]},{"id":"4f2edd78.c4cfa4","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":340,"wires":[["548ecdf.fe888b4"]]},{"id":"56b83b1b.d2a0e4","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"4","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":380,"wires":[["548ecdf.fe888b4"]]},{"id":"cb0ab5da.8c3028","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":420,"wires":[["548ecdf.fe888b4"]]},{"id":"6c712882.2826e","type":"inject","z":"cbcaa22d.71b9a8","name":"","topic":"control","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":260,"wires":[["548ecdf.fe888b4"]]}]
This convinces me that with a bit of ingenuity you can generate the messages you need in a flow that is not too messy.
It turns out that allowing multiple synonyms for the control commands would require a significant reworking of the node, both the internal logic and the user interface. Unless more use cases turn up that would really benefit from the feature, I'm not prepared to take that on.
from node-red-contrib-simple-gate.
Thanks. I've only imported it and looked.
Appreciated the effort you put in the reply.
Hope all goes well with getting better. Injuries are not fun.
P.S.
I like how you did it. Sneaky. ;)
from node-red-contrib-simple-gate.
Related Issues (16)
- OPEN and CLOSED are backwards HOT 1
- small issue with the documentation: "Control Topic" HOT 1
- Request: set close state on first message HOT 7
- Request: release info HOT 6
- closed gate not blocking all payloads HOT 8
- Request. HOT 6
- I seem to be sending the correct commands, but the gate is saying "Invalid command"
- Bug: status message does not work HOT 5
- Indirect control HOT 5
- State doesn't persist reboot HOT 13
- Node name HOT 5
- TypeError: Cannot read property 'toLowerCase' of undefined HOT 5
- Feature request - option to queue latest message and release on opening the gate HOT 5
- Feature request: Timer-gate HOT 3
- suggestion:customizable msg category HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-contrib-simple-gate.