Garbage pickup date (mijnafvalwijzer.nl) custom_component

Thanks for the reply! I have monitored the sensors, and both the original ones and the new ones are being updated.

It’ll check if I can delete the old ones and rename the new ones.

Good day,

I few days ago I found this integration so I have added it to my HA.
I live in Rotterdam and if I’m correct I should select Mijn Afvalwijzer.
Then filled in the postcode. Now it still does not provide me any information and the entities stay empty.

Is the wrong selection used or is something else wrong?

Thank you.

Hi, do you have a postal code and random house number, then I`m able to validate it for you.

Hi xirixiz,

3192NC 86

Thanks for checking

Good news, the component is able to fetch data with your postcal code and house number.

However, maybe there is something wrong with your config and/or maybe another issue. Did you check the logfiles on HASS restart?

You can also add some debug info to your configuration.yaml file, then you should see the data being fetched in the logs.

logger:
  default: info
  logs:
    custom_components.afvalwijzer: debug

Another option is to check the enitites, maybe you ended up with additional entities and or entities with different names you used to have. Search for “afvalwijzer” in de developer section → states.



See both screenshots. At the developer section I see the info filled in but I do not see it at the entites on the integration page.
Do I overlook something?

Edit:
I have been able to solve it. Apparently it does not show any information on the entity tab. Once I added it to a dashboard I saw the information popping up.
Thanks for the assistance

I’ve never thought about this really, but now I see the new user show the entities…

since this is a 100% Dutch integration, why dont we use Dutch naming and entity_id’s by default, or at least as a localization.

I’ve done that manually from the start (well, except for the ‘next’ entities, I should do that…), and there is not a single issue in backend that would require the integration to be English.

just a thought?

I would suggest to keep back end English, that way also non-ditch people can jump in if someone has a problem. There are a lot of good ha specialists but not all Dutch :wink:

hmm, not sure about that requirement.

just check the Sun2 custom integration

local settings set the names and entity_id’s which really works well.

It’s all just a matter of incorporating translation files

and we’re not talking about backend system properties inside the python. obviously.

see: ha-sun2/custom_components/sun2/translations at master · pnbruckner/ha-sun2 · GitHub


There is an easy explanation. For Sun2, naming is always the same, no differences between users configuration. However, for trash each town uses it’s own naming (in Dutch), and even within the same town it differs sometimes, so that’s the reason to stick to the Dutch namings for the entities. Translating would result in extra work, and more issue.

Well, that is actually not the case on both points

First of all, sun2 is especially designed to cater for more than 1 integration per HA instance, to allow multiple locations. The naming adapts . In my screenshot notice the ‘ van Thuis’.

On the second point: I wish we would get Dutch but my main issue is that we don’t… it’s all in English

just as a FYI,
updating to the new release version, even from the current beta cycle, needs extra care.

I’ve run into serious flukes simply going from b10 to new release, and apparently the only reliable way is to delete what we have and start completely afresh.

check the GitHub for details on my troubles and more importantly, for instructions how to update best

I havent managed yet…
maybe things are going a bit too fast now, and Afvalwijzer is growing a bit too big (considering it no longer is only Afvalwijzer at all…)

Luckily we managed to help you and you are on the release now: Afvalwijzer backend not ready yet · Issue #561 · xirixiz/homeassistant-afvalwijzer · GitHub

Hi @Mariusthvdb Thanks for your input. I will discuss it with Sebastiaan as well. Although I really appreciate his help and effort (and yours too ofcourse), the users mostly care about stability, predictability, etc, etc. That is what I’ve learned in the past. Things are going a bit to fast without real need.

Things that need to be fixed will be fixed, but then I believe it’s best to leave things as is right now.

Hmm anyone else getting strange dates after the last update. ?

Seems the entities are alright but the templates I made suddenly show 1 day ahead…

Tomorrows pickup is states to be today…

Now what happened

update:

right, seems sensor next date flukes:

      - unique_id: volgende_afval_ophaal_dag
        state: >
          {% set next = states('sensor.afvalwijzer_next_date') %}
          {% set dt = next|as_datetime %}
          {% from 'easy_time.jinja' import month, weekday %}
          {% set dag = weekday(dt.isoweekday()) %}
          {% set datum = dt.day %}
          {% set maand = month(dt.month) %}
          {{dag}} {{datum}} {{maand}}

while it should be Wednesday 18

raw value is wrong, and that hasn’t happened in a very long time in the development of this integration

need to set |as_local now, which fixes that

edited my ancient auto-entities to accommodate the change requiring the as_local

  - type: custom:auto-entities
    card:
      type: entities
      state_color: true
    filter:
      include:
        - label: saver
          options:
            type: custom:template-entity-row
            image: >
              {% set trash = config.entity %}
              {% set type = trash.removeprefix('sensor.afvalwijzer_') %}
              /local/afvalwijzer/saver_{{type}}.png
            state: >
              {% set trash = config.entity %}
              {% set today = state_attr(trash,'is_collection_date_today') %}
              {% set days = state_attr(trash,'days_until_collection_date')|int(0) %}
              {% set date = states(trash)|as_datetime|as_local %}
              {% if days is none or
                 (is_state(trash,'geen') and days == 0) %} Nnb
              {% else %}
              {% from 'easy_time.jinja' import month %}
              {{date.day}} {{month(date.month)}}
              {% endif %}
            secondary: >
              {% set trash = config.entity %}
              {% set today = state_attr(trash,'is_collection_date_today') %}
              {% set days = state_attr(trash,'days_until_collection_date')|int(0) %}
              {% set date = states(trash)|as_datetime|as_local %}
              {% if future is none or
                 (is_state(trash,'geen') and future == 0) %} Nog niet bekend
              {% else %}
                {% set dagnummer = date.strftime('%w') %}
                {% from 'easy_time.jinja' import weekday %}
                {% set dag = weekday(dagnummer|int) %}
                {% set unit = 'dag' if days == 1 else 'dagen' %}

                {% if days >= 28 %} {% set phrase = dag + ' over 4 weken' %}
                {% elif days >= 21 %} {% set phrase = dag + ' over 3 weken' %}
                {% elif days >= 14 %} {% set phrase = dag + ' over 2 weken' %}
                {% elif days >= 7 %} {% set phrase = 'Volgende week ' + dag %}
                {% elif days >= 3 %} {% set phrase = 'Komende ' + dag %}
                {% elif days == 2 %} {% set phrase = dag + ', overmorgen' %}
                {% elif days == 1 %} {% set phrase = 'Morgen, ' + dag %}
                {% else %} {% set phrase = 'Vandaag, ' + dag %}
                {% endif %}
                {{phrase}} {% if days != 0 %} ({{days}} {{unit}}) {% endif %}
              {% endif %}
    sort:
      method: attribute
      attribute: days_until_collection_date
      numeric: true

full stack showing like this
Feb-18-2026 10-04-39

Full card
type: vertical-stack
card_mod: !include /config/dashboard/card_mods/stack_card_gap_shadow.yaml
cards:

  - type: markdown
    visibility:
      - condition: numeric_state
        entity: sensor.afvalwijzer_notifications
        above: 0
    content: >
      {{states('sensor.afvalwijzer_notifications')}} notifications

      Bericht: {{state_attr('sensor.afvalwijzer_notifications','notifications')}}

      Geldig vanaf: {{state_attr('sensor.afvalwijzer_notifications','last_update')
                |as_timestamp|timestamp_custom('%d-%m-%Y %X',True,'Nog niet geactiveerd')}}
  - type: heading
    heading: Ophaaldata
    heading_style: title
    card_mod:
      class: class-heading
      style:
        .: |
          .badges {
            background: var(--lovelace-background);
            padding: 4px;
            border: 2px solid {{states('sensor.volgende_afval_kleur')}}
          }

    tap_action:
      action: navigate
      navigation_path: /calendar
    badges:
      - entity: sensor.afvalwijzer_next_type
        card_mod:
          style: |
            ha-state-icon {
              --card-mod-icon: {{states('sensor.volgende_afval_icon')}};
              --mdc-icon-size: var(--ha-badge-icon-size);
            }
            state-display {
              color: {{states('sensor.volgende_afval_kleur')}};
              text-transform: capitalize;
            }
        show_state: true
        show_icon: true

      - entity: sensor.afvalwijzer_next_date
        card_mod:
          style: |
            state-display {
              color: var(--text-color-on);
            }
        show_state: true
        show_icon: false
        tap_action:
          action: more-info

  - type: markdown
    content: >
      {% set ak = states('sensor.afval_kleur') %}
      {% set vk = states('sensor.volgende_afval_kleur') %}
      {% set days = states('sensor.afvalwijzer_next_in_days')|int(0) %}

      <font color={{ak}}><ha-icon icon= {{states('sensor.afval_icon_vandaag')}}>
      </ha-icon></font> Vandaag, {{states('sensor.vandaag')}}:
      <font color= {{ak}}>**{{states('sensor.afvalwijzer_vandaag')|capitalize}}</font>**

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

      <font color={{vk}}><ha-icon icon= {{states('sensor.volgende_afval_icon')}}>
      </ha-icon></font> {{states('sensor.volgende_afval_ophaal_dag')}}:
      **<font color={{vk}}>{{states('sensor.afvalwijzer_next_type')|capitalize}}</font>**

  - type: horizontal-stack
    cards:
      - type: picture-entity
        card_mod:
          style: |
            ha-card {
              animation:
                {% if is_state('input_boolean.afvalwijzer_vandaag_notificatie','on')
                   and states('sensor.afvalwijzer_vandaag') != 'geen' -%}
                  blink 2s linear infinite;
                {% else -%} none
                {% endif %}
            }
            @keyframes blink {
              100% {opacity: 0;}
            }
        entity: sensor.afvalwijzer_vandaag
        name: Vandaag
        show_state: false
        state_image: &state_image
          gft: /local/afvalwijzer/saver_gft.png
          papier: /local/afvalwijzer/saver_papier.png
          restafval: /local/afvalwijzer/saver_restafval.png
          pbd / pmd: /local/afvalwijzer/saver_plastic.png
          geen: /local/afvalwijzer/saver_geen.png
          unknown: /local/afvalwijzer/kliko_geen.png

      - type: picture-entity
        card_mod:
          style: |
            ha-card {
              animation:
                {% if is_state('input_boolean.afvalwijzer_morgen_notificatie','on')
                    and states('sensor.afvalwijzer_morgen') != 'geen' -%}
                  blink 2s linear infinite;
                {% else -%} none
                {% endif %}
            }
            @keyframes blink {
              100% {opacity: 0.5;}
            }
        entity: sensor.afvalwijzer_morgen
        name: Morgen
        show_state: false
        state_image: *state_image

      - type: picture-entity
        entity: sensor.afvalwijzer_overmorgen
        name: Overmorgen
        show_state: false
        state_image: *state_image

  - type: custom:auto-entities
    card:
      type: entities
      state_color: true
    filter:
      include:
        - label: saver
          options:
            type: custom:template-entity-row
            image: >
              {% set trash = config.entity %}
              {% set type = trash.removeprefix('sensor.afvalwijzer_') %}
              /local/afvalwijzer/saver_{{type}}.png
            state: >
              {% set trash = config.entity %}
              {% set today = state_attr(trash,'is_collection_date_today') %}
              {% set days = state_attr(trash,'days_until_collection_date')|int(0) %}
              {% set date = states(trash)|as_datetime|as_local %}
              {% if days is none or
                 (is_state(trash,'geen') and days == 0) %} Nnb
              {% else %}
              {% from 'easy_time.jinja' import month %}
              {{date.day}} {{month(date.month)}}
              {% endif %}
            secondary: >
              {% set trash = config.entity %}
              {% set today = state_attr(trash,'is_collection_date_today') %}
              {% set days = state_attr(trash,'days_until_collection_date')|int(0) %}
              {% set date = states(trash)|as_datetime|as_local %}
              {% if future is none or
                 (is_state(trash,'geen') and future == 0) %} Nog niet bekend
              {% else %}
                {% set dagnummer = date.strftime('%w') %}
                {% from 'easy_time.jinja' import weekday %}
                {% set dag = weekday(dagnummer|int) %}
                {% set unit = 'dag' if days == 1 else 'dagen' %}

                {% if days >= 28 %} {% set phrase = dag + ' over 4 weken' %}
                {% elif days >= 21 %} {% set phrase = dag + ' over 3 weken' %}
                {% elif days >= 14 %} {% set phrase = dag + ' over 2 weken' %}
                {% elif days >= 7 %} {% set phrase = 'Volgende week ' + dag %}
                {% elif days >= 3 %} {% set phrase = 'Komende ' + dag %}
                {% elif days == 2 %} {% set phrase = dag + ', overmorgen' %}
                {% elif days == 1 %} {% set phrase = 'Morgen, ' + dag %}
                {% else %} {% set phrase = 'Vandaag, ' + dag %}
                {% endif %}
                {{phrase}} {% if days != 0 %} ({{days}} {{unit}}) {% endif %}
              {% endif %}
    sort:
      method: attribute
      attribute: days_until_collection_date
      numeric: true
#       reverse: true

  - type: custom:decluttering-card
    template: expander_in_stack
    variables:
      - title: Automaten
      - cards:
          - type: entities
            state_color: true
            entities:
              - entity: input_boolean.afval_reminder
                secondary_info: last-changed
              - entity: input_boolean.afval_staat_voor
                secondary_info: last-changed
              - type: divider
              - entity: automation.afval_vandaag
                name: Notify vandaag
              - entity: automation.afval_morgen
                name: Notify morgen
              - entity: automation.saver_offline
              - entity: automation.saver_weer_online
              - entity: automation.reset_trash_notification
              - entity: automation.mark_trash_as_moved_outside_from_notification

Could you elaborate more on the automation section or is this something that can be ignored?

  - type: custom:decluttering-card
    template: expander_in_stack
    variables:
      - title: Automaten
      - cards:
          - type: entities
            state_color: true
            entities:
              - entity: input_boolean.afval_reminder
                secondary_info: last-changed
              - entity: input_boolean.afval_staat_voor
                secondary_info: last-changed
              - type: divider
              - entity: automation.afval_vandaag
                name: Notify vandaag
              - entity: automation.afval_morgen
                name: Notify morgen
              - entity: automation.saver_offline
              - entity: automation.saver_weer_online
              - entity: automation.reset_trash_notification
              - entity: automation.mark_trash_as_moved_outside_from_notification

its just a list of entities under a fold :wink:

My applogies i ment the actual automations itself but I’ll just skip/drop it :wink:
Thanks anyway, your card looks awesome.

I did not like the closed trash bin when nothing is being scheduled so i quiclky created this. Hope you guys like it.