Garbage pickup date (mijnafvalwijzer.nl) custom_component

I am really trying and found this resource.
But for the “vandaag, morgen en overmorgen” I keep getting the spinning circle.
Or is that by design because there is not garbage to collect on these days?

Found the solution the value of the sensor = geen, not Geen
Geen: /local/afvalwijzer/kliko_geen.png

I have added
geen: /local/afvalwijzer/kliko_geen.png

And now it works

image

1 Like

omg, this was the trick @slingshot, thank you :smiley:
I checked the code multiple times, but never if the letters needed to be capital or not :see_no_evil:

You are welcome @RolfB .
I also found out there are sensors in the yaml that don’t exist for me. Sensors that start with sensor.thrash*
I only have the afvalwijzer installed and all my sensors start with sensor.afvalwijzer

So I removed these sensor from my implementation.

When I install the required HACC add-ons it seems they are not loaded correctly.

Is this a known issue?

I solved the issue in the post above.
But now a new issue

I used the code from Mariusthvdb.

It results in this error message.

What is going wrong?

the error says it all…

and, if you want us to help you, format your code properly, because now we can not see what your actual code is.

Is there any way to manually refresh the data from mijnafvalwijzer? My HA was disconnected from the internet. Once reconnected, all entities were “Unknown”. I can’t find any service to refresh/update it.

there’s always the generic update_entity service available in dev tools / services,

but tbh, that should not be needed really. In all of these yers, I’ve never seen these entities become unavailable upon network issues, and remain unknown .

Hoi Allemaal,

ben nog relatief nieuw in HA maar kom aardig ver.
Helaas lukt mij het nog niet helemaal en ik zie door de bomen het bos niet meer (zoveel opties, reacties etc)

Mijn wens:
1 plaatje waarop het logo staat van volgend type ophaling (dus GFT, Restafval papier)
Daaronder de datum
Ik dacht om een friendly_name_template: te maken voor de naam
Maar dat lukt mij niet, wellicht hebben jullie een idee om dit op te lossen.
Alvast bedankt

Mijn kaart is nu als volgt

show_state: true
show_name: false
camera_view: auto
type: picture-entity
entity: sensor.afvalwijzer_next_type
state_image:
  restafval: /local/afvalwijzer/Restafval.png
  GFT: /local/afvalwijzer/GFT.png
  papier: /local/afvalwijzer/papier.png

En mijn sensor in sensor.yaml

  - platform: afvalwijzer
    provider: mijnafvalwijzer                     # (required, default = mijnafvalwijzer) either choose mijnafvalwijzer, afvalstoffendienstkalender or rova
    postal_code: 1234AB     # (required, default = '')
    street_number: 15 # (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"


  - platform: template
    sensors:
      afvalwijzer_next_type:
        friendly_name: VolgendAfval
        friendly_name_template: >
        
        value_template: >
          {% if is_state('sensor.afvalwijzer_next_type', 'gft & etensresten') %}
            GFT
          {% elif is_state('sensor.afvalwijzer_next_type', 'plastic, blik & drinkpakken') %} 
            Plastic
          {% elif is_state('sensor.afvalwijzer_next_type', 'restafval') %} 
            Restafval            
          {% endif %}
          
        entity_picture_template: > #/local/afvalwijzer/GFT.png
          {% if is_state('sensor.afvalwijzer_next_type', 'gft & etensresten') %}
            /local/afvalwijzer/GFT.png
          {% elif is_state('sensor.afvalwijzer_next_type', 'papier') %}
           /local/afvalwijzer/papier.png
          {% elif is_state('sensor.afvalwijzer_next_type', 'Restafval') %}
            /local/afvalwijzer/Restafval.png
          {% endif %}

If you’re still starting up, why use the legacy format of the template: sensor? If you have no older config to keep alive, just use the modern template: format.

Also, you mentioned you want 1 plaatje… I take it this would be a type:picture, or would you like a custom:button-card showing that. the latter would be easiest, and most configurable. Maybe even wouldn’t require a template sensor at all :wink:

So, it all boils down to what you really want in your Dashboard.

these are picture-entity 's

          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 these are template-entity-rows:

for which the yaml has been posted above

