Harmonogram wywozu odpadów – Home Assistant, NodeRed
Na całym świecie śmieci są problemem, u mnie w domu też… Głównie dlatego że nie pamiętam kiedy, które zabierają. Szukałem jakiegoś dodatku do pilnowania tego i wizualizacji, ale nic do mnie nie trafiło. No to trochę popisałem w NodeRed. Całość prezentuje się jak na poniższym obrazku, a wyświetlana jest na tablecie wiszącym na ścianie. Dzień przed wywozem przy dacie wyświetlana jest czerwona flaga, w dniu wywozu kosz na śmieci :).
Komponenty potrzebne aby uzyskać efekt jak na obrazku:
- Home Assistant
- NodeRed
- NodeRed Campanion (instalacja integracji przez HACS/Integracje, po zainstalowaniu – Ustawienia/Urządzenia oraz usługi/Integracje -> Dodaj integrację i szukamy “Node-RED Campation“)
- Multiple Entity Row (Instalacja przez HACS/Interfejs użytkownika )
Instalacja
Przechodzimy do NodeRed, w prawym górnym rogu wybieramy hamburgera (trzy poziome kreski) i “Import“
Poniżej klikamy przycisk “Kopiuj” i zawartość wklejamy w okno importu NodeRed
[{"id":"67ea5c5f644f3e5c","type":"tab","label":"Smieci","disabled":false,"info":"","env":[]},{"id":"2f57e06e04a6839a","type":"function","z":"67ea5c5f644f3e5c","name":"zmieszane","func":"var dataIn = msg.payload;\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('zmieszane') > daysDiff)) {\n flow.set('zmieszane', daysDiff);\n flow.set('zmieszaneData', dataIn);\n}\n\nif (flow.get('zmieszane') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('zmieszane') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('zmieszane') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('zmieszane') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":360,"wires":[["a53ee8a11fc31c94","31489a2dbf0f8b96"]]},{"id":"a53ee8a11fc31c94","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"zmieszaneZa","entityConfig":"581e755081b9f058","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":730,"y":300,"wires":[[]]},{"id":"31489a2dbf0f8b96","type":"function","z":"67ea5c5f644f3e5c","name":"zmieszaneData","func":"return { payload: flow.get('zmieszaneData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":360,"wires":[["9dca44aa7460eeee"]]},{"id":"9dca44aa7460eeee","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"zmieszaneData","entityConfig":"ee4014b3837632cb","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":940,"y":360,"wires":[[]]},{"id":"86f2f4782ae5a9d4","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"14","topic":"","payload":"2023/06/21","payloadType":"str","x":290,"y":280,"wires":[["2f57e06e04a6839a"]]},{"id":"f8e72159cdc46383","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"15","topic":"","payload":"2023/07/05","payloadType":"str","x":290,"y":320,"wires":[["2f57e06e04a6839a"]]},{"id":"e1b1fc77f5f75c63","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"16","topic":"","payload":"2023/07/19","payloadType":"str","x":290,"y":360,"wires":[["2f57e06e04a6839a"]]},{"id":"bd2a1cde71318532","type":"function","z":"67ea5c5f644f3e5c","name":"bio","func":"var dataIn = msg.payload;\n\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('bio') > daysDiff)) {\n flow.set('bio', daysDiff);\n flow.set('bioData', dataIn);\n}\n\nif (flow.get('bio') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('bio') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('bio') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('bio') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":800,"wires":[["5748aeff6c73efbc","9aebe2a4e2c45f78"]]},{"id":"5748aeff6c73efbc","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"bioZa","entityConfig":"262ac0a4784f0a74","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":710,"y":740,"wires":[[]]},{"id":"9aebe2a4e2c45f78","type":"function","z":"67ea5c5f644f3e5c","name":"bioData","func":"return { payload: flow.get('bioData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":800,"wires":[["58393ecedccab829"]]},{"id":"58393ecedccab829","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"bioData","entityConfig":"5f9bdf0c7ef0f0e0","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":920,"y":800,"wires":[[]]},{"id":"c885fe94c6dd07bf","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"21","topic":"","payload":"2023/07/04","payloadType":"str","x":290,"y":760,"wires":[["bd2a1cde71318532"]]},{"id":"9082bb8a3063669a","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"22","topic":"","payload":"2023/07/18","payloadType":"str","x":290,"y":820,"wires":[["bd2a1cde71318532"]]},{"id":"a18ad46f6493e26a","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"23","topic":"","payload":"2023/05/04","payloadType":"str","x":290,"y":1120,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"2a1ac1d11f82cc1b","type":"function","z":"67ea5c5f644f3e5c","name":"plastik","func":"var dataIn = msg.payload;\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('plastik') > daysDiff)) {\n flow.set('plastik', daysDiff);\n flow.set('plastikData', dataIn);\n}\n\nif (flow.get('plastik') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('plastik') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('plastik') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('plastik') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":1260,"wires":[["4dd0b1222551404e","c2b986cb8e58b7d0"]]},{"id":"4dd0b1222551404e","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"plastikZa","entityConfig":"1ca4de7d433b57d1","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":720,"y":1200,"wires":[[]]},{"id":"c2b986cb8e58b7d0","type":"function","z":"67ea5c5f644f3e5c","name":"plastikData","func":"return { payload: flow.get('plastikData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":1260,"wires":[["c34a4e3f233b9e13"]]},{"id":"c34a4e3f233b9e13","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"plastikData","entityConfig":"3a89fd8b2bd14679","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":930,"y":1260,"wires":[[]]},{"id":"446b69efe997d5b4","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"24","topic":"","payload":"2023/05/17","payloadType":"str","x":290,"y":1180,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"c833dbd79bd62c1c","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"25","topic":"","payload":"2023/05/31","payloadType":"str","x":290,"y":1240,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"34f8d632bd395c07","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"26","topic":"","payload":"2023/06/14","payloadType":"str","x":290,"y":1300,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"8dfcde0aca400088","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"27","topic":"","payload":"2023/06/28","payloadType":"str","x":290,"y":1360,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"5130200b831575ee","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"28","topic":"","payload":"2023/07/12","payloadType":"str","x":290,"y":1420,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"55310e69d6224853","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"29","topic":"","payload":"2023/07/26","payloadType":"str","x":290,"y":1480,"wires":[["2a1ac1d11f82cc1b"]]},{"id":"51e889d1028a2663","type":"function","z":"67ea5c5f644f3e5c","name":"szklo","func":"var dataIn = msg.payload;\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('szklo') > daysDiff)) {\n flow.set('szklo', daysDiff);\n flow.set('szkloData', dataIn);\n}\n\nif (flow.get('szklo') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('szklo') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('szklo') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('szklo') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":1720,"wires":[["df62d3422839c3ec","617fbc10a73992ce"]]},{"id":"df62d3422839c3ec","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"szkloZa","entityConfig":"4630b1a4733bafdb","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":720,"y":1660,"wires":[[]]},{"id":"617fbc10a73992ce","type":"function","z":"67ea5c5f644f3e5c","name":"szkloData","func":"return { payload: flow.get('szkloData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":1720,"wires":[["e11e2164a5a60255"]]},{"id":"e11e2164a5a60255","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"szkloData","entityConfig":"e3576b6f1cd870d3","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":920,"y":1720,"wires":[[]]},{"id":"0e3efc302a0e61c9","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"30","topic":"","payload":"2023/05/15","payloadType":"str","x":290,"y":1660,"wires":[["51e889d1028a2663"]]},{"id":"9457d078e4605af7","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"31","topic":"","payload":"2023/06/12","payloadType":"str","x":290,"y":1720,"wires":[["51e889d1028a2663"]]},{"id":"afc7b16570e54120","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"32","topic":"","payload":"2023/07/10","payloadType":"str","x":290,"y":1780,"wires":[["51e889d1028a2663"]]},{"id":"58f3ec60e2949dd2","type":"function","z":"67ea5c5f644f3e5c","name":"papier","func":"var dataIn = msg.payload;\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('papier') > daysDiff)) {\n flow.set('papier', daysDiff);\n flow.set('papierData', dataIn);\n}\n\nif (flow.get('papier') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('papier') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('papier') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('papier') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":1940,"wires":[["b33e47fdb19e404b","dbc5cfce3565a6ec"]]},{"id":"b33e47fdb19e404b","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"papierZa","entityConfig":"5bbb3cf8f3b011a1","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":720,"y":1880,"wires":[[]]},{"id":"dbc5cfce3565a6ec","type":"function","z":"67ea5c5f644f3e5c","name":"papierData","func":"return { payload: flow.get('papierData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":1940,"wires":[["30464e8f0c24a528"]]},{"id":"30464e8f0c24a528","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"papierData","entityConfig":"84e1274c30a9914b","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":930,"y":1940,"wires":[[]]},{"id":"1f52dab7378b54a5","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"33","topic":"","payload":"2023/05/18","payloadType":"str","x":290,"y":1880,"wires":[["58f3ec60e2949dd2"]]},{"id":"181177f42cc6df30","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"34","topic":"","payload":"2023/06/22","payloadType":"str","x":290,"y":1940,"wires":[["58f3ec60e2949dd2"]]},{"id":"bfbbeb80f3b0583e","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"35","topic":"","payload":"2023/07/20","payloadType":"str","x":290,"y":2000,"wires":[["58f3ec60e2949dd2"]]},{"id":"e24280cce4dadb73","type":"function","z":"67ea5c5f644f3e5c","name":"gabaryty","func":"var dataIn = msg.payload;\n\nvar firstDate = new Date(dataIn)\nfirstDate.setHours(0, 0, 0, 0);\n\nvar secondDate = new Date()\nsecondDate.setHours(0, 0, 0, 0);\n\nconst firstDateInMs = firstDate.getTime()\nconst secondDateInMs = secondDate.getTime()\n\nconst differenceBtwDates = firstDateInMs - secondDateInMs\n\nconst aDayInMs = 24 * 60 * 60 * 1000\n\nconst daysDiff = Math.round(differenceBtwDates / aDayInMs)\n\nif ((daysDiff >= 0) && (flow.get('gabaryty') > daysDiff)) {\n flow.set('gabaryty', daysDiff);\n flow.set('gabarytyData', dataIn);\n}\n\nif (flow.get('gabaryty') == 0) {\n return { payload: \"🗑️\" }\n}\nif (flow.get('gabaryty') == 1) {\n return { payload: \"🚩\" }\n}\nif (flow.get('gabaryty') == 666) {\n return { payload: \"...\" }\n}\nreturn { payload: flow.get('gabaryty') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":2180,"wires":[["b3a66f205390d84e","a2cea576dc21d3ea"]]},{"id":"b3a66f205390d84e","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"gabarytyZa","entityConfig":"e0a58ee188dd5edb","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":730,"y":2120,"wires":[[]]},{"id":"a2cea576dc21d3ea","type":"function","z":"67ea5c5f644f3e5c","name":"gabarytyData","func":"return { payload: flow.get('gabarytyData') }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2180,"wires":[["5b1acc955c578cd1"]]},{"id":"5b1acc955c578cd1","type":"ha-sensor","z":"67ea5c5f644f3e5c","name":"gabarytyData","entityConfig":"244c568487f99b9a","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1090,"y":2180,"wires":[[]]},{"id":"830bb68217b3cde2","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"36","topic":"","payload":"2023/06/14","payloadType":"str","x":290,"y":2180,"wires":[["e24280cce4dadb73"]]},{"id":"25b27748a7b2aec2","type":"function","z":"67ea5c5f644f3e5c","name":"Reset","func":"var resetNumber = 666\nflow.set('zmieszane', resetNumber);\nflow.set('bio', resetNumber);\nflow.set('plastik', resetNumber);\nflow.set('szklo', resetNumber);\nflow.set('papier', resetNumber);\nflow.set('szklo', resetNumber);\nflow.set('gabaryty', resetNumber);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":120,"wires":[[]]},{"id":"de990e8715258954","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 01 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":120,"wires":[["25b27748a7b2aec2"]]},{"id":"4a5d0cb00daeadf3","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"36","topic":"","payload":"2023/06/15","payloadType":"str","x":290,"y":2260,"wires":[["e24280cce4dadb73"]]},{"id":"c2918b9f9953294b","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"36","topic":"","payload":"2023/09/22","payloadType":"str","x":290,"y":2340,"wires":[["e24280cce4dadb73"]]},{"id":"1bd97b30c840f084","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"36","topic":"","payload":"2023/12/07","payloadType":"str","x":290,"y":2400,"wires":[["e24280cce4dadb73"]]},{"id":"94b62073dc6696e9","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"36","topic":"","payload":"2024/03/22","payloadType":"str","x":290,"y":2460,"wires":[[]]},{"id":"1c61b898d87cb47c","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"16","topic":"","payload":"2023/08/02","payloadType":"str","x":290,"y":400,"wires":[["2f57e06e04a6839a"]]},{"id":"db07998f221d1bb9","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"16","topic":"","payload":"2023/08/16","payloadType":"str","x":290,"y":440,"wires":[["2f57e06e04a6839a"]]},{"id":"0a356309529f5a57","type":"inject","z":"67ea5c5f644f3e5c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"18","topic":"","payload":"2023/06/20","payloadType":"str","x":290,"y":700,"wires":[["bd2a1cde71318532"]]},{"id":"581e755081b9f058","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"zmieszaneZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"ZmieszaneZa"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"ee4014b3837632cb","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"zmieszaneData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"zmieszane data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"262ac0a4784f0a74","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"bioZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"bio za"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"5f9bdf0c7ef0f0e0","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"bioData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"bio data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"1ca4de7d433b57d1","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"plastikZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"plastik za"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"3a89fd8b2bd14679","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"plastikData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"plastik data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"4630b1a4733bafdb","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"szkloZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"szklo za"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"e3576b6f1cd870d3","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"szkloData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"szklo data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"5bbb3cf8f3b011a1","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"papierZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"papier za"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"84e1274c30a9914b","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"papierData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"papier data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"e0a58ee188dd5edb","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"gabarytyZa","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"gabaryty za"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"244c568487f99b9a","type":"ha-entity-config","server":"967d7752.3f1a08","deviceConfig":"","name":"gabarytyData","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"gabaryty data"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"967d7752.3f1a08","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Całość powinna wyglądać jak na poniższym obrazku. Klikamy “Import”
Pojawi się nowa zakładka o wdzięcznej nazwie “Smieci“, na injectach wpisujemy kolejne daty odbioru odpadów zmieszane, bio, plastik itd. Jeżeli pól jest zbyt mało można kafelek skopiować (lub w razie potrzeby usunąć). Data musi być w formacie ROK/Miesiąc/Dzień. System sam wybierze najbliższą datę wywozu nieczystości. Operację robimy raz do roku i potem samo się pilnuje. W prawym górnym rogu klikamy “Deploy“. To tyle programowania…
Wizualizacja
To oczywiście indywidualna sprawa, ja przygotowałem taki konfig pod Dashboard.
W prawym górnym rogu “Edytuj dashboard”
Na dole “DODAJ KARTĘ”
Przewijamy do dołu i wybieramy Edytor konfiguracji YAML
Poniżej klikamy przycisk “Kopiuj” i zawartość wklejamy w okno konfiguracji
type: entities entities: - type: section - entity: sensor.zmieszane_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Zmieszane: ' state_header: Data entities: - entity: sensor.zmieszaneza name: Odbiór za unit: dni - type: section - entity: sensor.bio_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Bio: ' state_header: Data entities: - entity: sensor.bio_za name: Odbiór za unit: dni - type: section - entity: sensor.plastik_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Plastik: ' state_header: Data entities: - entity: sensor.plastik_za name: Odbiór za unit: dni - type: section - entity: sensor.papier_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Papier: ' state_header: Data entities: - entity: sensor.papier_za name: Odbiór za unit: dni - type: section - entity: sensor.gabaryty_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Gabaryty: ' state_header: Data entities: - entity: sensor.gabaryty_za name: Odbiór za unit: dni - type: section - entity: sensor.szklo_data icon: mdi:trash-can type: custom:multiple-entity-row name: 'Szkło: ' state_header: Data entities: - entity: sensor.szklo_za name: Odbiór za unit: dni show_header_toggle: false state_color: true
Całość powinna prezentować się następująco:
Na pulpicie wygląda to tak:
1 KOMENTARZ
Jedna z niewielu wrzutek, w której są same konkrety, tutorial od A do Z i wszystko działa! Zasiadam do kolejnych 🙂 Dzięki