Hallo Arno, habe es mit dem BH1750 hinbekommen:
[{"id":"995e8bf58edab759","type":"Bh1750","z":"f3d93df51e6fd80c","name":"Lichtsensor1","bus":"1","address":"0x23","topic":"bh1750","readMode":"","x":490,"y":1180,"wires":[["0eb47d581a852c85"]]},{"id":"9b50abf8f8eed940","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":1180,"wires":[["995e8bf58edab759"]]},{"id":"b4ef12fc4879a018","type":"debug","z":"f3d93df51e6fd80c","name":"debug 13","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":1180,"wires":[]},{"id":"ef6673168ff7f549","type":"mcp23017input","z":"f3d93df51e6fd80c","name":"","chip":"bf0f1697811eb554","bitNum":"0","pullUp":true,"invert":true,"debounce":200,"onMsg":true,"offMsg":true,"x":240,"y":1440,"wires":[["82d7d0786d9edfbf"]]},{"id":"c3a8ec22e820aca7","type":"ui_slider","z":"f3d93df51e6fd80c","name":"","label":"Nachtbeleuchtung Helligkeit","tooltip":"","group":"1884f74af5736225","order":6,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"100","step":"5","className":"","x":800,"y":1360,"wires":[["f2474d97887d7657"]]},{"id":"f2474d97887d7657","type":"function","z":"f3d93df51e6fd80c","name":"set Global","func":"global.set(\"Nachtbeleuchtung\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":1360,"wires":[["8184332793aca2d2","ee235bd3cb4ece99"]]},{"id":"0dd28fde9d0a0ba0","type":"mqtt out","z":"f3d93df51e6fd80c","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0ddb07c65cbb68bc","x":1430,"y":1500,"wires":[]},{"id":"4acddb508245d6b8","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":230,"y":1500,"wires":[["82d7d0786d9edfbf"]]},{"id":"22089a786045e978","type":"function","z":"f3d93df51e6fd80c","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\n\n\nif (mcp == true) {\nmsg.payload = \"pwm,0,\" + str;\n}\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1160,"y":1480,"wires":[["0dd28fde9d0a0ba0","99f277b5cda443a5"]]},{"id":"7f8f8fd3aa02c44d","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":230,"y":1540,"wires":[["82d7d0786d9edfbf"]]},{"id":"5f45b7b69bbec1f1","type":"function","z":"f3d93df51e6fd80c","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\nif (mcp == false) {\nmsg.payload = \"pwm,0,\" + \"0\";\n}\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":1520,"wires":[["0dd28fde9d0a0ba0","99f277b5cda443a5"]]},{"id":"929af14207f30132","type":"switch","z":"f3d93df51e6fd80c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":1500,"wires":[["522d594b9a89bcad"],["5f45b7b69bbec1f1"]]},{"id":"c6d4e3e45aeacdd8","type":"file in","z":"f3d93df51e6fd80c","name":"","filename":"pekaway/Nachtbeleuchtung","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":860,"y":1300,"wires":[["c3a8ec22e820aca7"]]},{"id":"8184332793aca2d2","type":"file","z":"f3d93df51e6fd80c","name":"","filename":"pekaway/Nachtbeleuchtung","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1240,"y":1360,"wires":[[]]},{"id":"2a3f8445edee4fcd","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":570,"y":1300,"wires":[["c6d4e3e45aeacdd8"]]},{"id":"99f277b5cda443a5","type":"debug","z":"f3d93df51e6fd80c","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1400,"y":1440,"wires":[]},{"id":"c81680e2fb6ba214","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"49","payloadType":"num","x":590,"y":1400,"wires":[["d121c98e520e5896"]]},{"id":"72674af072f5f570","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":590,"y":1440,"wires":[["d121c98e520e5896"]]},{"id":"d121c98e520e5896","type":"function","z":"f3d93df51e6fd80c","name":"set Global","func":"global.set(\"Lichtsensor\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":1420,"wires":[[]]},{"id":"522d594b9a89bcad","type":"function","z":"f3d93df51e6fd80c","name":"check Lichtsensor","func":"var check = global.get(\"Lichtsensor\");\n\nif(global.get(\"Lichtsensor\")<50)\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":810,"y":1480,"wires":[["1013a4a4f889e417"]]},{"id":"1013a4a4f889e417","type":"switch","z":"f3d93df51e6fd80c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":1480,"wires":[["22089a786045e978"],["5f45b7b69bbec1f1"]]},{"id":"82d7d0786d9edfbf","type":"change","z":"f3d93df51e6fd80c","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":450,"y":1500,"wires":[["929af14207f30132","caa2b370c996960a"]]},{"id":"d2930cb310fb496c","type":"comment","z":"f3d93df51e6fd80c","name":"Lichtsensor","info":"","x":230,"y":1100,"wires":[]},{"id":"0eb47d581a852c85","type":"function","z":"f3d93df51e6fd80c","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":680,"y":1180,"wires":[["b4ef12fc4879a018"]]},{"id":"ee235bd3cb4ece99","type":"debug","z":"f3d93df51e6fd80c","name":"debug 14","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":1280,"wires":[]},{"id":"caa2b370c996960a","type":"debug","z":"f3d93df51e6fd80c","name":"debug 15","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":780,"y":1580,"wires":[]},{"id":"bf0f1697811eb554","type":"mcp23017chip","addr":"0x22","interval":"100"},{"id":"1884f74af5736225","type":"ui_group","name":"Test","tab":"608293e12e898cc6","order":2,"disp":true,"width":7,"collapse":false,"className":""},{"id":"0ddb07c65cbb68bc","type":"mqtt-broker","name":"","broker":"http://localhost","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"608293e12e898cc6","type":"ui_tab","name":"Test","icon":"build","order":20,"disabled":false,"hidden":false}]