Custom component Afvalbeheer - Support for multiple waste collectors

i works, thnx.

Thanks, but to do it that way you need a sensor_today and sensor_tomorrow. I don’t have those with Pippeyns version so need to find a way to re-create

my exact card yes, but you could ofcourse adapt to what you do have. What would you like to show? And what sensors are available. maybe you can easily make those.

Will Pippyns component only has the four sensors of types of garbage and their pick up dates. Already great but if you want to automate easy across those four types of garbage I would need to make jinja templates that create new sensors that for instance contain the next type of garbage and the pickup date. And I’m so bad at jinja stuff that I try to avoid that…

other than the today and tomorrow, you have the entities to create the rest of the card?

that would be a nice start then, and file a feature request for the sensors :wink: @Pippyn can have a look in the Mijnafvalwijzer CC how to create those I suppose.

The sensor supports as much fractions as your city will provide. So this could be 1 or in some city’s even 8.

This is easy to implement. But what would you like the sensor to display if more then 1 type of trash is collected on the same day?

That is is good one… Curious to hear how @Mariusthvdb solved that one… (although in practical terms I don’t have any days more then one type is collected I think)

I created a beta of the sensor on my github. Install this version and add upcomingsensor: 1 to your config like so:

    - platform: afvalbeheer
      wastecollector: Blink            (required)
      resources:                       (at least 1 required)
        - restafval
        - gft
        - papier
        - pmd
      postcode: 1111AA                 (required)
      streetnumber: 1                  (required)
      upcomingsensor: 1                   (optional)
      dateformat: '%d-%m-%Y'           (optional)

Does this work for you?

Cool & thanks! I have the two extra sensors in Hass now. Need to test later as there is no trash today or tomorrow :wink:

In Belgium there’s https://www.ophaalkalender.be/
Not sure if it’s helpful for this custom component

Sorry it’s sadly not the same api. But if you can give me a postcode and streetnumber i’ll check if i can add it.

@Pippyn could you change the value ‘unknown’ (=sensor value if _today or _tomorrow are empty) into ‘geen’ or ‘none’ ? Looks much better in state card. Thanks

Done! Updated my beta github

upcoming shouldn’t need tomorrow, it should tell what and when the next trash date is. In afvalwijzer, this is done with 2 scrape sensors:

  - platform: scrape
    resource: !secret scrape_resource_date
    name: Afval Datum
    select: '.firstDate'
    scan_interval: 3600

  - platform: scrape
    resource: !secret scrape_resource_type
    name: Afval Soort
    select: '.firstWasteType'
    scan_interval: 3600

never looked at you service providers, but maybe it could be of use for you too.
Just to be clear, these scrapers aren’t part of the CC mijnafvalwijzer, I’ve added them as extra’s and provide the option to do this:

20

  - type: vertical-stack
    cards:
      - type: custom:useful-markdown-card
        content: >
          Vandaag is het **<font color=green>[[ sensor.vandaag.state ]]</font>**.

          Volgende afval-ophaal over **<font color=var(--secondary-text-color)>[[ sensor.trash_next.state ]]</font>** dagen:

          **<font color=var(--secondary-text-color)>[[ sensor.afval_datum.state ]]</font>** : **[[ sensor.afval_soort.state ]]**

sensor.vandaag is a simple date template, and has nothing to do with the afval sensors. sensor.trash_next is in the mijnafvalwijzer component

Hi, great component, I’m using it now. Is it possible to add an option to disable the ‘monday/tomorrow/today’ text from the sensor? Especially in mobile view it doesn’t look nice if you want to keep the overview ‘compact’. I can do a workaround with a template sensor of course, but an option like ‘date_prefix: true/false’ would be great.

I’ll implement it tomorrow!

Great component and great work!
Any chance this will be an official component anytime soon?

Here are two examples. The system seems to be different for Brussels than for the rest of Belgium, only in Brussels you need the house number

It seems providing it while you don’t need it still works which would make the code easier I suppose. Otherwise just check if it has the format 1XXX, then it’s Brussels. No need for an api call for that like they do on the website.

Brussels:
postcode: 1040
street: Vlieger Thieffrystraat
house number: 10

outside of Brussels:
postcode: 3000
street: Bondgenotenlaan

Yes I’m already testing the sensor for belgium. I think it will a sensor on it’s own and not integrated with the dutch version. But i’m not sure. Beta will be ready tomorrow i hope.

I hope so :slight_smile: when the sensor is ready. Need to refactor the code when all features are implemented.