I am wondering if there is a 'simple' solution for what I would like to do with a few flows at ones.
I have a few WiFi/network devices that act as a lamp. Nothing fancy but it works.
Node-RED can ask them what there current color is and there state and shows a yellow lamp for on, grey for off and shows the current color on the button. A push on the POWER button changes it's state.
I have them almost all on separate flows (except for the 06 version where they are on one flow).
[{"id":"ab7cbe16.df717","type":"tab","label":"LOL07","disabled":false,"info":""},{"id":"46ab4bd1.85472c","type":"inject","z":"ab7cbe16.df717","name":"","topic":"","payload":"","payloadType":"str","repeat":"3","crontab":"","once":true,"onceDelay":"","x":110,"y":140,"wires":[["a5e69504.92bb3","d3a10a91.d6d73"]]},{"id":"a5e69504.92bb3","type":"http request","z":"ab7cbe16.df717","name":"get current state","method":"GET","ret":"txt","url":"lol07.local/current_state","tls":"","x":290,"y":180,"wires":[["f365f49b.5a3918","d9e6a1cd.7ac768"]]},{"id":"f365f49b.5a3918","type":"debug","z":"ab7cbe16.df717","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":260,"wires":[]},{"id":"d3a10a91.d6d73","type":"http request","z":"ab7cbe16.df717","name":"get current color","method":"GET","ret":"txt","url":"lol07.local/current_color","tls":"","x":290,"y":120,"wires":[["3165b8bc.46c36","f135ed84.4374a8","94be12e6.c75c98","8e9bc079.a09728"]]},{"id":"3165b8bc.46c36","type":"debug","z":"ab7cbe16.df717","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":60,"wires":[]},{"id":"94be12e6.c75c98","type":"ui_button","z":"ab7cbe16.df717","name":"","group":"aadd247e.ac6898","order":1,"width":"3","height":"1","passthru":false,"label":"Power","color":"","bgcolor":"{{msg.payload}}","icon":"","payload":"@2","payloadType":"str","topic":"","x":690,"y":100,"wires":[["e511d263.935f"]]},{"id":"e21659af.6bf148","type":"ui_text","z":"ab7cbe16.df717","group":"aadd247e.ac6898","order":2,"width":"1","height":"1","name":"indicator","label":"","format":"<font color={{msg.payload}} ><i class=\"fa fa-lightbulb-o fa-2x\" style=\"font-size:48px;\"></i></font>","layout":"row-spread","x":680,"y":220,"wires":[]},{"id":"d9e6a1cd.7ac768","type":"change","z":"ab7cbe16.df717","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"Off","fromt":"str","to":"grey","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"On","fromt":"str","to":"yellow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":220,"wires":[["e21659af.6bf148"]]},{"id":"8e9bc079.a09728","type":"ui_colour_picker","z":"ab7cbe16.df717","name":"","label":"","group":"aadd247e.ac6898","format":"hex","outformat":"string","showSwatch":true,"showPicker":true,"showValue":true,"showHue":false,"showAlpha":false,"showLightness":true,"dynOutput":"false","order":4,"width":"1","height":"1","passthru":false,"topic":"","x":670,"y":140,"wires":[["c4aca56d.d9be6"]]},{"id":"f135ed84.4374a8","type":"ui_text","z":"ab7cbe16.df717","group":"aadd247e.ac6898","order":3,"width":"3","height":"1","name":"","label":"","format":"{{msg.payload}}","layout":"col-center","x":690,"y":180,"wires":[]},{"id":"1ce48feb.8d7e88","type":"debug","z":"ab7cbe16.df717","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":990,"y":200,"wires":[]},{"id":"e511d263.935f","type":"websocket out","z":"ab7cbe16.df717","name":"","server":"","client":"3effd81d.47d4f","x":1000,"y":60,"wires":[]},{"id":"ed7255db.179d48","type":"ui_dropdown","z":"ab7cbe16.df717","name":"","label":"","place":"Select option","group":"aadd247e.ac6898","order":0,"width":"4","height":"1","passthru":true,"options":[{"label":"red","value":"#ff0000","type":"str"},{"label":"green","value":"#00ff00","type":"str"},{"label":"blue","value":"#0000ff","type":"str"},{"label":"magenta","value":"#ff00ff","type":"str"},{"label":"yellow","value":"#ffff00","type":"str"},{"label":"cyaan","value":"#00ffff","type":"str"},{"label":"white","value":"#ffffff","type":"str"},{"label":"black","value":"#000000","type":"str"},{"label":"default","value":"#808080","type":"str"},{"label":"nice one","value":"#444800","type":"str"},{"label":"Aineke's choice","value":"#727f1e","type":"str"}],"payload":"","topic":"","x":680,"y":60,"wires":[["e511d263.935f"]]},{"id":"c4aca56d.d9be6","type":"change","z":"ab7cbe16.df717","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"#\"&payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":140,"wires":[["e511d263.935f","1ce48feb.8d7e88"]]},{"id":"aadd247e.ac6898","type":"ui_group","z":"","name":"LOL07","tab":"4cbb5257.8f207c","disp":true,"width":"4","collapse":false},{"id":"3effd81d.47d4f","type":"websocket-client","z":"","path":"ws://lol07.local:81","tls":"","wholemsg":"false"},{"id":"4cbb5257.8f207c","type":"ui_tab","z":"","name":"LOL","icon":"dashboard","order":12}]
That means I have 4 flows that are almost the same except for there address and there name.
Now I like to make a switch that change the state of all devices at ones.
Something like a button on a new group that, if a device is on (as in the picture, LOL06B and LOL07 are TRUE therefor on) only does two get a message to change there state. (otherwise the other ones would go on!).
Do I need to create a new flow with, in this case six WebSocket's and six HTTP nodes, or is there an other way?
Maybe put all the devices on one flow and add that button function there is an option but looks very messy to me and made me wonder if that is really the best way.
So, I am just wondering what would you do?
Sorry for asking but I am just a simple carpenter with a very nice hobby that likes to learn this.
Despite I am not the quickest learner, I have learned already a lot from some people here, so any advice is always welcome.
Thanks in advance.