Garbage pickup date (mijnafvalwijzer.nl) custom_component

Can you post the yaml for that card ??

did you try and find it above? its posted a few times…

1 Like

Hi,
Today I tried to setup this integration but I ran into the following error which I can’t get my head around without any help of you:

Source: custom_components/afvalwijzer/collector/mijnafvalwijzer.py:76
Integration: Sensor (documentation, issues)
First occurred: 16:13:27 (1 occurrences)
Last logged: 16:13:27

Error while setting up afvalwijzer platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/afvalwijzer/sensor.py", line 69, in async_setup_platform
    collector = await hass.async_add_executor_job(
  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/afvalwijzer/collector/mijnafvalwijzer.py", line 47, in __init__
    ) = self.get_waste_data_provider()
  File "/config/custom_components/afvalwijzer/collector/mijnafvalwijzer.py", line 76, in get_waste_data_provider
    json_response["ophaaldagen"]["data"]
KeyError: 'ophaaldagen'

I can’t find/see the sensors in my developer tools either.
What can be the case?

Could someone help me to set up afvalwijzer? I’ts pretty difficult…

show us what you did and what happened?

1 Like

For those interested in using Node-RED instead of Home Assistant automations and Template Sensors, I shared and explained my setup here: Afvalwijzer automation with Node-RED

It is, I’ve given up as well and seeing the last meaningful post was months ago, I am not the only one.
This thread is riddled with questions that do not seem to get answered.

I’d love to have just a quick manual for the basic configuration, but the github page is messy, just snippets of code without context.

I suggest you move on and find a better solution. I am currently looking at GitHub - pippyn/Home-Assistant-Sensor-Afvalbeheer: Provides Home Assistant sensors for multiple Dutch and Belgium waste collectors

1 Like

The place where I live is connected to afvalwijzer and not afvalbeheer. Thanks for the suggestion though.

I don’t know how to add (and where to find) the images to the lovelace dashboard. I do see pick-up dates at the moment.

the images are scattered around in this thread, did you search for them at all? try image in the search box…\

also, they are in the authors GitHub repo . and you can ofc add your own images if you like, there’s no such thing as The images.

if you save the images you like in a map in eg /config/www/images/afvalwijzer , you can reference then in the lovelace cards and use /local/images/afvalwijzer

1 Like

Thank you for your fast reply. I downloaded the files from HACS, so as far as I can see it downloaded everything from GitHub, so also the full repo. But I don’t know how to add the images to the lovelace card.

For now it looks like this (without the brown bar ofc):

see eg: Garbage pickup date (mijnafvalwijzer.nl) custom_component - #633 by Mariusthvdb

Hi @xirixiz
somehow Garbage pickup date (mijnafvalwijzer.nl) custom_component - #516 by niekniek89 was marked as solution to this thread, causing this:

to popup every time someone posts here. Since this is a general topic, I dont think that solution mark is appropriate and in fact rather annoying…

can you un-solve this? or would the poster in that thread need to do that

Yes I know, I already found these images. But shouldn’t I be able to find this in the custom_components folder? Since I’m new to HA.

And I would appreciate if you could help me building a card like this: Garbage pickup date (mijnafvalwijzer.nl) custom_component - #455 by Aussi

no. as I explained above, you save them in the /www folder.

that is part of my dashboard, and also posted more than a few times in this thread :wink:

since you’re new, my advise would be to take it 1 step at a time, and not try to create a rather complex card like this immediately. use the building blocks, (the image shown there is the markdown section ) and see if you can create that first. That particular section though is made with several non-afvalwijzer entities in my own config.

this is the markdown:

      - type: custom:hui-element
        card_type: markdown
        card_mod:
          style: |
            ha-card.type-markdown {
              box-shadow: none;
              margin: -8px -16px 0px -16px;
            }
        content: >
          <font color={{states('sensor.trash_color')}}><ha-icon icon= {{'mdi:delete-alert' if states('sensor.afvalwijzer_today') != 'Geen' else 'mdi:delete-outline'}}> </ha-icon></font> Vandaag, {{states('sensor.vandaag')}}: <font color= {{states('sensor.trash_color')}}>**{{states('sensor.afvalwijzer_today')|capitalize}}</font>**

          <font color={{states('sensor.trash_next_color')}}><ha-icon icon= {{states('sensor.trash_next_icon')}}> </ha-icon></font> Volgende afval-ophaal over **<font color={{states('sensor.trash_next_color')}}>{{states('sensor.afvalwijzer_next_in_days')}}</font>** {{'dag' if states('sensor.afvalwijzer_next_in_days') == '1' else 'dagen'}} op:

          <ha-icon icon= 'mdi:delete-alert'> </ha-icon> {{states('sensor.volgende_afval_ophaal_dag')}}: **<font color={{states('sensor.trash_next_color')}}>{{states('sensor.afvalwijzer_next_type')|capitalize}}</font>**

I downloaded the images and put them in the config/www/images/afvalwijzer directory. For me as a “newbie” it’s pretty difficult.

I would be happy if I could create atleast:

now show us the card config you tried, so we can help

1 Like

I used the following code (in configuration.yaml), after I downloaded afvalwijzer from HACS:

  sensor:
    - platform: afvalwijzer
      provider: mijnafvalwijzer        # (required, default = mijnafvalwijzer) either choose mijnafvalwijzer, afvalstoffendienstkalender or rova
      postal_code: 1234AB              # (required, default = '')
      street_number:  5                # (required, default = '')
      suffix: ''                       # (optional, default = '')
      exclude_pickup_today: true       # (optional, default = true) to take or not to take Today into account in the next pickup.
      default_label: Geen              # (optional, default = Geen) label if no date found
      id: ''                           # (optional, default = '') use if you'd like to have multiple waste pickup locations in HASS
      exclude_list: ''                 # (optional, default = '') comma separated list of wast types (case ignored). F.e. "papier, gft"

With provides me the following entities:

I see you are using the built-in UI for creating this card. I fear we have to stop there. you can not create the card you like in UI mode, and need YAML mode for that. Let alone all the many customizations needed for it.

You can ofc set pictures and entities, but not in the complexity of that card you posted

here’s 1 picture-entity card (already modded by card_mod), you could try in the UI editor:

            - type: picture-entity
              card_mod:
                style: |
                  ha-card {
                    box-shadow: none;
                    animation: {% if is_state('persistent_notification.trash_notification_today','notifying') and
                                       states('sensor.afvalwijzer_today') != 'Geen' %} blink 2s linear infinite;
                               {% else %} none
                               {% endif %}
                  }
                  @keyframes blink {
                    100% {opacity: 0;}
                  }

              entity: sensor.afvalwijzer_today
              name: Vandaag
              show_state: false
              state_image: &state_image
                gft: /local/afvalwijzer/gft.png
                papier: /local/afvalwijzer/papier.png
                restafval: /local/afvalwijzer/restafval.png
                plastic: /local/afvalwijzer/plastic.png
                Geen: /local/afvalwijzer/kliko_geen.png
                unknown: /local/afvalwijzer/kliko_geen.png

and copy that for the other 2 sensors

1 Like

Do I have to use this code in the UI editor or in the configuration.yaml?

Edit: when I use this in the UI editor and select entitiy sensor.afvalwijzer_today, the it says No card type found.