Garbage pickup date (mijnafvalwijzer.nl) custom_component

that is what I am trying to do…

the component does Not create templates.

you either have those in your backend, in yaml or via the UI templates helpers, or, in the Frontend using custom cards (well, or the core Markdown card)

there simply is no other option.

No they are not.

maybe copied them?

Thanks a lot @Mariusthvdb.

You were correct, my mistake and thanks for pointing me in the right direction. The errors originated from template helpers.

1 Like

Hey all, soon I will release a new version with some code improvements. Also I’ve added a config_flow to make things easier for you all. I expect to release it somewhere next week, I’m testing it myself currently. I’ll keep you informed.

2 Likes

it’s done, needed to delete the old sensors, a bit of renaming, but here we are :wink: Nice indeed, thanks for the work you did.
note the ‘next’ entities are Not translated?

but, to my shock, I learned that my provider Saver will no longer be using Afvalwijzer… (notice the TBA…)

Would be truly sorry to have to leave this integration after so many years, and be forced to go to the competition (copy)

And not only because it doesnt have the day after tomorrow sensor… the entities can not be edited, the time sensors are not timestamps, and a very silly image attribute. o dear coming from Afvalwijzer, the Afvalbeheer integration really is a let down that needs to do some catching up…

Bram, please have a look if you can keep the integration up for Saver too in 2025?

2 Likes

Ofcourse I’ll try to keep the integration up for Saver for the biggest user/supporter/contributor for this component :+1:. I’ll do some research.

1 Like

let me know if I can help :wink:

So I’ve got this addon working for a while now, setting up was quite straightforward. Now I’ve noticed this in the templates: there are occasions when there are 2 types of garbage pickup on the same day. It’s always the regular one according to schedule and an occasional one like grof tuinafval or klein chemisch afval. In that case the formatted sensors don’t get any of them, due to their “if” conditions. I can / will change that, so at least one of them is displayed, but to catch every combination I fear the only thing I can do is to create more elifs. Then combined icons are the next step to display them…

original template (doesn’t work on multiple garbage types):

  - platform: template
    sensors:
      afvalwijzer_next_type_formatted:
        value_template: >-
          {% if is_state('sensor.afvalwijzer_next_type', 'gft groente-, fruit- en tuinafval') %}GFT
          {% elif is_state('sensor.afvalwijzer_next_type', 'muziekvereniging euphonia') %}Papier
          {% elif is_state('sensor.afvalwijzer_next_type', 'plastic, blik en drankenkartons') %}PMD
          {% elif is_state('sensor.afvalwijzer_next_type', 'restafval') %}Rest
          {% elif is_state('sensor.afvalwijzer_next_type', 'klein chemisch afval (kca)') %}KCA
          {% else %}Geen
          {% endif %}
        friendly_name: "Volgende type afval"

planned change (to catch at least one, preferrably the uncommon garbage type)

	{% if 'chemisch' in states('sensor.afvalwijzer_next_type') %}KCA
	{% elif 'plastic' in states('sensor.afvalwijzer_next_type') %}PMD

to catch both:

	{% if 'chemisch' in states('sensor.afvalwijzer_next_type') and 'plastic' in states('sensor.afvalwijzer_next_type') %}KCA_PMD

suppose you could write up a more automatic template, than that verbose if elif etc depending on the positioning of the separator in that string.

can you post exactly what that next_type string does in dev tools
(We never have dual trash types, so can not test here)

Also, combined icons wont exist in HA, but maybe you mean entity_picture and some of the dual type version of those?
they have been posted above, you need to look them up

this might be something by Frank Garbage pickup date (mijnafvalwijzer.nl) custom_component - #409 by fversteegen and Garbage pickup date (mijnafvalwijzer.nl) custom_component - #417 by fversteegen and Garbage pickup date (mijnafvalwijzer.nl) custom_component - #421 by fversteegen

:slight_smile:

Thanks for pointing me to the icons, I already have the original ones, creating combined icons is not a problem.

Regarding the separator: as you can see there’s a comma in the first string “plastic, blik en drankenkartons” and a second comma to seperate the first and second string. For now I’ll keep the multiple if / elifs and combined icons, as the municipality I live in changes the garbage collecting company starting from january. Might need to adapt the templates (string values) then, perhaps they use other formatting or descriptions.

well, I couldn’t manipulate it as output, that’s why I asked…
I supposed it would make sense to format those multiple trash types as a list, and doing so, allowing templates to iterate over that list.

@xirixiz would you be willing to consider a FR with that?

So I updated to the latest version through HACS, and now I don’t get any data anymore. Does anyone else have this also? It’s just like there are no entities from this component available anymore…

Of course, I was dumb enough to update this component, and HA Core and HA OS all at the same time, so I don’t know which update broke it.

Did you add the config via the now available config flow (click add integration etc etc)?

It won’t import your former entities, you need to re-setup

Oh, I missed that completely. I did read the release notes that are shown when updating, but I don’t remember this being in there.

Thanks!

1 Like

Okay, so I did the config through the new flow. I now have my entities back. I do see however that of the 3 available types of garbage (GFT, PMD and Restafval), only GTF has a next pickup-date. The other two don’t.

I don’t know if this is due to the fact that only GFT will get picked up in 2024, and the other 2 have a first date in 2025? We have Rova here.

Hi @Hobbybob, if you can send me your postal code and street number I can validate it for you.

I have sent it through PM because of privacy reasons.

Because I lost my sensors after the recent update, I went back to the previous version.

Can somebody explain what this means (English or Dutch) ? * Added config flow configuration (remove old configuration, restart, then follow the config flow by adding the integration)

How do I follow a config flow ?

it’s the procedure you enter when clicking Add Integration (Integratie toevoegen) in the UI

as you can see, I already completed the setup (the config flow…), you wont have the top left Afvalwijzer card there yet

What procedure do you mean ? Is there a button ?

did you see the screenshot?