Read out the waste calendar

true but this line has it covered :point_down:

await page.click('.bemCookieOverlay__btn--save');

@Wurmi
i dont know if you fixed the nvm problem yet but i did some tests on running puppeteer on my PI.
its an issue with their latest version (Github issue)
After a lot of reading what worked for me was using an older version of puppeteer-core@1.20.0

Steps

Stop node-red

From /home/pi/.node-red/ run

npm uninstall puppeteer then

npm install puppeteer-core@1.20.0

Start NR

Updated Flow for PI that uses the above core version :

[{"id":"7c406736d4aa3380","type":"inject","z":"6bac277c160c8769","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":480,"wires":[["9fb94f39f2c85611"]]},{"id":"9fb94f39f2c85611","type":"function","z":"6bac277c160c8769","name":"puppeteer","func":"node.status({ fill: \"green\", shape: \"dot\", text: \"Processing...\" });\n\ntry {\n\n    node.warn(\"Creating Browser\");\n    const browser = await puppeteer.launch({\n        headless: true,\n        executablePath: '/usr/bin/chromium-browser',\n    })\n\n    node.warn(\"New Page\");\n    const page = await browser.newPage();\n    \n    node.warn(\"Go to\");\n    await page.goto('https://www.bad-schallerbach.at/system/web/kalender.aspx?sprache=1&menuonr=226753868&typids=226758838,226758840,226758842,226758844/', {\n        // waitUntil: 'networkidle2'  // <-- good practice to wait for page to fully load \n    });\n\n    node.warn(\"Click cookie\");\n    await page.click('.bemCookieOverlay__btn--save');\n\n    node.warn(\"waitForTimeout\");\n    await page.waitFor(5000)\n\n    node.warn(\"Evaluate data\");\n    msg.payload = await page.evaluate(() => {\n        // @ts-ignore\n        return Array.from(document.querySelectorAll(\".ris_table tr\")).map(el => el.innerText)\n    })\n\n    // make the data nice ;)\n    msg.payload = msg.payload.map(el => { return { \"DATUM\": el.split(\"\\n\")[0], \"TERMIN\": el.split(\"\\n\")[1] } })\n\n    node.warn(\"Close Browser\");\n    await browser.close();\n\n    node.status({});\n    return msg;\n\n\n} catch (error) {\n    node.status({});\n    node.warn(error);\n};\n\n\n\n\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"puppeteer","module":"puppeteer-core"}],"x":630,"y":480,"wires":[["9620fe8243f9691e"]]},{"id":"9620fe8243f9691e","type":"debug","z":"6bac277c160c8769","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":480,"wires":[]}]
1 Like

Thank you for your hard work. I will try that at evening, when i am back home.

Edit:

Big thanks for that. With 1.20.0 and your flow it works!

1 Like

I am looking for an easy way to evaluate the data.

I just need

  • "Gelber Sack Alle"
  • "Biotonne Alle"
  • "Hausabfall w√∂chentlich"
  • "Papiertonne Alle"

image

And if object 0 isn¬īt "Gelber Sack Alle" after weeks or month, the function should know that. So i think i have to search in the objects for the specific text.
My target is to see the next date from the mentioned emptying and also to get a msg. e.g. 1 day before. For the msg i use the Mail and / or Whatsapp node.

you can use the JS filter() method on the array

[{"id":"d360ccc42f45e0f9","type":"inject","z":"54efb553244c241f","name":"data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"DATUM\":\"DATUM\",\"TERMIN\":\"TERMIN\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"14.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"14.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"21.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"04.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"11.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"11.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"18.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"25.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"}]","payloadType":"json","x":350,"y":4740,"wires":[["87ae4eb533b0e826","137f1de3ce47d040"]]},{"id":"87ae4eb533b0e826","type":"function","z":"54efb553244c241f","name":"filter","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\" || el.TERMIN === \"Biotonne Alle\" || el.TERMIN === \"Hausabfall wöchentlich\" || el.TERMIN === \"Papiertonne Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":4740,"wires":[["be9834ef3e362aa4"]]},{"id":"be9834ef3e362aa4","type":"debug","z":"54efb553244c241f","name":"debug 23","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":4740,"wires":[]},{"id":"137f1de3ce47d040","type":"debug","z":"54efb553244c241f","name":"debug 24","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":4640,"wires":[]}]

