[{"id":"99d6db8b980ef985","type":"inject","z":"56d4441d248f798b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":650,"y":300,"wires":[["352ad0a8d7f62066"]]},{"id":"658fe0ff7e2dcec0","type":"sunrise","z":"56d4441d248f798b","name":"","lat":"55.98","lon":"22.22","start":"sunrise","end":"sunset","soff":"0","eoff":"0","x":250,"y":300,"wires":[["0bc9eca035179703"],[]]},{"id":"0bc9eca035179703","type":"function","z":"56d4441d248f798b","name":"var itsDay","func":"flow.set(\"itsDay\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":300,"wires":[[]]},{"id":"9e642cf3726edd8b","type":"switch","z":"56d4441d248f798b","name":"","property":"itsDay","propertyType":"flow","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":380,"wires":[["90be0bb702d8a458","b370a13fb1ac90fa"],[]]},{"id":"90be0bb702d8a458","type":"trigger","z":"56d4441d248f798b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":430,"y":380,"wires":[[],["1cffa860b8ebd50c"]]},{"id":"b370a13fb1ac90fa","type":"switch","z":"56d4441d248f798b","name":"itsOff","property":"onoff","propertyType":"flow","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":420,"wires":[["1084321ee9cd3d78"]]},{"id":"1cffa860b8ebd50c","type":"switch","z":"56d4441d248f798b","name":"itsOn","property":"onoff","propertyType":"flow","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":380,"wires":[["fa4056e67efd3a52"]]},{"id":"fa4056e67efd3a52","type":"change","z":"56d4441d248f798b","name":"OsWej_Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"},{"t":"set","p":"onoff","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":380,"wires":[[]]},{"id":"1084321ee9cd3d78","type":"change","z":"56d4441d248f798b","name":"OsWej_On","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"},{"t":"set","p":"onoff","pt":"flow","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":420,"wires":[[]]},{"id":"352ad0a8d7f62066","type":"change","z":"56d4441d248f798b","name":"Set_Off","rules":[{"t":"set","p":"onoff","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":300,"wires":[[]]},{"id":"e8db26a082db0f83","type":"comment","z":"56d4441d248f798b","name":"wej czujnika drzwi","info":"","x":110,"y":380,"wires":[]},{"id":"6882712d10d28a82","type":"comment","z":"56d4441d248f798b","name":"Wyj włącznika św","info":"","x":910,"y":400,"wires":[]}]
Na początku trzeba dodać stan Twojej czujki drzwiowej, na wyjściu otrzymujesz dwa payload “on off”.
Wej/wyj musisz dostosować do swoich potrzeb. Logika zaczyna mierzyć czas do wyłączenia po ostatniej zmianie stanu wej.
Nod Sun wymaga ustawienia współrzędnych geo.