|
[{"id":"170a12c9.e8f5ed","type":"Hue Pull","deviceid":"5","serverid":"001788fffe09d8cb","name":"Read Hue 1","x":595,"y":166,"z":"57b6b7bd.a84948","wires":[["570bc28.fa8f43c"],[]]},{"id":"d14fe440.2eb018","type":"Hue Set","deviceid":"10","serverid":"001788fffe09d8cb","name":"Set Hue 2","x":1136,"y":172,"z":"57b6b7bd.a84948","wires":[["b4802ce3.4b7fd"],[]]},{"id":"f1a1ca6.f0e5e38","type":"function","name":"on","func":"msg.payload={\n\t\"on\":[true],\n\t\"bri\":[255],\n\t\"rgb\":[255,0,0]\n};\nreturn msg;","outputs":1,"noerr":0,"x":1006,"y":489,"z":"57b6b7bd.a84948","wires":[["dbdcd8e1.242328"]]},{"id":"b5425dee.4abda","type":"function","name":"off","func":"msg.payload={\n\t\"on\":[false],\n\n};\nreturn msg;","outputs":1,"noerr":0,"x":1008,"y":172,"z":"57b6b7bd.a84948","wires":[["d14fe440.2eb018"]]},{"id":"570bc28.fa8f43c","type":"function","name":"Is Reachable?","func":"if (msg.payload.state.reachable === true ) {\n\n return [msg,null];\n}\n\nif (msg.payload.state.reachable === false) {\n \n return [null,msg];\n\n}","outputs":"2","noerr":0,"x":762,"y":166,"z":"57b6b7bd.a84948","wires":[["1c912d5e.e36ed3"],["b5425dee.4abda"]]},{"id":"d5bf43ca.2a40c","type":"Hue Pull","deviceid":"10","serverid":"001788fffe09d8cb","name":"Read Hue 2","x":256,"y":325,"z":"57b6b7bd.a84948","wires":[["f30282c0.0cfd8"],[]]},{"id":"f30282c0.0cfd8","type":"function","name":"Is Already On?","func":"if (msg.payload.state.on === true ) {\n\n return [msg,null];\n}\n\nif (msg.payload.state.on === false) {\n \n return [null,msg];\n\n}","outputs":"2","noerr":0,"x":422,"y":325,"z":"57b6b7bd.a84948","wires":[["170a12c9.e8f5ed"],["2b869633.d4796a"]]},{"id":"3d02aa98.c2fd56","type":"comment","name":"Repeat until Hue 1 switched on ","info":"","x":678,"y":531,"z":"57b6b7bd.a84948","wires":[]},{"id":"b4802ce3.4b7fd","type":"delay","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1272,"y":171,"z":"57b6b7bd.a84948","wires":[["2b869633.d4796a"]]},{"id":"220b1454.ddf4ec","type":"inject","name":"","topic":"Auto start once","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":100,"y":325,"z":"57b6b7bd.a84948","wires":[["d5bf43ca.2a40c"]]},{"id":"2b869633.d4796a","type":"Hue Pull","deviceid":"5","serverid":"001788fffe09d8cb","name":"Read Hue 1","x":598,"y":497,"z":"57b6b7bd.a84948","wires":[["d8ec35e1.2713c8"],[]]},{"id":"d8ec35e1.2713c8","type":"function","name":"Is Reachable?","func":"if (msg.payload.state.reachable === true ) {\n\n return [msg,null];\n}\n\nif (msg.payload.state.reachable === false) {\n \n return [null,msg];\n\n}","outputs":"2","noerr":0,"x":764,"y":497,"z":"57b6b7bd.a84948","wires":[["f1a1ca6.f0e5e38"],["9e6c8aa3.619378"]]},{"id":"51871928.ae78e8","type":"delay","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1271,"y":491,"z":"57b6b7bd.a84948","wires":[["170a12c9.e8f5ed"]]},{"id":"9e6c8aa3.619378","type":"delay","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":678,"y":591,"z":"57b6b7bd.a84948","wires":[["2b869633.d4796a"]]},{"id":"1c912d5e.e36ed3","type":"delay","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":696,"y":89,"z":"57b6b7bd.a84948","wires":[["170a12c9.e8f5ed"]]},{"id":"dbdcd8e1.242328","type":"Hue Set","deviceid":"10","serverid":"001788fffe09d8cb","name":"Set Hue 2","x":1135,"y":490,"z":"57b6b7bd.a84948","wires":[["51871928.ae78e8"],[]]},{"id":"633d710d.9cc29","type":"comment","name":"Yes","info":"","x":502,"y":235,"z":"57b6b7bd.a84948","wires":[]},{"id":"5ea6697b.a15998","type":"comment","name":"No","info":"","x":498,"y":419,"z":"57b6b7bd.a84948","wires":[]},{"id":"b5bace5f.4a453","type":"comment","name":"Repeat until Hue 1 switched off","info":"","x":690,"y":132,"z":"57b6b7bd.a84948","wires":[]},{"id":"d059f3d2.2fa61","type":"comment","name":"Hue 1 off","info":"","x":898,"y":191,"z":"57b6b7bd.a84948","wires":[]},{"id":"c6270243.39d9","type":"comment","name":"Hue 1 on","info":"","x":894,"y":469,"z":"57b6b7bd.a84948","wires":[]},{"id":"9abefa54.654108","type":"comment","name":"Once Hue 2 set, go back to read opposite line","info":"Top side will wait for Hue 1 to switch off before making any changes\n\nBottom side will wait for Hue 1 to switch on before making any changes\n","x":1155,"y":331,"z":"57b6b7bd.a84948","wires":[]},{"id":"2d8ec93f.d27136","type":"comment","name":"Wait to turn off Hue 2","info":"Wait for hue 1 to change, \nif nothing changes and Hue 1 is still unreachable\nthen repeat back to wait for change\n\nif changed to off position\nthen change Hue 2 and \nthen start checking if if Hue 1 is on","x":410,"y":101,"z":"57b6b7bd.a84948","wires":[]},{"id":"2a08254e.d5f7da","type":"comment","name":"Wait to turn on Hue 2","info":"Wait for hue 1 to change, \nif nothing changes and Hue 1 is still reachable\nthen repeat back to wait for change\n\nif changed to on position\nthen change Hue 2 and \nthen start checking if if Hue 1 is off","x":407,"y":556,"z":"57b6b7bd.a84948","wires":[]},{"id":"b01f4716.4fe0b8","type":"comment","name":"Decide which side to start on?","info":"","x":329,"y":289,"z":"57b6b7bd.a84948","wires":[]}] |
now able to independently alter either light with app and slave light will only catch up each time mains to master light is switched. Does mean for a more ugly flow thou :/