Custom component Afvalbeheer - Support for multiple waste collectors

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?

Thank you for the quick reply.

It does work on the Omrin website.

Logger: homeassistant
Source: custom_components/afvalbeheer/sensor.py:924
Integration: afvalbeheer ([documentation](https://github.com/pippyn/Home-Assistant-Sensor-Afvalbeheer))
First occurred: 12:54:12 (1 occurrences)
Last logged: 12:54:12

Error doing job: Task exception was never retrieved

Traceback (most recent call last): File "/config/custom_components/afvalbeheer/sensor.py", line 461, in async_update await self.collector.update() File "/config/custom_components/afvalbeheer/sensor.py", line 924, in update for item in response: TypeError: 'NoneType' object is not iterable

This error shows the response of the API is empty.
Could you DM me your postal code and house number?
Then I’ll do some tests.

I wasn’t able to find out how to send a DM yet… oops…

@Pippyn can you DM me, so I can reply? I really don’t know how to do it. I created an account just yesterday, so I do not know all the tips and tricks in this community. Sorry!

Sure! Just did