I am a bit confused how that filter works. Debug23 returns only "Hausabfall wöchentlich" is that intended?

the filter() filters out objects from the array with exact === string matches
if you expand one by one the data array you'll see that at the point of request only had Hausabfall entries in

image

so the filter works as intended for the given sample data (in inject node for the demo flow)

the debug shows only "Hausabfall wöchentlich"
image

In den function Node the following entries get filtered?!
el.TERMIN === "Gelber Sack Alle" || el.TERMIN === "Biotonne Alle" || el.TERMIN === "Hausabfall wöchentlich" || el.TERMIN === "Papiertonne Alle")

how the "Hausabfall wöchentlich" can be displayed in the debug?

EDIT: my bad - the inject node for testing does not containing the infromation about the other one like "gelber sack"

I checked the infos from peppeteer and there are no schedule about "Gelber Sack, Papiertonne, and Biotonne"

yes .. and that is due to using the wrong selector in the puppeteer Function
querySelectorAll(".ris_table tr")
we will need to review that :face_with_monocle:

I'm sorry, I didn't even notice that information are still missing

if its work correctly, I would try to display it as follows.

[{"id":"09e6ac2b88d8efec","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":1400,"wires":[["a1fc9f22170d60db","cfd4e592fb806b3c"]]},{"id":"a1fc9f22170d60db","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":1400,"wires":[["d3321efe6a98103b"]]},{"id":"cfd4e592fb806b3c","type":"function","z":"f1c196de.aec348","name":"TERMIN","func":"msg.payload = msg.payload.TERMIN;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":1440,"wires":[["2c8e3edb5f9e5727"]]},{"id":"d3321efe6a98103b","type":"debug","z":"f1c196de.aec348","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":1400,"wires":[]},{"id":"2c8e3edb5f9e5727","type":"debug","z":"f1c196de.aec348","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":1440,"wires":[]},{"id":"d360ccc42f45e0f9","type":"inject","z":"f1c196de.aec348","name":"data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"DATUM\":\"DATUM\",\"TERMIN\":\"TERMIN\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"14.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"14.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"21.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 4-wöchentlich\"},{\"DATUM\":\"28.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"04.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"11.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"},{\"DATUM\":\"11.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"18.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"25.11.2022 (Freitag)\",\"TERMIN\":\"Hausabfall 2-wöchentlich\"}]","payloadType":"json","x":270,"y":1260,"wires":[["87ae4eb533b0e826","137f1de3ce47d040"]]},{"id":"87ae4eb533b0e826","type":"function","z":"f1c196de.aec348","name":"filter","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\" || el.TERMIN === \"Biotonne Alle\" || el.TERMIN === \"Hausabfall wöchentlich\" || el.TERMIN === \"Papiertonne Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":1260,"wires":[["be9834ef3e362aa4","09e6ac2b88d8efec"]]},{"id":"be9834ef3e362aa4","type":"debug","z":"f1c196de.aec348","name":"debug 23","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":1260,"wires":[]},{"id":"137f1de3ce47d040","type":"debug","z":"f1c196de.aec348","name":"debug 24","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":1160,"wires":[]}]

At the end im trying to get a msg 1 day before they pick up the waste.

