Garbage pickup date (mijnafvalwijzer.nl) custom_component

Yes, but I don’t understand what you mean. What procedure ?

the config flow :wink:

just click the button

I did, but nothing is happening.

that makes no sense.
click the button, and a popup should appear where you can enter an integration name. how can that not be happening? It is completely unrelated to Afvalwijzer at this point in the config flow

you should have restarted Home Assistant to be able to select Afvalwijzer in that search box (because before, the integration did not support the config flow yet, it requires the new version, and that is only loaded after the restart)

I restarted my complete Rpi system and now I have the same screens and the flow started properly.

Thanks for your help

1 Like

you dont need to reboot your Pi (the Host), only Home Assistant itself. glad you got it sorted

preparing the move to Saver (still fingers crossed this component will be able to d so too…) I figured to download their icons

and adjust the card with those.

they are .svg files however, and we can not upload them here

So this is only to say that instead of what we are used to

we can now use those .svg’s directly, resulting in

or

ofc just as an example, those 3 should not be the same for these types ofc in reall life schedules.

I also added them as custom icons to the entities, but those look really bad, they’re not typically designed to the Material guidelines. better use the builtin mdi icons for that still

1 Like

I hope so too, I hope it will work to support Saver.
I too need to switch to Saver, and I really like using this integration!

Since the new update I get a message every day that the waste is being collected, this also happens with “no” waste.

There is also an error in my logs:

2024-12-13 22:13:06.505 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/afvalwijzer/sensor.py", line 82, in <lambda>
    hass, lambda _: hass.async_add_executor_job(data.update), update_interval)
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 891, in async_add_executor_job
    tracked = asyncio.current_task() in self._tasks
              ~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop

And these are my template and automations:

# Home Assisant Afvalwijzer.
# Learn more at https://github.com/xirixiz/homeassistant-afvalwijzer

################################################
# Packages
################################################
homeassistant:
  customize:
    sensor.afvalwijzer_today:
      friendly_name: Vandaag
    sensor.afvalwijzer_tomorrow:
      friendly_name: Morgen
    sensor.afvalwijzer_day_after_tomorrow:
      friendly_name: Overmorgen
    sensor.afvalwijzer_next_type:
      friendly_name: Volgende type afval
    sensor.afvalwijzer_next_date:
      friendly_name: Eerstvolgende ophaalmoment
    sensor.afvalwijzer_next_in_days:
      friendly_name: Aantal dagen voor ophaalmoment
    input_boolean.waste_reminder:
      icon: mdi:reminder

    sensor.afvalwijzer_gft:
      friendly_name: GFT
      entity_picture: /local/afvalwijzer/kliko_gft.png
    sensor.afvalwijzer_papier:
      friendly_name: Papier
      entity_picture: /local/afvalwijzer/kliko_papier.png
    sensor.afvalwijzer_pmd:
      friendly_name: PMD
      entity_picture: /local/afvalwijzer/kliko_pmd.png

################################################
# Inputs
################################################
input_boolean:
  waste_moved:
    name: Afval staat aan de weg
    initial: off
    icon: mdi:delete-empty
  waste_reminder:
    name: Afval herrinering
    initial: on
    icon: mdi:delete-empty
  waste_outside:
    name: Afval buiten herinnering
    initial: off
    icon: mdi:delete-empty

################################################
# Sensor
################################################
sensor:
  - platform: afvalwijzer
    provider: !secret afvalverwerker
    postal_code: !secret postcode
    street_number: !secret huisnummer
    suffix: ''
    exclude_pickup_today: false
    default_label: Geen
    id: ''
    exclude_list: ''

################################################
# Formatted sensors
################################################
  - platform: template
    sensors:
      afvalwijzer_next_type_formatted:
        value_template: >-
          {% if is_state('sensor.afvalwijzer_next_type', 'gft') %}GFT
          {% elif is_state('sensor.afvalwijzer_next_type', 'papier') %}Papier
          {% elif is_state('sensor.afvalwijzer_next_type', 'pmd') %}PMD
          {% else %}Geen
          {% endif %}
        friendly_name: "Volgende type afval"

      afvalwijzer_today_formatted:
        value_template: >-
          {% if is_state('sensor.afvalwijzer_today', 'gft') %}GFT
          {% elif is_state('sensor.afvalwijzer_today', 'papier') %}Papier
          {% elif is_state('sensor.afvalwijzer_today', 'pmd') %}PMD
          {% else %}Geen
          {% endif %}
        friendly_name: "Vandaag"

      afvalwijzer_tomorrow_formatted:
        value_template: >-
          {% if is_state('sensor.afvalwijzer_tomorrow', 'gft') %}GFT
          {% elif is_state('sensor.afvalwijzer_tomorrow', 'papier') %}Papier
          {% elif is_state('sensor.afvalwijzer_tomorrow', 'pmd') %}PMD
          {% else %}Geen
          {% endif %}
        friendly_name: "Morgen"

      afvalwijzer_day_after_tomorrow_formatted:
        value_template: >-
          {% if is_state('sensor.afvalwijzer_day_after_tomorrow', 'gft') %}GFT
          {% elif is_state('sensor.afvalwijzer_day_after_tomorrow', 'papier') %}Papier
          {% elif is_state('sensor.afvalwijzer_day_after_tomorrow', 'pmd') %}PMD
          {% else %}Geen
          {% endif %}
        friendly_name: "Overmorgen"

