Hi!, yes i think i'm almost there. So the thing is that i need to turn on the Sonoff that is turned on like the picture below.
I can filter the turned on Sonoff but how can i process the turn off flow?.
This is the complete flow.
[{"id":"eff5f66.e40db08","type":"function","z":"371b5d1c.9c46c2","name":"hosts","func":"const tasmotas = [\"192.168.1.40\",\"192.168.1.180\"]\nconst status= \"/cm?cmnd=Status\"\n\nfor(let x=0;x<tasmotas.length;x++){\n node.send({url:\"http://\"+tasmotas[x]+status})\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":360,"wires":[["ef211c5a.425a"]]},{"id":"ef211c5a.425a","type":"http request","z":"371b5d1c.9c46c2","name":"","method":"use","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":390,"y":400,"wires":[["e83f5874.d8d9e8"]]},{"id":"e83f5874.d8d9e8","type":"batch","z":"371b5d1c.9c46c2","name":"","mode":"count","count":"2","overlap":0,"interval":10,"allowEmptySequence":false,"topics":[],"x":370,"y":460,"wires":[["12e13e59.da9d42"]]},{"id":"c6ead7b5.54b4e8","type":"inject","z":"371b5d1c.9c46c2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":360,"wires":[["eff5f66.e40db08"]]},{"id":"12e13e59.da9d42","type":"change","z":"371b5d1c.9c46c2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Status{\t \"deviceName\":**.DeviceName,\t \"powerStatus\":**.Power \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":500,"wires":[["179329f9.5d00a6","45bffc79.042974"]]},{"id":"45bffc79.042974","type":"debug","z":"371b5d1c.9c46c2","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":560,"wires":[]},{"id":"179329f9.5d00a6","type":"join","z":"371b5d1c.9c46c2","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":370,"y":540,"wires":[["a6a76f4e.2a9b"]]},{"id":"a6a76f4e.2a9b","type":"switch","z":"371b5d1c.9c46c2","name":"filter turned on devices","property":"payload.powerStatus","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":580,"wires":[["737c53f.e87afac"]]},{"id":"737c53f.e87afac","type":"debug","z":"371b5d1c.9c46c2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":600,"wires":[]}]
I think i should reuse the sonoff IPs from the Hosts node?
Thanks!