@range4200t
Hi Stefan
ich habe die beiden Sachen zusammengefügt.
Du kannst jetzt die Dimmer auswählen, eine Min und Max Helligkeit, und die Zeit in der die Led Heller werden soll einstellen.
[{"id":"ff2c0f7c67d94c85","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":3660,"wires":[["28b9defb0e4c8dae"]]},{"id":"d1941ad5bad23b8c","type":"ui_slider","z":"37de8ee40760efe2","name":"","label":"Nachtbeleuchtung Helligkeit max","tooltip":"","group":"9e8cb57e517ea3c3","order":3,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"100","step":"5","className":"","x":630,"y":3480,"wires":[["86efdac4bbad2140"]]},{"id":"86efdac4bbad2140","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"global.set(\"Nachtbeleuchtung_max\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":3480,"wires":[["a314c0579be69721"]]},{"id":"21c7d1ab4ce2ebf6","type":"file in","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_max","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":340,"y":3480,"wires":[["d1941ad5bad23b8c"]]},{"id":"a314c0579be69721","type":"file","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_max","filenameType":"str","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1120,"y":3480,"wires":[[]]},{"id":"ab36496b0d1d4cda","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":110,"y":3460,"wires":[["21c7d1ab4ce2ebf6","4cb8bf4c1413f3ea","e6444228cf53126f","bd2a8fb092d03b66","153e33fded2850b0"]]},{"id":"93d003be91d5575a","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":3580,"wires":[["353c7048a5f3d170"]]},{"id":"4fd1f8b20ba7a8c8","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"msg.payload = Number((msg.payload).toFixed(0));\nglobal.set(\"Lichtsensor\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":3740,"wires":[["66bd98579d62065b"]]},{"id":"4cb8bf4c1413f3ea","type":"file in","z":"37de8ee40760efe2","name":"","filename":"pekaway/Daemmerung","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":330,"y":3440,"wires":[["7f8c10e591f4446f"]]},{"id":"7f8c10e591f4446f","type":"ui_slider","z":"37de8ee40760efe2","name":"","label":"Dämmerung in Lux","tooltip":"","group":"9e8cb57e517ea3c3","order":1,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"500","step":"1","className":"","x":590,"y":3440,"wires":[["e92c416a5b82851a"]]},{"id":"e92c416a5b82851a","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"global.set(\"Daemmerung\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":3440,"wires":[["8e6429251d46a3c7"]]},{"id":"8e6429251d46a3c7","type":"file","z":"37de8ee40760efe2","name":"","filename":"pekaway/Daemmerung","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1030,"y":3440,"wires":[[]]},{"id":"66bd98579d62065b","type":"function","z":"37de8ee40760efe2","name":"Dunkel","func":"var Dunkel = msg.payload;\nvar color = color;\n\nif (Dunkel == true )\nmsg.payload = true;\nelse \nmsg.payload = false;\n\nif (msg.payload == true) { \n color = \"red\";\n } \n else {\n color = \"green\";\n } \nmsg.color = color;\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":3660,"wires":[["24262abb65e7c5ab"]]},{"id":"9ea6a4c3b20194e4","type":"function","z":"37de8ee40760efe2","name":"Nachtlicht","func":"var Licht = global.get(\"LichtsensorEin\");\nvar PIR = global.get(\"pir\");\n\nif ((Licht == true) && (PIR == true) )\nmsg.payload = true;\nelse \nmsg.payload = false;\n\n\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":3600,"wires":[["bba63929cc5c5fff","c05b4d7385c9b0c7","3c2240bfb7cab437"]]},{"id":"99e5e11957c168d5","type":"ui_text","z":"37de8ee40760efe2","group":"9e8cb57e517ea3c3","order":8,"width":0,"height":0,"name":"","label":"Dämmerung","format":"<font color ={{msg.color}}>{{msg.payload}}</font","layout":"row-spread","className":"","x":750,"y":3660,"wires":[]},{"id":"24262abb65e7c5ab","type":"change","z":"37de8ee40760efe2","name":"Dunkel Hell","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Dunkel","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"Hell","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3660,"wires":[["99e5e11957c168d5"]]},{"id":"eea1293d93b617d2","type":"change","z":"37de8ee40760efe2","name":"Licht AN AUS","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Nachtlicht ein","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"Nachtlicht aus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":3660,"wires":[["54e09f5e8dc72b13"]]},{"id":"54e09f5e8dc72b13","type":"ui_text","z":"37de8ee40760efe2","group":"9e8cb57e517ea3c3","order":7,"width":0,"height":0,"name":"","label":"Nachtlicht","format":"<font color ={{msg.color}}>{{msg.payload}}</font","layout":"row-spread","className":"","x":1310,"y":3660,"wires":[]},{"id":"83f6a22be66cc1a2","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"49","payloadType":"num","x":290,"y":3700,"wires":[["4fd1f8b20ba7a8c8"]]},{"id":"547449d4ccb5e61b","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":290,"y":3780,"wires":[["4fd1f8b20ba7a8c8"]]},{"id":"bba63929cc5c5fff","type":"function","z":"37de8ee40760efe2","name":"Nachtlicht","func":"\nvar mcp = msg.payload;\nvar color\nif (mcp == true )\nmsg.payload = true;\nelse \nmsg.payload = false;\n\nif (msg.payload == true) { \n color = \"red\";\n } \n else {\n color = \"green\";\n } \nmsg.color = color;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":950,"y":3660,"wires":[["eea1293d93b617d2"]]},{"id":"28b9defb0e4c8dae","type":"function","z":"37de8ee40760efe2","name":"check Lichtsensor","func":"var check = global.get(\"Lichtsensor\");\nvar licht = global.get(\"Daemmerung\");\n\nif(check < licht)\n{\n msg.payload = true;\n}\n\nelse\nmsg.payload = false;\nglobal.set(\"LichtsensorEin\", msg.payload);\n\nreturn msg;\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":3620,"wires":[["4ffea23f7c65cee8","66bd98579d62065b"]]},{"id":"4ffea23f7c65cee8","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"global.set(\"LichtsensorEin\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":3620,"wires":[["9ea6a4c3b20194e4"]]},{"id":"353c7048a5f3d170","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"global.set(\"pir\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":3580,"wires":[["9ea6a4c3b20194e4"]]},{"id":"ecde13e3fcf8538a","type":"switch","z":"37de8ee40760efe2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":3600,"wires":[["65a7b5cfed181b06"],["92ade3aa364cc7df"]]},{"id":"01f5402bc2e5349a","type":"comment","z":"37de8ee40760efe2","name":"hier Lichtsensor anschließen","info":"","x":240,"y":3740,"wires":[]},{"id":"044b624057e84c5a","type":"split","z":"37de8ee40760efe2","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":3580,"wires":[["8466ee851a18b8a7"]]},{"id":"1c1abaf88201cad1","type":"split","z":"37de8ee40760efe2","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":3620,"wires":[["4194a3db847bd98c"]]},{"id":"8466ee851a18b8a7","type":"switch","z":"37de8ee40760efe2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"},{"t":"eq","v":"6","vt":"str"},{"t":"eq","v":"7","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":650,"y":3760,"wires":[["c1ea53779057f64a"],["e009af1b373ab4d8"],["144fcb15b38159c7"],["6551c39b75f221f5"],["6a2de0e2d4b14518"],["be70b67eeaf5cc9b"],["abe6a3197fb5f3dc"]]},{"id":"4194a3db847bd98c","type":"switch","z":"37de8ee40760efe2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"},{"t":"eq","v":"6","vt":"str"},{"t":"eq","v":"7","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":650,"y":3940,"wires":[["a5ad7e52568032eb"],["6d5fd6260fcd421c"],["ba552671803c718b"],["b4bd6ec4d447ae49"],["3aa65e0e81cd13eb"],["cef26409d71057e4"],["bcfc93168c9fbd4a"]]},{"id":"1247af1ec72c73f8","type":"mqtt out","z":"37de8ee40760efe2","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0ddb07c65cbb68bc","x":1730,"y":3780,"wires":[]},{"id":"65a7b5cfed181b06","type":"function","z":"37de8ee40760efe2","name":"get connected Dimmer","func":"msg.payload=global.get(\"Nachtdimmer\");\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1370,"y":3580,"wires":[["044b624057e84c5a","2bdd9c86bd9df7a9"]]},{"id":"92ade3aa364cc7df","type":"function","z":"37de8ee40760efe2","name":"get connected Dimmer","func":"msg.payload=global.get(\"Nachtdimmer\");\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1370,"y":3620,"wires":[["1c1abaf88201cad1","2bdd9c86bd9df7a9"]]},{"id":"77beb91f1e62d279","type":"ui_button","z":"37de8ee40760efe2","name":"","group":"9e8cb57e517ea3c3","order":6,"width":0,"height":0,"passthru":false,"label":"Reset Nachtdimmer","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"0","payloadType":"str","topic":"topic","topicType":"msg","x":690,"y":3320,"wires":[["2500bc0161843696","7109501b541a4fc6"]]},{"id":"2bdd9c86bd9df7a9","type":"ui_text_input","z":"37de8ee40760efe2","name":"","label":"Nachtdimmer Connect Dimmer","tooltip":"mit Komma getrennt Dimmernummer - \"1,4\" ","group":"9e8cb57e517ea3c3","order":5,"width":0,"height":0,"passthru":false,"mode":"text","delay":"600","topic":"","sendOnBlur":true,"className":"","topicType":"str","x":730,"y":3340,"wires":[["2500bc0161843696","7109501b541a4fc6"]]},{"id":"7109501b541a4fc6","type":"function","z":"37de8ee40760efe2","name":"set global","func":" var str = msg.payload;\n\n global.set(\"Nachtdimmer\", str);\n \n ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1020,"y":3360,"wires":[[]]},{"id":"2500bc0161843696","type":"file","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtdimmer","filenameType":"str","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1060,"y":3320,"wires":[["2b89a706f38ecc8d"]]},{"id":"2b89a706f38ecc8d","type":"function","z":"37de8ee40760efe2","name":"","func":"msg.payload =\"Setze einen neuen Nachtdimmer\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":3320,"wires":[["f68fa0cf186684c5"]]},{"id":"f68fa0cf186684c5","type":"ui_toast","z":"37de8ee40760efe2","position":"dialog","displayTime":"3","highlight":"","sendall":false,"outputs":1,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1450,"y":3340,"wires":[[]]},{"id":"bd2a8fb092d03b66","type":"file in","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtdimmer","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":440,"y":3340,"wires":[["7109501b541a4fc6"]]},{"id":"f9ab947c602cd0d4","type":"comment","z":"37de8ee40760efe2","name":"Dimmer Auswahl","info":"","x":680,"y":3280,"wires":[]},{"id":"c05b4d7385c9b0c7","type":"function","z":"37de8ee40760efe2","name":"set global","func":" var str = msg.payload;\n\n global.set(\"MCP\", msg.payload);\n \n ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":3560,"wires":[[]]},{"id":"e798f8e430509d12","type":"comment","z":"37de8ee40760efe2","name":"Nachlicht mit dimmer, Dämmerungsschalter, Beregungsmelder","info":"","x":540,"y":3200,"wires":[]},{"id":"cd39a90b9cf81f8f","type":"comment","z":"37de8ee40760efe2","name":"Bewegungsmelder","info":"","x":150,"y":3580,"wires":[]},{"id":"31c6ed9b1b5e74d3","type":"function","z":"37de8ee40760efe2","name":"flow set ","func":"\n\nflow.set(\"zeit\", msg.payload);\n \nreturn msg\n \n ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":3400,"wires":[["eef4d51e7df4c30f"]]},{"id":"464159b14b22bbc2","type":"ui_toast","z":"37de8ee40760efe2","position":"top right","displayTime":"10","highlight":"#e83a2c","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1510,"y":3660,"wires":[]},{"id":"6cbeb9736593c964","type":"ui_toast","z":"37de8ee40760efe2","position":"top right","displayTime":"10","highlight":"#e83a2c","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1450,"y":4060,"wires":[]},{"id":"6ba46553e39fe62e","type":"comment","z":"37de8ee40760efe2","name":"Automatisch dimmen hell/dunkel","info":"","x":530,"y":3240,"wires":[]},{"id":"99cee9a3232113a2","type":"function","z":"37de8ee40760efe2","name":"set Global","func":"\n\nglobal.set(\"Nachtbeleuchtung_min\", msg.payload);\n \nreturn msg\n \n ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":3520,"wires":[["5e31818f2de559cd"]]},{"id":"24ee3fae1c09b9a3","type":"ui_slider","z":"37de8ee40760efe2","name":"","label":"Nachtbeleuchtung Helligkeit min","tooltip":"","group":"9e8cb57e517ea3c3","order":2,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"100","step":"5","className":"","x":630,"y":3520,"wires":[["99cee9a3232113a2"]]},{"id":"5e31818f2de559cd","type":"file","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_min","filenameType":"str","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1110,"y":3520,"wires":[[]]},{"id":"e6444228cf53126f","type":"file in","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_min","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":330,"y":3520,"wires":[["24ee3fae1c09b9a3"]]},{"id":"3c2240bfb7cab437","type":"rbe","z":"37de8ee40760efe2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":970,"y":3600,"wires":[["ecde13e3fcf8538a"]]},{"id":"5c18b59c9951795e","type":"ui_slider","z":"37de8ee40760efe2","name":"","label":"Zeit","tooltip":"","group":"9e8cb57e517ea3c3","order":4,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"600","step":"5","className":"","x":670,"y":3400,"wires":[["31c6ed9b1b5e74d3"]]},{"id":"eef4d51e7df4c30f","type":"file","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_Zeit","filenameType":"str","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1020,"y":3400,"wires":[[]]},{"id":"153e33fded2850b0","type":"file in","z":"37de8ee40760efe2","name":"","filename":"pekaway/Nachtbeleuchtung_Zeit","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":440,"y":3400,"wires":[["5c18b59c9951795e"]]},{"id":"efdb2020c611f37e","type":"link in","z":"37de8ee40760efe2","name":"link in 3","links":["97d47cb1d6f74894","f6b2a25939977b2f"],"x":255,"y":3580,"wires":[["93d003be91d5575a"]]},{"id":"6ddc5a6774819333","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":490,"y":3960,"wires":[["97d47cb1d6f74894"]]},{"id":"7fd992828f443ad2","type":"inject","z":"37de8ee40760efe2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":490,"y":4000,"wires":[["f6b2a25939977b2f"]]},{"id":"f6b2a25939977b2f","type":"link out","z":"37de8ee40760efe2","name":"link out 3","mode":"link","links":["efdb2020c611f37e"],"x":565,"y":4000,"wires":[]},{"id":"97d47cb1d6f74894","type":"link out","z":"37de8ee40760efe2","name":"link out 2","mode":"link","links":["efdb2020c611f37e"],"x":575,"y":3960,"wires":[]},{"id":"57e41409e8d1e4fb","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\") ;\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3720,"wires":[["c9843f3a4c57f7bf"]]},{"id":"c9843f3a4c57f7bf","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3720,"wires":[["464159b14b22bbc2"],["4c25e5621cb891b9"]]},{"id":"eed6afa7c9d4f8e0","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3740,"wires":[["8223051249166e7e"]]},{"id":"8223051249166e7e","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3740,"wires":[["464159b14b22bbc2"],["3cf514dbc07d0f41"]]},{"id":"c1ea53779057f64a","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3720,"wires":[["57e41409e8d1e4fb"]]},{"id":"e009af1b373ab4d8","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3740,"wires":[["eed6afa7c9d4f8e0"]]},{"id":"c71d818d9b2032bd","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3900,"wires":[["fe670df54805ec4d"]]},{"id":"fe670df54805ec4d","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3900,"wires":[["6cbeb9736593c964"],["fda32318b5236f0d"]]},{"id":"a5ad7e52568032eb","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3900,"wires":[["c71d818d9b2032bd"]]},{"id":"4c25e5621cb891b9","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3720,"wires":[["83a8aa9d6eadc252"]]},{"id":"83a8aa9d6eadc252","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,0,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3720,"wires":[["1247af1ec72c73f8"]]},{"id":"3cf514dbc07d0f41","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3740,"wires":[["1f05bd84912279f9"]]},{"id":"1f05bd84912279f9","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,1,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3740,"wires":[["1247af1ec72c73f8"]]},{"id":"fda32318b5236f0d","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \n\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":3900,"wires":[["83a8aa9d6eadc252"]]},{"id":"f15d4c2ddda59a0c","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3920,"wires":[["d5d222626bb4ecb3"]]},{"id":"d5d222626bb4ecb3","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3920,"wires":[["6cbeb9736593c964"],["c025de5149968351"]]},{"id":"6d5fd6260fcd421c","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3920,"wires":[["f15d4c2ddda59a0c"]]},{"id":"c025de5149968351","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":3920,"wires":[["1f05bd84912279f9"]]},{"id":"82eab488e50aaddc","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\") ;\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3760,"wires":[["822bd9075f40823a"]]},{"id":"822bd9075f40823a","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3760,"wires":[["464159b14b22bbc2"],["b1aa3fe51ba4ac29"]]},{"id":"4424e8914ed7d303","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3780,"wires":[["acf4fea5d373b59b"]]},{"id":"acf4fea5d373b59b","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3780,"wires":[["464159b14b22bbc2"],["c475c0dedfe856f6"]]},{"id":"144fcb15b38159c7","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"3","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3760,"wires":[["82eab488e50aaddc"]]},{"id":"6551c39b75f221f5","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"4","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3780,"wires":[["4424e8914ed7d303"]]},{"id":"f1c776c08a9a08f2","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3940,"wires":[["da64f2cbee7666b0"]]},{"id":"da64f2cbee7666b0","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3940,"wires":[["6cbeb9736593c964"],["3fbbfdfb7237be65"]]},{"id":"ba552671803c718b","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"3","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3940,"wires":[["f1c776c08a9a08f2"]]},{"id":"b1aa3fe51ba4ac29","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3760,"wires":[["deee82edfa64a807"]]},{"id":"c475c0dedfe856f6","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3780,"wires":[["99884f5ea8e0bba0"]]},{"id":"3fbbfdfb7237be65","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":3940,"wires":[["deee82edfa64a807"]]},{"id":"3ec4a44c6b0149c8","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3960,"wires":[["1cc8fd8f44169571"]]},{"id":"1cc8fd8f44169571","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3960,"wires":[["6cbeb9736593c964"],["2feaaf7e0ee0c0d4"]]},{"id":"b4bd6ec4d447ae49","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"4","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3960,"wires":[["3ec4a44c6b0149c8"]]},{"id":"2feaaf7e0ee0c0d4","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":3960,"wires":[["99884f5ea8e0bba0"]]},{"id":"deee82edfa64a807","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,2,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3760,"wires":[["1247af1ec72c73f8"]]},{"id":"99884f5ea8e0bba0","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,3,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3780,"wires":[["1247af1ec72c73f8"]]},{"id":"6a2de0e2d4b14518","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"5","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3800,"wires":[["784726006a95de90"]]},{"id":"be70b67eeaf5cc9b","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"6","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3820,"wires":[["9f3a986f96fbf9fe"]]},{"id":"784726006a95de90","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\") ;\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3800,"wires":[["636b18930983642a"]]},{"id":"9f3a986f96fbf9fe","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3820,"wires":[["18be720bf1051a36"]]},{"id":"636b18930983642a","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3800,"wires":[["464159b14b22bbc2"],["c3104ec0b474d3e1"]]},{"id":"18be720bf1051a36","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3820,"wires":[["464159b14b22bbc2"],["83170bb287a60d57"]]},{"id":"c3104ec0b474d3e1","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3800,"wires":[["61db3e5e0362dcd0"]]},{"id":"83170bb287a60d57","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3820,"wires":[["e480484cf034d50f"]]},{"id":"61db3e5e0362dcd0","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,4,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3800,"wires":[["1247af1ec72c73f8"]]},{"id":"e480484cf034d50f","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,5,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3820,"wires":[["1247af1ec72c73f8"]]},{"id":"cef26409d71057e4","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"6","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":4000,"wires":[["4bea7ef713cd5d27"]]},{"id":"3aa65e0e81cd13eb","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"5","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3980,"wires":[["8690f8db186820bd"]]},{"id":"8690f8db186820bd","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3980,"wires":[["fbd988286ed57254"]]},{"id":"4bea7ef713cd5d27","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":4000,"wires":[["f334f9782972d49d"]]},{"id":"fbd988286ed57254","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3980,"wires":[["6cbeb9736593c964"],["5d3432d2fac7ea13"]]},{"id":"f334f9782972d49d","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":4000,"wires":[["6cbeb9736593c964"],["d5fd60714c7f4ddc"]]},{"id":"5d3432d2fac7ea13","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":3980,"wires":[["61db3e5e0362dcd0"]]},{"id":"d5fd60714c7f4ddc","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":4000,"wires":[["e480484cf034d50f"]]},{"id":"abe6a3197fb5f3dc","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"7","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":3840,"wires":[["52f7bf1192a8a47a"]]},{"id":"52f7bf1192a8a47a","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":3840,"wires":[["945c8a5f10fc4c5b"]]},{"id":"945c8a5f10fc4c5b","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":3840,"wires":[["464159b14b22bbc2"],["0d590c5aa8e6b69f"]]},{"id":"0d590c5aa8e6b69f","type":"function","z":"37de8ee40760efe2","name":" Hell","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_max\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_min\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \ny = ((y_max - y_min) / ((x_max ) - x_min) * (x - x_min) + y_min)*40;\n \nif (mcp == true) {\n msg.payload = y ;\n}\n\nelse\n return null;\n \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":3840,"wires":[["d1da43119ba3fadc"]]},{"id":"d1da43119ba3fadc","type":"function","z":"37de8ee40760efe2","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\"; \nvar value = msg.payload;\nvar str = value.toString();\nmsg.payload = \"pwm,6,\" + str;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1530,"y":3840,"wires":[["1247af1ec72c73f8"]]},{"id":"2cc8ccb46a1362de","type":"function","z":"37de8ee40760efe2","name":" Dunkel","func":"\nvar x_min = 0;\nvar y_min = global.get(\"Nachtbeleuchtung_min\");\nvar x_max = flow.get (\"zeit\");\nvar y_max = global.get(\"Nachtbeleuchtung_max\");\nvar x = msg.payload;\nvar mcp = global.get (\"MCP\");\nvar y\n \nif (x < 2) (y = 0);\nelse\n y = ((y_max - y_min) / ((x_max) - x_min) * (x - x_min) + y_min) * 40;\n\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":4020,"wires":[["d1da43119ba3fadc"]]},{"id":"9acc27083131d665","type":"mytimeout","z":"37de8ee40760efe2","name":"Start Timer","outtopic":"","outsafe":"","outwarning":"Zeit fast abgelaufen","outunsafe":"Zeit abgelaufen","warning":"","timer":"","debug":false,"ndebug":true,"ignoreCase":false,"repeat":false,"again":false,"x":1190,"y":4020,"wires":[["6cbeb9736593c964"],["2cc8ccb46a1362de"]]},{"id":"0d33a78744b29b4a","type":"function","z":"37de8ee40760efe2","name":"ui_control","func":"var sekunden = flow.get(\"zeit\");\n\n// msg.ui_control = {\"min\":0,\"max\":10, \"seg1\":0, \"seg2\":1}\n\n\nmsg.payload=\"{\\\"payload\\\": \\\"on\\\", \\\"timeout\\\":\" + sekunden + \", \\\"warning\\\": 10}\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":4020,"wires":[["9acc27083131d665"]]},{"id":"bcfc93168c9fbd4a","type":"change","z":"37de8ee40760efe2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"7","fromt":"str","to":"Start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":4020,"wires":[["0d33a78744b29b4a"]]},{"id":"9e8cb57e517ea3c3","type":"ui_group","name":"Nachtlicht","tab":"e4484d3df7b9e639","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"0ddb07c65cbb68bc","type":"mqtt-broker","name":"","broker":"http://localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"e4484d3df7b9e639","type":"ui_tab","name":"Nachtlicht","icon":"dashboard","order":12,"disabled":false,"hidden":false}]
Du musst nur noch deinen Lichtsensor und Bewegungsmelder anschließen
Gruß
Arno