################################################
## Automation
################################################
automation:
- id: '02362f01-381c-4b24-a295-728ef4ec0594'
  alias: '[Notificatie] - Afvalwijzer - Verzend'
  description: ''
  triggers:
  - hours: /1
    trigger: time_pattern
  conditions:
  - condition: and
    conditions:
    - condition: state
      entity_id: input_boolean.waste_moved
      state: 'off'
    - condition: state
      entity_id: input_boolean.waste_reminder
      state: 'on'
    - condition: time
      after: '18:00:00'
      before: '21:00:00'
    - condition: template
      value_template: '{{ states(''sensor.afvalwijzer_tomorrow'') != ''Geen'' }}'
  actions:
  - data:
      title: Afvalwijzer
      message: 'Het is vandaag: {{ now().strftime("%d %b, %Y") }}. Afvaltype: {{ states.sensor.afvalwijzer_tomorrow.state
        }} wordt opgehaald op: {{ (as_timestamp(now()) + (24*3600)) | timestamp_custom("%d
        %b, %Y", True) }}!'
      data:
        actions:
        - action: MARK_WASTE_MOVED
          title: Afval verwerkt
          activationMode: background
          authenticationRequired: false
          destructive: true
          behavior: default
        push:
          badge: 5
        action_data:
          entity_id: input_boolean.waste_outside
    action: notify.braakies
  mode: single

- id: '4d63f27f-c42e-49fa-b7e5-c80493c6aa5c'
  alias: '[Notificatie] - Afvalwijzer - Bevestig'
  description: ''
  triggers:
  - event_type: mobile_app_notification_action
    event_data:
      action: MARK_WASTE_MOVED
    trigger: event
  conditions: []
  actions:
  - entity_id: input_boolean.waste_moved
    action: input_boolean.turn_on
  - entity_id: input_boolean.waste_outside
    action: input_boolean.turn_on
  - data:
      title: Afvalwijzer
      message: 'Afvaltype: {{ states.sensor.afvalwijzer_tomorrow.state }} staat aan
        de weg.'
      data:
        push:
          badge: 0
    action: notify.braakies
  mode: single

- id: 'ca8ddf9d-c98d-4648-916a-4c92c8fff5e4'
  alias: '[Notificatie] - Afvalwijzer - Herstel'
  description: ''
  triggers:
  - entity_id: input_boolean.waste_moved
    to: 'on'
    for:
      hours: 12
    trigger: state
  conditions: []
  actions:
  - entity_id: input_boolean.waste_moved
    action: input_boolean.turn_off
  - entity_id: input_boolean.waste_outside
    action: input_boolean.turn_off
  - entity_id: input_boolean.waste_reminder
    action: input_boolean.turn_on
  mode: single

Anyone see an error somewhere, before the update everything worked perfectly

Take out the yaml config for the integration ( the sensor) and set it up in the Ui as is described in the release notes

1 Like

You mean I can leave this sensor out, I completely read over that and didn’t think of it. I’m going to leave it out, thanks.

1 Like

Be sure to delete the old entities.
Let us know if this fixed the issue

Yes I had already removed the old entities, if I don’t get a message tonight I’ll assume this was the problem.

Unfortunately, I got the same message again. I’m going to remove everything and reinstall the integration.

Hmm, maybe it has something todo with case sensitive stuff, could be a bug. I see in your notification “geen” in lowercase, while the template says “Geen”. I’ll have a look at the code Tomorrow as well.

This I mean. So you get a notification indeed every evening then since trash geen is being picked up almost every day then :sweat_smile:

Just checked. When configuring the component, if you fill in “Geen” as a default label instead of the default label “geen”, then it should work fine again.

I have now reinstalled the integration, I could not change the data in the config flow, it just stayed on “geen”. After reinstalling I could fill in “Geen”. Will have to wait until tomorrow after 18:00 if the message is indeed gone.

Thanks anyway

Edit: Just got another error message

Logger: homeassistant
Bron: core.py:891
Eerst voorgekomen: 00:16:27 (1 gebeurtenissen)
Laatst gelogd: 00:16:27

Error doing job: Future exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/afvalwijzer/sensor.py", line 82, in <lambda>
    hass, lambda _: hass.async_add_executor_job(data.update), update_interval)
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 891, in async_add_executor_job
    tracked = asyncio.current_task() in self._tasks
              ~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop

I pretty much have the same error…

Logger: homeassistant
Bron: core.py:891
Eerst voorgekomen: 16 december 2024 om 15:00:38 (5 gebeurtenissen)
Laatst gelogd: 07:00:38
Error doing job: Future exception was never retrieved (None)

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/afvalwijzer/sensor.py", line 82, in <lambda>
    hass, lambda _: hass.async_add_executor_job(data.update), update_interval)
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 891, in async_add_executor_job
    tracked = asyncio.current_task() in self._tasks
              ~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop

Old sensors are removed. I know how to fix most errors in HA but i dot have a solution for this one yet.

Sure, can you summarize the details for me?