Custom component Afvalbeheer - Support for multiple waste collectors

Then it should work. What’s the problem you are facing? Are the sensors giving status unknown?

Ok , then I will ask the NOOD question, how do i add it to my dashboard

Ok, when you droped the NOOB question it’s starts to work :slight_smile: :slight_smile: :slight_smile:

Hi,

How can I adjust this on date, so I know what comes first? What I mean is that the ‘vandaag’ always showing on top.

Schermafbeelding 2021-05-12 om 21.25.09

you can use the auto entities card and the Sort-date attribute of the sensor

is some one here use this blueprint?
i can’t get it to work properly.
or does some one have a nice notification that i can copy.

Hi Pippyn,

I used the auto entities card with this:

type: custom:auto-entities
card:
  type: entities
entities:
  - sensor.recycleapp_vandaag
  - sensor.recycleapp_morgen
  - sensor.recycleapp_pmd
  - sensor.recycleapp_papier
  - sensor.recycleapp_glas
  - sensor.recycleapp_restafval
sort:
  attribute: Sort-date

but it doesn’t sort unfortunately

EDIT:
Got it…

type: custom:auto-entities
card:
  type: entities
entities:
  - sensor.recycleapp_vandaag
  - sensor.recycleapp_morgen
  - sensor.recycleapp_pmd
  - sensor.recycleapp_papier
  - sensor.recycleapp_glas
  - sensor.recycleapp_restafval
sort:
  method: attribute
  attribute: Sort-date
2 Likes

Hi,

I installed your sensors with HACS. All I get is 3 sensors and they all say Unknown.
What am i doing wrong?

In config:

 - platform: afvalbeheer
    wastecollector: waardlanden            
    resources:                       
        - gft
        - papier
        - pmd
    postcode: !secret postcode
    streetnumber: !secret streetnumber
    upcomingsensor: 1
2021-08-18 15:52:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.waardlanden_required_at_least_1_required_gft_papier_pmd fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/afvalbeheer/sensor.py", line 1342, in update
collection = self.data.collections.get_first_upcoming_by_type(self.waste_type)
File "/config/custom_components/afvalbeheer/sensor.py", line 452, in collections
return self.collector.collections
AttributeError: 'NoneType' object has no attribute 'collections'
2021-08-18 15:52:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.waardlanden_required_vandaag fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/afvalbeheer/sensor.py", line 1430, in update
collections = self.data.collections.get_by_date(date, self.waste_types)
File "/config/custom_components/afvalbeheer/sensor.py", line 452, in collections
return self.collector.collections
AttributeError: 'NoneType' object has no attribute 'collections'
2021-08-18 15:52:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.waardlanden_required_morgen fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/afvalbeheer/sensor.py", line 1430, in update
collections = self.data.collections.get_by_date(date, self.waste_types)
File "/config/custom_components/afvalbeheer/sensor.py", line 452, in collections
return self.collector.collections
AttributeError: 'NoneType' object has no attribute 'collections'

First there is an indentation error in your config. Platform should be in the same “column” as wastecollector and the others.

Are you sure this is you config? Because in the error log it looks like you’ve the comments also in your config. The comments like (at least 1 required) and (required)

oh wauw rookie mistake, deleted the comments and its working now. Thanks!

Does someone have some sample automations for notifications and such? With this automation?

Would this be a valid automation? not sure about the condition

alias: Vuilnisophaling
description: ''
trigger:
  - platform: time
    at: '17:00'
condition:
  - condition: template
    value_template: '{{ state_attr(''sensor.ophaling'', ''morgen'') != "Geen" }}'
action:
  - service: notify.mobile_app_realme_matthias
    data:
      message: Morgen wordt het {{states('sensor.ophaling_morgen')}} opgehaald
      title: Vuilnis
mode: single

Is it possible to make this work for “Katwijk aan zee”

[Afvalkalender | Gemeente Katwijk] (Afvalkalender  | Gemeente Katwijk)

Or can I use any of the existed files?

Please make an issue on the github repo. Also include an address for me to test with.

Anyone noticed that included icons are not showing when in dark mode? They are there, but black on black doesn’t show.
I’m a starter with HomeAssistant, maybe i’m missing something.

This is a known issue. Sadly I’m not able to fix this. You could always provide your own icons if you want.

Is it possible to add a resource?
My location has two resources for chemical waste (KCA).
The first one is called nameType: kca halen, type: kca.
The other one is called nameType: kca brengen, type: kcalocatie.
The difference is that “halen” is collecting at your home and “brengen” is that you have to bring the waste to a dedicated location.
Wastecollector Afvalwijzer shows the two type and dates.
I can’t add the other option because only one resource is available: chemisch.

This example link shows some output.
This is a valid postcode/address in my home town but not mine.

Example MijnAfvalwijzer

@Hanb I released a new version. In v4.7.33 there is support for KCA on location.

1 Like

I used “Afvalbeheer” it works fine but if there are 2 pickups on the same day (pmd,gft) Then I’ve get an error in the pictures.
How can I fix that , 2 pictures in 1?

I am quite new to HA (so far I like it!)

I have used HACS to download the Afvalbeheer integration.

Somehow I cannot get it to work with my postcode and street number with Wastecollector Omrin. All sensors show Onbekend.

I have tried it with the address of my previous house (AreaReiniging) and this worked perfectly, the sensors showed the correct dates.

sensor:
    - platform: afvalbeheer
      wastecollector: Omrin
      resources:
        - restafval
        - gft
        - grofvuil
        - snoeiafval
      postcode: !secret postcode_afvalbeheer
      streetnumber: !secret huisnummer_afvalbeheer
      upcomingsensor: 1
      dateformat: '%d-%m-%Y'
      dateonly: 0
      dateobject: 0
      name: ''
      nameprefix: 0
      builtinicons: 1
      disableicons: 0
      dutch: 1

Postcode is set as 1111AA

When I look to Jouw afvalkalender | Omrin - Samen halen we alles eruit you have to fill in 1111 and AA separately. Can this somehow influence the sensor?

Hi @Appie,

No the postal code should be entered as one (e.g. 1111AA).
Does your address work on the Omrin website? If so, do you have any errors in your HA logs?
If not could you DM me your postal code and house number?