[{"id":"b56ba51808f6b65d","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1640,"wires":[["3e52cc1197f007e5"]]},{"id":"3e52cc1197f007e5","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1640,"wires":[["7be0cbcf5c40c699"]]},{"id":"6326fda3b8f0c38d","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1680,"wires":[["1d3933efc462e7bb"]]},{"id":"1d3933efc462e7bb","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1680,"wires":[[]]},{"id":"c0a0cde01420656f","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1600,"wires":[["70aa301ce8b40c82"]]},{"id":"70aa301ce8b40c82","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1600,"wires":[[]]},{"id":"16029a37fbc0f141","type":"function","z":"f1c196de.aec348","name":"filter Gelber Sack","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":1600,"wires":[["c0a0cde01420656f","b56ba51808f6b65d","6326fda3b8f0c38d"]]},{"id":"173d2556b38cc0c0","type":"function","z":"f1c196de.aec348","name":"filter Biotonne Alle","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Biotonne Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":1740,"wires":[["e9143163c21d627a","6f41a1dc58d86d23","80ac16323abc0778"]]},{"id":"312eeca602536bda","type":"function","z":"f1c196de.aec348","name":"filter Hausabfall wöchentlich","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Hausabfall wöchentlich\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":1880,"wires":[["566acaf7059c2e7f","c98986af83cf1aa0","0161b219579a15b1"]]},{"id":"f877a732a1657b3e","type":"function","z":"f1c196de.aec348","name":"filter Papiertonne Alle","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Papiertonne Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":2020,"wires":[["23d278a12374fa3f","71299bd348e489d1","a637380559dbf2db"]]},{"id":"6f41a1dc58d86d23","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1780,"wires":[["50740c9dfc289883"]]},{"id":"50740c9dfc289883","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1780,"wires":[[]]},{"id":"80ac16323abc0778","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1820,"wires":[["f69d52c9dfe4d04f"]]},{"id":"f69d52c9dfe4d04f","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1820,"wires":[[]]},{"id":"e9143163c21d627a","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1740,"wires":[["804ec6e12ac393ca"]]},{"id":"804ec6e12ac393ca","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1740,"wires":[[]]},{"id":"c98986af83cf1aa0","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1920,"wires":[["3ad4367a14f946b0"]]},{"id":"3ad4367a14f946b0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1920,"wires":[[]]},{"id":"0161b219579a15b1","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1960,"wires":[["192a641e27acf753"]]},{"id":"192a641e27acf753","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1960,"wires":[[]]},{"id":"566acaf7059c2e7f","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1880,"wires":[["1a2ef3064b6ce0d0"]]},{"id":"1a2ef3064b6ce0d0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":1880,"wires":[[]]},{"id":"71299bd348e489d1","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":2060,"wires":[["c30e42de091ae05a"]]},{"id":"c30e42de091ae05a","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":2060,"wires":[[]]},{"id":"a637380559dbf2db","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":2100,"wires":[["2f05b904526d2612"]]},{"id":"2f05b904526d2612","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":2100,"wires":[[]]},{"id":"23d278a12374fa3f","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":2020,"wires":[["3069d8f819c0d4b8"]]},{"id":"3069d8f819c0d4b8","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":2020,"wires":[[]]},{"id":"2c29c057b33cc9e8","type":"function","z":"f1c196de.aec348","name":"filter","func":"msg.payload = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\" || el.TERMIN === \"Biotonne Alle\" || el.TERMIN === \"Hausabfall wöchentlich\" || el.TERMIN === \"Papiertonne Alle\")\n})\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":1540,"wires":[["16029a37fbc0f141","173d2556b38cc0c0","312eeca602536bda","f877a732a1657b3e","a29f33ac0c93d21d"]]},{"id":"7b846a573ae31f5d","type":"inject","z":"f1c196de.aec348","name":"data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"DATUM\":\"18.08.2022 (Donnerstag)\",\"TERMIN\":\"Gelber Sack Alle\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"06.09.2022 (Dienstag)\",\"TERMIN\":\"Papiertonne Alle\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"28.09.2022 (Mittwoch)\",\"TERMIN\":\"Gelber Sack Alle\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"}]","payloadType":"json","x":290,"y":1660,"wires":[["2c29c057b33cc9e8"]]},{"id":"a29f33ac0c93d21d","type":"debug","z":"f1c196de.aec348","name":"debug 26","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":1520,"wires":[]},{"id":"7be0cbcf5c40c699","type":"change","z":"f1c196de.aec348","name":"1: mit locale und tz Ausgabe","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"1: \" & $moment(payload, 'DD/MM/YYYY').locale(\"de\").tz('Europe/Berlin').format('DD.MM.YYYY')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":1640,"wires":[["5fd4bf94.3d203"]],"info":"Trennzeichen im Datum oder Uhrzeiten werden ignoriert solange strict nicht verwendet werden bei der Eingabe"},{"id":"e4fbb89b.548c38","type":"inject","z":"f1c196de.aec348","name":"Datum heute","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":1290,"y":1540,"wires":[["44708c69.c79e84"]],"info":"is invalid when moment is defined with parameter.\nUse empty array or object."},{"id":"44708c69.c79e84","type":"change","z":"f1c196de.aec348","name":"1: mit locale und tz Ausgabe","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"1: \" & $moment(payload).locale(\"de\").tz('Europe/Berlin').format('DD.MM.YYYY')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":1600,"wires":[["5fd4bf94.3d203"]],"info":"Achtung bei Stringeingaben - wenn kein Datumsformat angegeben wird, dann wird amerikanisch interpretiert - also MOnat vor Tag"},{"id":"5fd4bf94.3d203","type":"join","z":"f1c196de.aec348","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1530,"y":1620,"wires":[["3baa06b3.7b18fa","68329281a78a43d2"]]},{"id":"3baa06b3.7b18fa","type":"function","z":"f1c196de.aec348","name":"Compare Times","func":"newmsg = {};\nif (msg.payload[0] == msg.payload[1]-1) {\n    newmsg.payload = \"True\";\n} else {\n    newmsg.payload = \"False\";\n}\nreturn newmsg;","outputs":1,"noerr":3,"initialize":"","finalize":"","libs":[],"x":1720,"y":1620,"wires":[["5c41bd3e849354ed"]]},{"id":"68329281a78a43d2","type":"debug","z":"f1c196de.aec348","name":"debug 28","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1700,"y":1680,"wires":[]},{"id":"5c41bd3e849354ed","type":"debug","z":"f1c196de.aec348","name":"debug 29","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1900,"y":1680,"wires":[]}]

