Custom component Afvalbeheer - Support for multiple waste collectors

Hi Pippyn,

Firstly, a big thank you for developing and maintaining this component ! You truly make a difference to many households.

I would like to point out that RecycleApp.be seems to have additional waste fractions to what is currently reported by the component:

  • currently 5 fractions reported by parameter ‘printwastetypes: 1’ : gft, papier, pmd, restafval, takken
  • the website calendar (see screenshots) reports also: ‘grofvuil aan huis’

Would it please be possible to add fraction ‘grofvuil’ ?

Thanks in anticipation !!!

Thank you for your kind words!

I’ll have a look

“Grofvuil” is not included in the api sadly. So there’s no way of implementing it

Many thanks for checking !

BTW: I sent a message to RecycleApp.be asking them to include “grofvuil” into the API.
Fingers crossed.

Hi Pippyn,
On Github you mention Avri wastecollector is available, at the top of this thread Avri is not listed. I installed it anyhow and got a startup notice that gft, papier, pmd are the waste types available. Good!
Bu the only sensors created are as per screenshot which doesn’t seem right.

Do I need to check further or is Avri not supported?

What is your config? It looks like you included 1 resource named “restafval_gft_papier_pmd”, these should be all unique entries. Look at the github for more detail

Oops, indeed two spaces too many :frowning:
Got four sensors now also restafval which is not available at our location.
Startup still reports the three papier, pmd en groen.
I can live with that as at least now I got the collection dates again.
Thanks for the integration and your very quick reply Pippyn !

You’re welcome

Hi @geertmeersman,

First of all: thanks a lot for sharing your code - it was exactly what I was looking for and helped a lot since I am just getting started with HA…

I’m not sure this is also the case for you, but when I used your code, sorting on state didn’t work out for me. When I changed the sorting as follows, it’s fixed:

Maybe it’s depending on the provider or on my lack of knowledge, but I thought I’d put my two cents in for people who might have the same issue.

Thanks again!

@Pippyn Thanks for the great integration; you’ve eliminated a lot of discussions here :wink:

2 Likes

If there is an pickup day with 2 items gft and plastic then I have an error in the big picture "garbage today or garbage tomorrow "
Is there a solution for?

@GH2user, I noticed you have configured your Afvalbeheer for Avri. I live also in the Area supported by Avri, but i have difficulties getting the component working. Hopefully you can help me with this?
I installed it via HACS and that seems ok. I configured the sensor in configuration.yaml as follows:

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'

  - platform: afvalbeheer
    wastecollector: Avri
    resources:
      restafval
        - gft
        - papier
        - pmd
    postcode: !secret postcode                
    streetnumber: !secret streetnumber
    upcomingsensor: 0
    dateformat: '%d-%m-%Y'
    dateonly: 0
    name: ""
    nameprefix: 1
    builtinicons: 0
    dutch: 0

But the entity status is Unknown:

At states i’l get this info:

Could you please help me to configure this component correctly?
Kind regards, Bert

you have an indentation error in your config near restafval, try this:

  - platform: afvalbeheer
    wastecollector: Avri
    resources:
        - restafval
        - gft
        - papier
        - pmd
    postcode: <my home postcode>
    streetnumber: <my home number>
    upcomingsensor: 0
    dateformat: '%d-%m-%Y'
    dateonly: 0
    name: ""
    nameprefix: 1
    builtinicons: 0
    dutch: 0

As @Pippyn says, but most likely you do not have a restafval pickup and need to bring it to the collection points.
By adding printwastetypes you can see what is availbale at your location when HA restarts, shown in the notifications.
Adding he upcoming you can see the today / tomorrow pickup.

for reference my settings;

sensor:
  platform: afvalbeheer
  wastecollector: Avri
  resources:
    - gft
    - papier
    - pmd
  postcode: SECRET
  streetnumber: SECRET
  printwastetypes: 1               # prints list of types restafval at HA restart
  upcomingsensor: 1                # creates the today and tomorrow sensors
  dateformat: '%d %b'

@Pippyn
Would it be possible to make the sensors so that we can customise the names, I prefer to have everything in english and have renamed both today/tomorrow in the code, but every update need to redo this (if I upgrade).

BTW it is really nice to see the results for avri again, thanks
HA_avri_card
today - tomorrow bins change to the appropriate image when collection is near.

Sure you can change the name of any entity in HA. Use the customize.yaml file for changing names, icons, what ever you want.

I don’t think I can change the entity_id name from

sensor.avri_vandaag to sensor.avri_today

via the customisations, I can change the friendly name.

No indeed you can change everything besides the entity_id

@Pippyn, Ai, I see my mistake with restafval (without the ‘-’)! I totally overlooked that. And @GH2user, indeed restafval is not applicable in my region.

Thank you both for the help so far. Next i have to add it to my Lovelace dashboard…

Hello,

I’m currently getting this error:

Logger: custom_components.afvalbeheer.sensor
Source: custom_components/afvalbeheer/sensor.py:1084
Integration: afvalbeheer (documentation)
First occurred: 5:22:19 PM (3 occurrences)
Last logged: 7:22:19 PM

Invalid response from server for accessToken