Home-Assistant integration of 'Abfall.IO' waste collection dates & schedule

Thanks, no problem. I already implemented a solution for my waste collection (via google calendar). Working fine but an addon with collecting data from a web url is much better than manually adding the ics to the calendar.
When I have some time I am going to parse the ICS file…

Hi Tom,

I came to the same conclusion and was able to adapt the component to use the json I recieved via the Ajax request. Component is working fine now.

Thanks for the help,
Nils

I had a strange bug. The order of the columns in the response no longer matches the payload. Therefore I had wrong data. I fixed it by saving the index from the first line in a dictionary.
If someone else has the same problem:

        rowCounter = 0
        columns = None
        gelberSack = []
        restAbfall = []
        papierTonne = []
        bioTonne = []
        problemStoffMobil = []
        
        for row in reader:
            if rowCounter == 0:
                columns = {k:row.index(k) for k in row}
            else:
                if (row[columns["Biotonne"]] != ""):
                    bioTonne.append(datetime.strptime(row[columns["Biotonne"]], "%d.%m.%Y"))

                if (row[columns["Restmülltonne"]] != ""):
                    restAbfall.append(datetime.strptime(row[columns["Restmülltonne"]], "%d.%m.%Y"))

                if (row[columns["Papiertonne"]] != ""):
                    papierTonne.append(datetime.strptime(row[columns["Papiertonne"]], "%d.%m.%Y"))

                if (row[columns["Gelber Sack"]] != ""):
                    gelberSack.append(datetime.strptime(row[columns["Gelber Sack"]], "%d.%m.%Y"))

                if (row[columns["Problemstoffmobil"]] != ""):
                    problemStoffMobil.append(datetime.strptime(row[columns["Problemstoffmobil"]], "%d.%m.%Y"))                        

            rowCounter = rowCounter + 1

Thanks for publishing this. I changed the code at home with your recommendation. Just in case the change the order of values in Landshut too :slight_smile: works like a charm.

if its okay, i publish the changed code on my blog.

cheers
Tom

Of course :slight_smile:

I changed the date comparisons from

if nextDate > datetime.now():

to

if nextDate.date() >= datetime.now().date():

It showed me the next date when the actual date is today on HA restart.

Thanks for this component!

Hi,

I have a google calendar integration with the dates. Is it possible to modify your module to use this google calendar? Right now I have 3 entities from the google calendar with dates but I also want to see how many days and so on.

The Date of one of these entities in found in an attribute. For Example the entity name is calendar.abfall_papier and in the atribute “start_time” is the date.

Thanks and cheers

alex

Hello,

I am pretty new to HA and just found this integration. My town works with the MyMüll App but also has a script on the homepage to get to the collection dates. Could anyone help me to find out if this website could be integrated and how:
https://abfallservice.kreis-hoexter.de/kundencenter/abfall-kalender/index.html

Thanks for your help
Berni

Hi Tom and everyone who contributed to this script,

I just wanted to say thank you for sharing this! :slight_smile:

One thing had me confused at first, though. The names for the different types of waste are not fixed. I had to rename Restmüll to Hausmüll in order to get the information I wanted. :crazy_face:

Here’s a link to my repo:

Hello everyone, can anyone tell me how to get to the dates “Kommune, Bezirk, Straße, …” come? i have received the following applink from abfall. io

I looked at the website of my local waste collector, which uses abfall.io, filled out the input selects an check boxes and then right click and ‘Inspect Element’ on the Elements in Firefox.


Was a lot of trial and error.
Good luck! :crossed_fingers:

Hello,

did i need a init.py file and how can i find it ?

This is what i have:

(hass) homeassi:~$ cat .homeassistant/custom_components/abfall_wabue/__init__.py 
DOMAIN = "abfall_wabue"

Hi Ingo,

i uploaded everything to my git, you can take a look there:

https://git.relict.de/tom/ha_abfall_landshut

Cheers
Tom

Hello everybody,

thanks for the work - I would very much like to use it too. Unfortunately I fail because I can’t find the ID for my district. If I look at abfall.io, my district is supported. but if i search on the official site, i only get a PDF or ics for download. Examine elements etc. doesn’t work or I can’t get the district ID. It’s about the community of Pleidelsheim near Ludwigsburg. The waste disposal company is called AVL. Can someone help me please?

Thank you very much
Frank

1 Like

Hi Frank,

are you talking about this service?
https://www.avl-ludwigsburg.de/privatkunden/termine/abfallkalender/abfallkalender/suche/

If yes: I couldnt find any link to abfall.io services. It seems you directly download the waste-collecting-schdules from their Typo3 file storage. So the approach which i was using doesnt work here.

Sorry

Cheers
Tom

1 Like

Hi Tom, yes correct, thats this service. Ok, so not good for me and cant use this solution here. But thanks anyway for your help.