Thats my try for filtering the date out of the msg and to get a actual date.
Now i need to compare them and if its one day before the garbage collection i need a "true" or something else.
Maybe there is an easier or more elegant way available by using a function node.
i will keep on trying :slight_smile:

i see you tried to use the moment library .. nice

maybe this can clean a bit of the data structure

image

[{"id":"2c29c057b33cc9e8","type":"function","z":"54efb553244c241f","name":"filter","func":"\n// keep only the date - remove day word\nmsg.payload = msg.payload.map(el => {\n    return { ...el, DATUM: el.DATUM.split(\" \")[0] }\n});\n\n// gelber\nlet gelber = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// biotonne\nlet biotonne = msg.payload.filter(el => {\n    return (el.TERMIN === \"Biotonne Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// hausabfall\nlet hausabfall = msg.payload.filter(el => {\n    return (el.TERMIN === \"Hausabfall wöchentlich\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// papiertonne\nlet papiertonne = msg.payload.filter(el => {\n    return (el.TERMIN === \"Papiertonne Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});;\n\n\nlet newMsg = { payload: { gelber, biotonne, hausabfall, papiertonne } }\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":490,"y":2240,"wires":[["a29f33ac0c93d21d"]]},{"id":"7b846a573ae31f5d","type":"inject","z":"54efb553244c241f","name":"data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"DATUM\":\"18.08.2022 (Donnerstag)\",\"TERMIN\":\"Gelber Sack Alle\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"19.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"26.08.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"02.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"06.09.2022 (Dienstag)\",\"TERMIN\":\"Papiertonne Alle\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"09.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"16.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"23.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"28.09.2022 (Mittwoch)\",\"TERMIN\":\"Gelber Sack Alle\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"30.09.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Biotonne Alle\"},{\"DATUM\":\"07.10.2022 (Freitag)\",\"TERMIN\":\"Hausabfall wöchentlich\"}]","payloadType":"json","x":330,"y":2240,"wires":[["2c29c057b33cc9e8"]]},{"id":"a29f33ac0c93d21d","type":"debug","z":"54efb553244c241f","name":"debug 26","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":2240,"wires":[]}]
1 Like

