Hallo Cupra-Bo,
sorry für die späte Antwort, aber ich war ein paar Tage verhindert.
Ich habe mal versucht meine persönlichen Infos da raus zu halten… und hoffe, das klappt so:
[{"id":"fc2b81e1.1f379","type":"google","z":"20fb6dbd.2b18b2","name":"Müllkalender","google":"","api":"calendar:v3","operation":"events.list","x":730,"y":140,"wires":[["dbd53556.6ec848"]]},{"id":"a074aecd.a30cb","type":"template","z":"20fb6dbd.2b18b2","name":"Next Abfall Event","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"calendarId\": \"<eigeneClaendarID>@group.calendar.google.com\",\n \"maxResults\": \"1\",\n \"orderBy\": \"startTime\",\n \"singleEvents\": \"true\",\n \"timeMin\": \"{{payload}}\"\n}","output":"json","x":550,"y":140,"wires":[["fc2b81e1.1f379"]]},{"id":"c3996f3f.c942b","type":"inject","z":"20fb6dbd.2b18b2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"*/20 14 * * *","once":true,"onceDelay":0.1,"x":150,"y":140,"wires":[["4363fe41.d8b8e"]]},{"id":"4363fe41.d8b8e","type":"moment","z":"20fb6dbd.2b18b2","name":"","topic":"","input":"","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"C","output":"","outputType":"msg","outTz":"Europe/Berlin","x":340,"y":140,"wires":[["a074aecd.a30cb"]]},{"id":"b9afca72.f086f8","type":"function","z":"20fb6dbd.2b18b2","name":"Set Tonne","func":"if (msg.payload == \"true\") {\n if (msg.tonne == \"Biotonne\") {\n msg.payload = \"Bio Tonne\";\n msg.bmp = '74';\n node.status({ fill: \"green\", shape: \"ring\", text: msg.payload + \" stored\" });\n }\n else if (msg.tonne == \"Gelber Sack\") {\n msg.payload = \"Gelber Sack\";\n msg.bmp = '75'; \n node.status({ fill: \"yellow\", shape: \"ring\", text: msg.payload + \" stored\" });\n }\n else if (msg.tonne == \"Altpapier\") {\n msg.payload = \"Altpapier\";\n msg.bmp = '76';\n node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload + \" stored\" });\n }\n else if (msg.tonne == \"Restmüll\") {\n msg.payload = \"Restmüll\";\n msg.bmp = '77'; \n node.status({ fill: \"grey\", shape: \"ring\", text: msg.payload + \" stored\" });\n }\n return msg;\n} else {\n msg.show = false;\n node.status({ fill: \"red\", shape: \"ring\", text: \"Keine Tonne\" + \" stored\" });\n return msg;\n}\n","outputs":1,"noerr":0,"x":400,"y":200,"wires":[["a8ead408.f7fd18"]]},{"id":"15153be0.9dd004","type":"Screen Init","z":"20fb6dbd.2b18b2","name":"Screen Init","inscreenName":"muellkalender","induration":"10","x":750,"y":200,"wires":[["fe09a9b0.370038"]]},{"id":"a8ead408.f7fd18","type":"Switch Animation","z":"20fb6dbd.2b18b2","name":"Switch Animation","aktiv":"true","animation":"fade","x":570,"y":200,"wires":[["15153be0.9dd004"]]},{"id":"8ef9ea66.7dbcd8","type":"Text","z":"20fb6dbd.2b18b2","name":"Text","intextString":"{{payload}}","inbigFont":"false","inscrollText":"auto","inscrollTextDelay":"0","incenterText":"false","inposX":"7","inposY":"1","incolorR":"255","incolorG":"255","incolorB":"255","x":1030,"y":200,"wires":[["88c381fa.1383a"]]},{"id":"fe09a9b0.370038","type":"Bitmap Animation","z":"20fb6dbd.2b18b2","name":"Bitmap","indata":"{{bmp}}","inanimationDelay":"80","inrubberbanding":"false","inlimitLoops":"1","x":900,"y":200,"wires":[["8ef9ea66.7dbcd8"]]},{"id":"dbd53556.6ec848","type":"function","z":"20fb6dbd.2b18b2","name":"parse event","func":"//Aktuelle Datum im ISO Format für heute und morgen\nvar today = new Date(); \nvar tomorrow = new Date(); \n\n//Datum von Morgen im ISO Format\ntomorrow.setDate(today.getDate()+1); \n\nvar parts = msg.payload.items[0].summary.split(\" am \");\nvar date = parts[1].split(\".\");\nvar datum = new Date(date[2], date[1]-1, date[0]);\n//var tonne = parts[0];\n\nif (datum.getTime() >= today.getTime() & \n datum.getTime() <= tomorrow.getTime()) {\n msg.payload = \"true\";\n }\nelse\n{\n msg.payload = \"false\";\n }\n\nmsg.tonne = parts[0]; \n\nnode.send(msg);","outputs":1,"noerr":0,"x":890,"y":140,"wires":[["b9afca72.f086f8"]]},{"id":"afd8ad14.586da","type":"comment","z":"20fb6dbd.2b18b2","name":"AbfallKalender [muellkalender]","info":"","x":170,"y":100,"wires":[]},{"id":"88c381fa.1383a","type":"link out","z":"20fb6dbd.2b18b2","name":"","links":["647804e.74ecdfc"],"x":1115,"y":200,"wires":[]}]
Hier muss in der Funktion Next Abfall Event
noch die eigene Calendar ID eingesetzt werden sowie in dem Coogle Connector der eigene Connector eingetragen werden.
Ich hoffe das funktioniert so für Dich.
Gruß
klik