Would like to contribute:

Service: regioIT
Regions:

  • Bergisch Gladbach (AWB / Neuenhaus)
  • Lindlar
  • ZEW
  • Dinslaken
  • Pinneberg
  • Lüdenscheid
  • Bergischer Abfallwirtschaftverbund
  • WML
  • KRWAF AWG / GEG
  • Aachen
  • Dorsten
  • Gütersloh
  • Halver
  • Coesfeld

Repository: https://github.com/tuxuser/abfallapi_regioit_ha
HA Community thread: German Müllabfuhr sensor (regioIT)
Available on HACS: YES

Service: Jumomind
Regions:

  • ZAW
  • Aurich
  • Altötting
  • Lübbecke
  • Barnim
  • Minden
  • Rhein-Hunsrück
  • Recklinghausen
  • Uckermark
    Non-working regions:
  • Bad Homburg vdH
  • Hattersheim am Main
  • Ingolstadt
  • Groß-Gerau

Repository: https://github.com/tuxuser/abfallapi_jumomind_ha
Available on HACS: YES

Service: AWB Köln
Regions:

  • Köln

Repository: https://github.com/jensweimann/awb
HA Community thread: AWB Köln garbage collection schedule
Available on HACS: YES

Hi@all

I wanted to ask if there is an easy way to get this addon work by https://daten.zkri.ch/web/Sammelkalender/sammelkalender.html, a service in switzerland with only import the csv file from rhis site??

I reverse engineered the abfallplus app and wrote a litle bash script to pull the data.
You have to login into the abfall plus app to get your cookie.
Then choose your Street and select the trash info you want to recive.

Trash ids:

664-704-v0 - 664-704-v1 - Rest
664-695-v0 - 664-695-v1 - Plastic
664-691-v0 - 664-691-v1 - Bio
664-694-v0 - 664-694-v1 - Paper
664-699-v0 - Chrismas Trees

script:

#!/bin/bash

rm /home/homeassistant/abfalldaten/data.json
rm /home/homeassistant/abfalldaten/data.xml

curl -s -H 'User-Agent: Android / MuellALARM 5.1.1 (1915051100) / DM=XT1052;DP=ghost_retasia;DN=qcom;DT=ghost;SN=motorola;SV=4.4.2 (19);MF=motorola' -H 'Host: app.abfallplus.de' -H 'Cookie:  xxxxx988cfaf08370df05cfd18c=de.k4systems.muellalarm%7C9c8bfbbb-e95c-4fe3-9af9-0d2b183d9482' --data "client=xxxxxxx-e95c-4fe3-9af9-0d2b183d9482&app_id=de.k4systems.muellalarm" --compressed 'https://app.abfallplus.de/struktur.xml.zip' > /home/homeassistant/abfalldaten/data.xml
/home/homeassistant/abfalldaten/xml2json.py -t xml2json -o /home/homeassistant/abfalldaten/data.json /home/homeassistant/abfalldaten/data.xml

data=$(cat /home/homeassistant/abfalldaten/data.json)

arrays=$(echo $data | jq '.plist.dict.array[3].dict[] | length' | wc -l)
x=0

rest=()
plastik=()
bio=()
papier=()


while [ $x -lt $arrays ];
do

     restcheck=$(echo $data | jq '.plist.dict.array[3].dict['$x'] | select(.string[].text == "664-704-v0" or .string[].text  == "664-704-v1") | .string[3].text' | head -1)
	if [ $restcheck ]; then
		rest+=("$restcheck")
	fi

     plastcheck=$(echo $data | jq '.plist.dict.array[3].dict['$x'] | select(.string[].text == "664-695-v0" or .string[].text == "664-695-v1") | .string[3].text' | head -1)
	if [ $plastcheck ]; then
		plastik+=("$plastcheck")
        fi

     biocheck=$(echo $data | jq '.plist.dict.array[3].dict['$x'] | select(.string[].text == "664-691-v0" or .string[].text == "664-691-v1") | .string[3].text' | head -1)
	if [ $biocheck ]; then
		bio+=("$biocheck")
	fi


     papiercheck=$(echo $data | jq '.plist.dict.array[3].dict['$x'] | select(.string[].text == "664-694-v0" or .string[].text == "664-694-v1") | .string[3].text' | head -1)
	if [ $papiercheck ]; then
		papier+=("$papiercheck")
	fi

x=$(( $x + 1 ))
done

rest_out=${rest[0]}
plast_out=${plastik[0]}
bio_out=${bio[0]}
papier_out=${papier[0]}

json=('{"Restmull": '$rest_out', "Plastik": '$plast_out', "Bio": '$bio_out', "Papier": '$papier_out'}')

mosquitto_pub -h 192.168.50.4 -t abfall/leerungen -m "$json" -r

Maybe this help somebody