Thank you very much. That makes it a lot easier for me.

Here is the finished flow:

[{"id":"b56ba51808f6b65d","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.gelber[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":840,"wires":[["3e52cc1197f007e5"]]},{"id":"3e52cc1197f007e5","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":840,"wires":[["046ac92ca0f03489"]]},{"id":"6326fda3b8f0c38d","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.gelber[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":880,"wires":[["1d3933efc462e7bb"]]},{"id":"1d3933efc462e7bb","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":880,"wires":[["fd102484e884f383"]]},{"id":"c0a0cde01420656f","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.gelber[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":800,"wires":[["70aa301ce8b40c82","296a017e4f47aea2"]]},{"id":"70aa301ce8b40c82","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":800,"wires":[["b1d4b405fecfe897"]]},{"id":"50740c9dfc289883","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1020,"wires":[["50beebadaca20e79"]]},{"id":"f69d52c9dfe4d04f","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1060,"wires":[["554643eec03d3cfb"]]},{"id":"804ec6e12ac393ca","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":980,"wires":[["3fb3ab8f9bc45276"]]},{"id":"3ad4367a14f946b0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1200,"wires":[["4938f333a7a2816e"]]},{"id":"192a641e27acf753","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1240,"wires":[["b28579ba0c43e9ba"]]},{"id":"1a2ef3064b6ce0d0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1160,"wires":[["b981eaec726815f9"]]},{"id":"c30e42de091ae05a","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1380,"wires":[["e0f2ad8fb86e268a"]]},{"id":"2f05b904526d2612","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1420,"wires":[["31e3823a7b1b97c1"]]},{"id":"3069d8f819c0d4b8","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1340,"wires":[["6513288a6084ab44"]]},{"id":"cc2e1f586dc9070f","type":"function","z":"f1c196de.aec348","name":"filter","func":"\n// keep only the date - remove day word\nmsg.payload = msg.payload.map(el => {\n    return { ...el, DATUM: el.DATUM.split(\" \")[0] }\n});\n\n// gelber\nlet gelber = msg.payload.filter(el => {\n    return (el.TERMIN === \"Gelber Sack Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// biotonne\nlet biotonne = msg.payload.filter(el => {\n    return (el.TERMIN === \"Biotonne Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// hausabfall\nlet hausabfall = msg.payload.filter(el => {\n    return (el.TERMIN === \"Hausabfall w√∂chentlich\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// papiertonne\nlet papiertonne = msg.payload.filter(el => {\n    return (el.TERMIN === \"Papiertonne Alle\")\n}).map(el => {\n    return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});;\n\n\nlet newMsg = { payload: { gelber, biotonne, hausabfall, papiertonne } }\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":510,"y":840,"wires":[["c0a0cde01420656f","b56ba51808f6b65d","6326fda3b8f0c38d","779a46d5a2fcdd30","c3c85378f0ed9859","cf2ba86ac9283e32","4661ee117dfce15b","8d274eaef7960e0a","ee524628c22280de","a775b9d5b7381eb7","9b7e5d6c1b1be908","c24b06476a636048"]]},{"id":"779a46d5a2fcdd30","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.biotonne[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":980,"wires":[["804ec6e12ac393ca","e0aa04c4bd95d0c1"]]},{"id":"c3c85378f0ed9859","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.biotonne[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1020,"wires":[["50740c9dfc289883"]]},{"id":"cf2ba86ac9283e32","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.biotonne[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1060,"wires":[["f69d52c9dfe4d04f"]]},{"id":"4661ee117dfce15b","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.hausabfall[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1160,"wires":[["1a2ef3064b6ce0d0","5552188f551028c2"]]},{"id":"8d274eaef7960e0a","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.hausabfall[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1200,"wires":[["3ad4367a14f946b0"]]},{"id":"ee524628c22280de","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.hausabfall[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1240,"wires":[["192a641e27acf753"]]},{"id":"a775b9d5b7381eb7","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.papiertonne[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1340,"wires":[["3069d8f819c0d4b8","9c4dc7bc6839d11d"]]},{"id":"9b7e5d6c1b1be908","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.papiertonne[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1380,"wires":[["c30e42de091ae05a"]]},{"id":"c24b06476a636048","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.papiertonne[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1420,"wires":[["2f05b904526d2612"]]},{"id":"b1d4b405fecfe897","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":800,"wires":[[]]},{"id":"046ac92ca0f03489","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":840,"wires":[[]]},{"id":"3fb3ab8f9bc45276","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":980,"wires":[[]]},{"id":"b981eaec726815f9","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1160,"wires":[[]]},{"id":"6513288a6084ab44","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1340,"wires":[[]]},{"id":"50beebadaca20e79","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1020,"wires":[[]]},{"id":"554643eec03d3cfb","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1060,"wires":[[]]},{"id":"4938f333a7a2816e","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1200,"wires":[[]]},{"id":"b28579ba0c43e9ba","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1240,"wires":[[]]},{"id":"e0f2ad8fb86e268a","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1380,"wires":[[]]},{"id":"31e3823a7b1b97c1","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1420,"wires":[[]]},{"id":"fd102484e884f383","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":880,"wires":[[]]},{"id":"296a017e4f47aea2","type":"function","z":"f1c196de.aec348","name":"Gelber Sack","func":"if (msg.payload.diffDays === 1) {\n    msg.payload = true;\n} else {\n    msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":760,"wires":[["45f38632fc7c438f"]]},{"id":"e0aa04c4bd95d0c1","type":"function","z":"f1c196de.aec348","name":"Biotonne","func":"if (msg.payload.diffDays === 1) {\n    msg.payload = true;\n} else {\n    msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":940,"wires":[["1e3c5b386a6956ae"]]},{"id":"5552188f551028c2","type":"function","z":"f1c196de.aec348","name":"Hausm√ľll","func":"if (msg.payload.diffDays === 1) {\n    msg.payload = true;\n} else {\n    msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1120,"wires":[["5fc1baa55c5a9e52"]]},{"id":"9c4dc7bc6839d11d","type":"function","z":"f1c196de.aec348","name":"Papiertonne","func":"if (msg.payload.diffDays === 1) {\n    msg.payload = true;\n} else {\n    msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":1300,"wires":[["6bf0c14ef3b39705"]]},{"id":"78aadf11ce28b631","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Gelber Sack wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":760,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"1228fb13935a8453","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Biotonne wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":940,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"b87ca50236c28f53","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Hausm√ľll wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":1120,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"1cc15120ce5251c4","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Papiertonne wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":1300,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"45f38632fc7c438f","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":760,"wires":[["78aadf11ce28b631"],[]]},{"id":"1e3c5b386a6956ae","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":940,"wires":[["1228fb13935a8453"],[]]},{"id":"5fc1baa55c5a9e52","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":1120,"wires":[["b87ca50236c28f53"],[]]},{"id":"6bf0c14ef3b39705","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":1300,"wires":[["1cc15120ce5251c4"],[]]},{"id":"06599b9d50fb496a","type":"ui_group","name":"Gelber Sack","tab":"372caf308a3378d6","order":1,"disp":true,"width":"6","collapse":false},{"id":"6791309b002b5e23","type":"ui_group","name":"Biotonne","tab":"372caf308a3378d6","order":2,"disp":true,"width":"6","collapse":false},{"id":"e386b8e689808f14","type":"ui_group","name":"Hausabfall","tab":"372caf308a3378d6","order":3,"disp":true,"width":"6","collapse":false},{"id":"cd2099b85617de6d","type":"ui_group","name":"Papiertonne","tab":"372caf308a3378d6","order":4,"disp":true,"width":"6","collapse":false},{"id":"372caf308a3378d6","type":"ui_tab","name":"M√ľllabfuhr","icon":"dashboard","order":17,"disabled":false,"hidden":false}]
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.