NL:
Dat plaatje lukt me al, met eronder vandaag of morgen dat is allemaal geen probleem.

Alleen wil ik er de eerstvolgende datum eronder hebben.
Dus plaatje met soort afval, daaronder label met de datum van ophaling.
Hopelijk begrijp je mijn vraag

ENG:
I worked out the picture, I can make it with a label “today,tomorrow etc”
But, I wanna make a label with the next date
So image depending on next type
And label with the text/label Date.

I hope you understand my question

Na heel wat vogelen heb ik het bijna helemaal voor elkaar.
Voor de geïnteresseerden hieronder de code, ik stuit op dit moment alleen nog op het probleem dat de afbeelding niet volledig getoond wordt.
Toch bedankt voor de inzet

type: picture-elements
image: /local/afvalwijzer/geen.png
elements:
  - type: image
    entity: sensor.afvalwijzer_next_type
    image: /local/afvalwijzer/geen.png
    state_image:
      restafval: /local/afvalwijzer/Restafval.png
      GFT: /local/afvalwijzer/GFT.png
      papier: /local/afvalwijzer/papier.png
    style:
      top: 50%
      left: 50%
      width: 100%
      height: 100%
  - type: state-label
    entity: sensor.afvalwijzer_next_date
    style:
      top: 85%
      left: 50%
      color: black
      font-size: 22px
      padding: 8px
      background-color: rgba(210, 250, 254, 0.4)
      border-radius: 250px
      box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3)
      backdrop-filter: blur(15px)
      transform: translate(-50%, -50%)

2 Likes

I am very new to Home Assistant. Coming from Domoticz, i still need to learn all there is to HA.
I have added the afvalwijzer integration and all is working as expected.

However, Purmerend (where i live) does not track the paper pickup dates in there app. The paper is always collected on the 2nd saturday of the month.

My question is, can i add a seperate google calendar to the afvalwijzer integration that have the pickup dates in it? Or maybe there is a better solution for this.

hello, i have the problem that the map is not loading. anyone any idea?
I have this in my file editor in configuration.yaml

sensor:
  - platform: afvalwijzer
    provider: mijnafvalwijzer        # (required, default = mijnafvalwijzer) either choose mijnafvalwijzer, afvalstoffendienstkalender or rova
    postal_code: xxxxxx              # (required, default = '')
    street_number:  xx                # (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 waste types (case ignored). F.e. "papier, gft"

which Map is that?

also, if you ar trying to use auto-entities, then why list all the entities yourself? use smth like this:

    - type: custom:auto-entities
      card:
        type: entities
      filter:
        exclude:
          - entity_id: sensor.afvalwijzer*next*
          - entity_id: sensor.afvalwijzer*to*
        include:
          - entity_id: sensor.afvalwijzer_*
            options:

and have auto-entities do the selection for you

No you can’t, afvalwijzer lists the afvalwijzer dates. thats it.

if you have a fixed date for other schedules, indeed add it via calendar integration

it’s this card. GitHub - xirixiz/homeassistant-afvalwijzer: Provides sensors for some Dutch waste collectors
what you said doesn’t work either.

What does not work?

that I don’t see a card when I add it.

hello, i use the garbage info. I would like the ‘‘waste for tomorrow’’ and ‘‘waste for today’’ to change the icon for the next garbage. For example, when it is the paper’s turn, the paper will be displayed as a pictogram. Anyone have any idea how I can get this done.

I’ve read and tried everything but can’t get it to work. hopefully somebody can help me.

this is my code

type: entities
entities:
  - entity: sensor.afvalinfo_afval_voor_morgen
    icon: ''
    secondary_info: none
  - entity: sensor.afvalinfo_afval_voor_vandaag
  - entity: sensor.afvalinfo_groenafval
    image: /local/tmp/groenafval.png
  - entity: sensor.afvalinfo_papier
    image: /local/tmp/papierafval.jpg
  - entity: sensor.afvalinfo_plastic
    image: /local/tmp/pmd.png
  - entity: sensor.afvalinfo_restafval
    image: /local/tmp/restafval.png

5eed6afa544b6dd5505de9699744071a5c5ce931_2_690x366
0910f98b5b290927a53570716f084b02b621de59_2_512x500