Der Einsteiger Beispiel Flow

Um den Start etwas zu vereinfachen kann man sich diesen Flow mal importieren.
Und etwas daran rumwerkeln und probieren!

Abhängigkeit / dependence: https://flows.nodered.org/node/node-red-contrib-isonline

Hier der dazugehörige Formbeitrag: https://forum.bastelbunker.de/d/29-der-einsteiger-beispiel-flow

[{"id":"35ecb3fe.70a82c","type":"Core","z":"eeacac8e.84e57","name":"Core","ip":"","masterTopic":"","x":1750,"y":480,"wires":[[]]},{"id":"2ae8103e.2bfa8","type":"Alert Screen","z":"eeacac8e.84e57","name":"Alert Screen","x":1540,"y":440,"wires":[["35ecb3fe.70a82c"]]},{"id":"a6448772.da11e8","type":"Screen Data Update","z":"eeacac8e.84e57","name":"Screen Data Update","x":1510,"y":480,"wires":[["35ecb3fe.70a82c"]]},{"id":"5d1d17a4.067008","type":"Matrix Control","z":"eeacac8e.84e57","name":"Matrix Control","x":1530,"y":520,"wires":[["35ecb3fe.70a82c"]]},{"id":"aaebf8a3.b93f98","type":"Playlist Update","z":"eeacac8e.84e57","name":"Playlist Update","x":1530,"y":560,"wires":[["35ecb3fe.70a82c"]]},{"id":"86e00ce2.a6505","type":"Matrix Config","z":"eeacac8e.84e57","name":"Matrix Config","matrixtBrightness":85,"matrixType":2,"clockTimeZone":1,"scrollTextDefaultDelay":110,"mqttAktiv":"false","mqttServer":"","mqttPort":1883,"mqttUser":"","mqttPassword":"","mqttMasterTopic":"","x":1540,"y":400,"wires":[["35ecb3fe.70a82c"]]},{"id":"8dda7744.154fc8","type":"comment","z":"eeacac8e.84e57","name":"Alert Message","info":"","x":470,"y":380,"wires":[]},{"id":"2ae3a14.25d9d5e","type":"inject","z":"eeacac8e.84e57","name":"Push","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"0","x":630,"y":380,"wires":[["b3f96a15.ff4fb8"]]},{"id":"8ad9260b.cf8098","type":"Switch Animation","z":"eeacac8e.84e57","name":"Switch Animation","aktiv":"true","animation":"fade","x":1150,"y":380,"wires":[["b3ad9478.01eb48"]]},{"id":"b3ad9478.01eb48","type":"Text","z":"eeacac8e.84e57","name":"Text","intextString":"Pixel!!","inbigFont":"false","inscrollText":"true","inscrollTextDelay":"0","incenterText":"false","inposX":"8","inposY":"1","incolorR":"255","incolorG":"255","incolorB":"255","x":1310,"y":380,"wires":[["2ae8103e.2bfa8"]]},{"id":"a8d0668.e8c4098","type":"Screen Init","z":"eeacac8e.84e57","name":"Screen Init","inscreenName":"bra","induration":"10","x":970,"y":380,"wires":[["8ad9260b.cf8098"]]},{"id":"b3f96a15.ff4fb8","type":"Bitmap Animation","z":"eeacac8e.84e57","name":"Bitmap Animation","indata":"[43008,0,0,0,0,0,0,0,64170,0,0,0,0,0,0,0,64853,0,0,0,0,64853,0,0,65535,65535,0,0,0,65535,0,0,65535,65535,0,65535,0,65535,0,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64853,0,0,0,0,0,0,0,65535,0,0,0,0,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,0,0,0,65535,0,0,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,0,0,0,65535,0,0,65535,65535,0,0,0,65535,65535,0,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64853,0,0,0,0,0,65535,0,65535,0,0,0,0,65535,65535,0,65535,65535,0,65535,0,65535,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535]","inanimationDelay":"100","inrubberbanding":"false","inlimitLoops":"0","x":790,"y":380,"wires":[["a8d0668.e8c4098"]]},{"id":"f3f2a895.193e38","type":"http request","z":"eeacac8e.84e57","name":"Get Lux","method":"GET","ret":"txt","url":"http://192.168.0.137/api/luxsensor","tls":"","x":960,"y":580,"wires":[["d0be6521.9a50c8"]]},{"id":"d0be6521.9a50c8","type":"json","z":"eeacac8e.84e57","name":"Pars JSON","property":"payload","action":"","pretty":false,"x":1110,"y":580,"wires":[["b4533301.6b818"]]},{"id":"5206c6e3.422eb8","type":"inject","z":"eeacac8e.84e57","name":"Every 3s","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":true,"onceDelay":"0","x":580,"y":580,"wires":[["66da05c9.5ef47c"]]},{"id":"66da05c9.5ef47c","type":"is online","z":"eeacac8e.84e57","name":"check PIXEL IT is online","url":"192.168.0.137","action":"1","x":770,"y":580,"wires":[["f3f2a895.193e38"]]},{"id":"b4533301.6b818","type":"function","z":"eeacac8e.84e57","name":"Brightness Logic","func":"var lux = msg.payload.lux;\nvar brightness = 255;\nvar currentBrightness = context.get(\"currentBrightness\")||-1;\n\nif (lux <= 1)\n{\n    brightness = 20;\n}\nelse if (lux <= 5)\n{\n    brightness = 30;\n}\nelse if (lux <= 10)\n{\n    brightness = 45;\n}\nelse if (lux <= 20)\n{\n    brightness = 60;\n}\nelse if (lux <= 100)\n{\n    brightness = 80;\n}\nelse if (lux <= 250)\n{\n    brightness = 100;\n}\n\nmsg.provider = \"Brightness Logic\";\nmsg.brightness = brightness;\nnode.status({ fill: \"yellow\", shape: \"ring\", text: \"Lux: \" + lux.toFixed(3) +\" | Bri: \" + brightness });\n\nif (currentBrightness != brightness)\n{\n    node.status({ fill: \"green\", shape: \"ring\", text: \"Lux: \" + lux.toFixed(3) +\" | Bri: \" + brightness +\" send!\" });\n    context.set(\"currentBrightness\", brightness);\n    return msg;\n}","outputs":1,"noerr":0,"x":1290,"y":580,"wires":[["5d1d17a4.067008"]]},{"id":"b127dcc7.abdee","type":"comment","z":"eeacac8e.84e57","name":"Brightness Automatic","info":"","x":380,"y":580,"wires":[]},{"id":"ab30e681.56e698","type":"comment","z":"eeacac8e.84e57","name":"Internal Pixel It Clock [internal_clock]","info":"","x":620,"y":460,"wires":[]},{"id":"e2f79120.fb761","type":"inject","z":"eeacac8e.84e57","name":"Init","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"0.1","x":850,"y":460,"wires":[["341fc2fc.7d033e"]]},{"id":"341fc2fc.7d033e","type":"Screen Init","z":"eeacac8e.84e57","name":"Screen Init","inscreenName":"internal_clock","induration":"10","x":990,"y":460,"wires":[["4c2acf36.39c45"]]},{"id":"4c2acf36.39c45","type":"Switch Animation","z":"eeacac8e.84e57","name":"Switch Animation","aktiv":"true","animation":"fade","x":1170,"y":460,"wires":[["9729bfde.a1f27"]]},{"id":"9729bfde.a1f27","type":"Clock","z":"eeacac8e.84e57","name":"Clock","inswitchAktiv":"true","inswitchSec":"6","inwithSeconds":"false","incolorR":"255","incolorG":"255","incolorB":"255","x":1330,"y":460,"wires":[["a6448772.da11e8"]]},{"id":"b92c80c4.a60e9","type":"change","z":"eeacac8e.84e57","name":"Display Playlist","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"screenName\":\"Instagram\"},{\"screenName\":\"internal_clock\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1300,"y":640,"wires":[["aaebf8a3.b93f98"]]},{"id":"2723a613.25f89a","type":"inject","z":"eeacac8e.84e57","name":"Instant","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"1","x":1120,"y":640,"wires":[["b92c80c4.a60e9"]]},{"id":"c97178af.32b168","type":"comment","z":"eeacac8e.84e57","name":"Display Playlist","info":"","x":940,"y":640,"wires":[]},{"id":"e964f00e.834e6","type":"http request","z":"eeacac8e.84e57","name":"","method":"GET","ret":"txt","url":"https://www.instagram.com/_o0dennis0o_/","tls":"","x":490,"y":520,"wires":[["7eeaa50.ee7705c"]]},{"id":"7eeaa50.ee7705c","type":"function","z":"eeacac8e.84e57","name":"Extract Follower","func":"var myRegexp = /edge_followed_by\":{\"count\":(.*?)}/g;\nvar match = myRegexp.exec(msg.payload);\nmsg.payload = match[1];\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":520,"wires":[["a5a65c0c.f2497"]]},{"id":"dd221267.735cb","type":"inject","z":"eeacac8e.84e57","name":"Every 30min","topic":"","payload":"","payloadType":"date","repeat":"1800","crontab":"","once":true,"onceDelay":0.1,"x":300,"y":520,"wires":[["e964f00e.834e6"]]},{"id":"ae1584ea.048d98","type":"Text","z":"eeacac8e.84e57","name":"Text","intextString":"{{payload}}","inbigFont":"true","inscrollText":"false","inscrollTextDelay":"0","incenterText":"true","inposX":"7","inposY":"1","incolorR":"255","incolorG":"255","incolorB":"255","x":1190,"y":520,"wires":[["ef71268e.6f2fc8"]]},{"id":"df87efe.91ab01","type":"Switch Animation","z":"eeacac8e.84e57","name":"Switch Animation","aktiv":"true","animation":"fade","x":1030,"y":520,"wires":[["ae1584ea.048d98"]]},{"id":"a5a65c0c.f2497","type":"Screen Init","z":"eeacac8e.84e57","name":"Screen Init","inscreenName":"Instagram","induration":"10","x":850,"y":520,"wires":[["df87efe.91ab01"]]},{"id":"ef71268e.6f2fc8","type":"Bitmap","z":"eeacac8e.84e57","name":"Bitmap","indata":"[0, 14783, 25023, 37375, 37375, 49598, 49598, 0, 35294, 35294, 65535, 65535, 65535, 65535, 63999, 63928, 53791, 65535, 63928, 63928, 63928, 65535, 65535, 63928, 61983, 65535, 63928, 65535, 65535, 63928, 65535, 63928, 59885, 65535, 59885, 65535, 65535, 63928, 65535, 63928, 64518, 65535, 64518, 64518, 64518, 59885, 65535, 63928, 64901, 65260, 65535, 65535, 65535, 65535, 59885, 63928, 0, 65461, 65461, 65166, 64967, 62502, 64166, 0]","inposX":"0","inposY":"0","inwidth":"8","inheight":"8","x":1320,"y":520,"wires":[["a6448772.da11e8"]]},{"id":"5638a83a.89b728","type":"comment","z":"eeacac8e.84e57","name":"Instagram Follower","info":"","x":90,"y":520,"wires":[]},{"id":"2c5b612a.f90aee","type":"inject","z":"eeacac8e.84e57","name":"Set","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"0","x":1300,"y":320,"wires":[["86e00ce2.a6505"]]}]