Garbage pickup date (mijnafvalwijzer.nl) custom_component

Hi @xirixiz
somehow Garbage pickup date (mijnafvalwijzer.nl) custom_component - #516 by niekniek89 was marked as solution to this thread, causing this:

to popup every time someone posts here. Since this is a general topic, I dont think that solution mark is appropriate and in fact rather annoying…

can you un-solve this? or would the poster in that thread need to do that

Yes I know, I already found these images. But shouldn’t I be able to find this in the custom_components folder? Since I’m new to HA.

And I would appreciate if you could help me building a card like this: Garbage pickup date (mijnafvalwijzer.nl) custom_component - #455 by Aussi

no. as I explained above, you save them in the /www folder.

that is part of my dashboard, and also posted more than a few times in this thread :wink:

since you’re new, my advise would be to take it 1 step at a time, and not try to create a rather complex card like this immediately. use the building blocks, (the image shown there is the markdown section ) and see if you can create that first. That particular section though is made with several non-afvalwijzer entities in my own config.

this is the markdown:

      - type: custom:hui-element
        card_type: markdown
        card_mod:
          style: |
            ha-card.type-markdown {
              box-shadow: none;
              margin: -8px -16px 0px -16px;
            }
        content: >
          <font color={{states('sensor.trash_color')}}><ha-icon icon= {{'mdi:delete-alert' if states('sensor.afvalwijzer_today') != 'Geen' else 'mdi:delete-outline'}}> </ha-icon></font> Vandaag, {{states('sensor.vandaag')}}: <font color= {{states('sensor.trash_color')}}>**{{states('sensor.afvalwijzer_today')|capitalize}}</font>**

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

          <ha-icon icon= 'mdi:delete-alert'> </ha-icon> {{states('sensor.volgende_afval_ophaal_dag')}}: **<font color={{states('sensor.trash_next_color')}}>{{states('sensor.afvalwijzer_next_type')|capitalize}}</font>**

I downloaded the images and put them in the config/www/images/afvalwijzer directory. For me as a “newbie” it’s pretty difficult.

I would be happy if I could create atleast:

now show us the card config you tried, so we can help

1 Like

I used the following code (in configuration.yaml), after I downloaded afvalwijzer from HACS:

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

With provides me the following entities:

I see you are using the built-in UI for creating this card. I fear we have to stop there. you can not create the card you like in UI mode, and need YAML mode for that. Let alone all the many customizations needed for it.

You can ofc set pictures and entities, but not in the complexity of that card you posted

here’s 1 picture-entity card (already modded by card_mod), you could try in the UI editor:

            - type: picture-entity
              card_mod:
                style: |
                  ha-card {
                    box-shadow: none;
                    animation: {% if is_state('persistent_notification.trash_notification_today','notifying') and
                                       states('sensor.afvalwijzer_today') != 'Geen' %} blink 2s linear infinite;
                               {% else %} none
                               {% endif %}
                  }
                  @keyframes blink {
                    100% {opacity: 0;}
                  }

              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 copy that for the other 2 sensors

1 Like

Do I have to use this code in the UI editor or in the configuration.yaml?

Edit: when I use this in the UI editor and select entitiy sensor.afvalwijzer_today, the it says No card type found.

you should try to create a picture-entity card like this yourself, and start with a new card, select that, and then slowly add things.

not simply copy and paste my config in the editor…

as for the no card found: probably because of the dash in front of the type:

also, check the last line in your screenshot… the bad indentation is because of type:``` after the last .png

1 Like

I do get the following warning:

De visuele editor wordt niet ondersteund voor deze configuratie:

  • Sleutel “card_mod” wordt niet verwacht of ondersteund door de visuele editor.

U kunt nog steeds de configuratie in YAML bewerken

Hello,

Can someone help me with a automation for garbage collection?

I will have an automation when collection date is tomorrow en time is 20:00

It will say with tts that the container must set on the street.

But don’t know how to do.

Here is my automation for achieving that. You might think it is a little peculiar. That is because I want the TTS-announcement only when there is motion in the living room. To make sure someone definitely gets the message. This automation will try to make the announcement between 20 and 21 hours on motion. Feel free to just take out the parts you need :slight_smile:

- alias: Reminder tomorrow trash day
  trigger:
    - platform: time_pattern
      hours: '20'
      minutes: '/1'
  condition:
    condition: and
    conditions:
      - condition: template
        value_template: "{{ states('sensor.afvalwijzer_tomorrow') != 'Geen' and states('sensor.afvalwijzer_tomorrow') != 'unknown' }}"
      - condition: time
        after: '20:00:00'
        before: '21:00:00'
      - condition: template
        value_template: "{{ ((as_timestamp(now()) - as_timestamp(states.binary_sensor.pir_woonkamer.last_changed)) /60 ) | int < 2 }}"   #Less than two minutes ago there was motion in the livingroom
      - condition: state
        entity_id: input_boolean.trash_reminder_done
        state: 'off'
  action:
    - service: script.announce_downstairs
      data: 
        my_message: "Morgen is afvaldag voor {{states('sensor.afvalwijzer_tomorrow')}}."
2 Likes

’ can u check if this is correct?’

Please post yaml and don’t post screenshots of your code, we can not edit that.

The and construction is superfluous, as conditions are by default ‘anded’

Suppose you checked yourself? Did it work?

###. Don’t know to post yaml.

alias: Afval dag groen
trigger:
  - platform: time
    at: '20:00:00'
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: sensor.afvalwijzer_gft
        attribute: is_collection_date_tomorrow
        state: 'true'
action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.fire_tablet_media_player
      language: nl
      message: De groene kliko moet aan de straat

Almost :wink:

Select that and click the </> button , or add 3 backticks before and after the code

Inhave changed it hopely correct

1 Like

Besides the condition (you only have 1 so no need to list anything there, just write the one ),
what is your issue now ?

Can u make an example?
I don’t gett it. :see_no_evil:

sure, but what dont you get? does the automation not work?

as example for the conditions:

  - alias: Afval vandaag
    id: afval_vandaag
    trigger:
      platform: time
      at: '07:00'
    condition:
      - >
        {{states.sensor.afvalwijzer_today is not none}}
      - not:
          condition: state
          entity_id: sensor.afvalwijzer_today
          state: Geen
    action:
      - service: script.intercom_message
        data:
          message_nl: >
            Het is {{now().strftime('%A %-d %B')}}: vandaag wordt {{states('sensor.afvalwijzer_today')}} opgehaald!
          message_en: >
            It is {{now().strftime('%A %-d %B')}}: today {{states('sensor.afvalwijzer_today')}} will be collected!
      - service: script.persistent_trash_today
      - service: script.trash_outside_today

tomorrow:

  - alias: Afval morgen
    id: afval_morgen
    trigger:
      platform: time
      at: '21:00'

    condition:
      - >
        {{states.sensor.afvalwijzer_tomorrow is not none}}
      - not:
          condition: state
          entity_id: sensor.afvalwijzer_tomorrow
          state: Geen
    action:
      - service: script.intercom_message
        data:
          message_nl: >
            Het is {{now().strftime('%d %B')}}: Morgen wordt
            {{states('sensor.afvalwijzer_tomorrow')|title}} opgehaald!
          message_en: >
            It is {{now().strftime('%d %B')}}: Tomorrow
            {{states('sensor.afvalwijzer_tomorrow')|title}} will be picked up!
      - service: script.persistent_trash_tomorrow
      - service: script.trash_outside_tomorrow