Garbage pickup date (mijnafvalwijzer.nl) custom_component

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

That’s really off topic here… :wink:

Please open a new post for that

Trying to build up afvalwijzer, currently stranded in UI config.

What I did: Install HUI and auto entities via HACS, installed afval wijzer integration… so far so good…

image

I see the data, but it’s not sorted right; the lovelace code is:

type: custom:auto-entities
card:
  type: glance
filter:
  include:
    - entity_id: sensor.afvalwijzer_gft_2
    - entity_id: sensor.afvalwijzer_papier_2
    - entity_id: sensor.afvalwijzer_pmd_2
    - entity_id: sensor.afvalwijzer_restafval_2
  sort:
    attribute: days_until_collection_date_2
    method: attribute
    numeric: true

And I really would like to have the icons with replaced, tried this:

    sensor.afvalwijzer_gft_2:
      friendly_name: GFT
      entity_picture: /local/afvalwijzer/GFT.png
    sensor.afvalwijzer_papier_2:
      friendly_name: Papier
      entity_picture: /local/afvalwijzer/Papier.png
    sensor.afvalwijzer_pmd_2:
      friendly_name: PMD
      entity_picture: /local/afvalwijzer/PMD.png
    sensor.afvalwijzer_restafval_2:
      friendly_name: Restafval
      entity_picture: /local/afvalwijzer/Restafval.png

The end state for me should be:
when is the next pickup / trash item and what is picked up today and tommorow. Today/tommorow is phase 2, first sorting and the icons right.

Don’t really understand what’s the issue your facing, but mine is as follows:

image

The card i’m using (make sure you have installed auto-entities and template-entity-row through HACS):

type: custom:auto-entities
card:
  type: entities
  title: Volgende ophaaldata
filter:
  exclude:
    - entity_id: sensor.afvalwijzer*next*
    - entity_id: sensor.afvalwijzer*to*
  include:
    - entity_id: sensor.afvalwijzer_*
      options:
        type: custom:template-entity-row
        state: |
          {{as_timestamp(strptime(states(config.entity),'%d-%m-%Y'))
              |timestamp_custom('%-d %b')}}
        secondary: >
          {% set count =
          state_attr(config.entity,'days_until_collection_date')|int %} {% set
          day = as_timestamp(strptime(states(config.entity),'%d-%m-%Y'))
             |timestamp_custom('%A') %}
          {% set dagen =
            {'Monday': 'Maandag',
            'Tuesday': 'Dinsdag',
            'Wednesday': 'Woensdag',
            'Thursday': 'Donderdag',
            'Friday': 'Vrijdag',
            'Saturday': 'Zaterdag',
            'Sunday': 'Zondag'} %}
          {% set dag = dagen[day] if day in dagen else day %} {% set unit =
          'Dag' if count == 1 else 'dagen' %}

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

And inside configuration.yaml:

homeassistant:
  customize:
    sensor.afvalwijzer_gft:
      entity_picture: /local/groen_large.png
    sensor.afvalwijzer_papier:
      entity_picture: /local/papier_large.png
    sensor.afvalwijzer_pmd:
      entity_picture: /local/plastic_large.png
    sensor.afvalwijzer_restafval:
      entity_picture: /local/rest_large.png
3 Likes

Thx, I forgot to install the template entity row

The automation don’t start.
Pff i don’t know what i’m doing wrong.

alias: Afval
description: ''
trigger:
  - platform: time
    at: '20:27:00'
condition:
  - condition: state
    entity_id: sensor.afvalwijzer_gft
    attribute: is_collection_date_tomorrow
    state: '1'
action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.fire_tablet_media_player
      message: De Groene kliko moet morgen aan de straat
      language: nl
mode: single

ok try the individual parts.

comment the condition and see if it fires.
test the tts in services
if that goes, test the condition, which seems odd . This is the case of it not firing, because those are never a number, (and now you have a string btw) but they are either true or false. so change that and it will work

Can u explain what u mean with a string?

please dont tell me you’ve been around sinds 2019, and you dont understand the term ‘string’ vs ‘number’ :wink: ?

more importantly, did you try my suggestion and did it work?

I will try that thank u. :grinning_face_with_smiling_eyes:

And no i’m on sinds 2019
But last few months i’m working with home assistant.

Before i used Homey. And that was much easyer.

Butt home assistant is more interresting :wink:

right, sorry …:slight_smile: thought your bio gave you away.Schermafbeelding 2022-06-10 om 13.34.53

you should read up on type in HA, or python for that matter, well any programming language really.

on string versus number: '5' is a string (anything between quotes is a string), and 5 is a number. You got to be specific with this, when checking states. Especially so when you want a number. Or a boolean value. The latter have special meaning ofc, see YAML - Home Assistant

this is a primer on the matter: Python Data Types

It is not working.

I tested individual butt it is not starting.

alias: Afval
description: ''
trigger:
  - platform: time
    at: '18:06:00'
condition:
  - condition: state
    entity_id: sensor.afvalwijzer_gft
    attribute: is_collection_date_day_after_tomorrow
    state: 'True'
action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.fire_tablet_media_player
      message: De Groene kliko moet morgen aan de straat
      language: nl
mode: single



Tried with a lowercase t for true?

Yep tryed that to.

I don’t gett it. :see_no_evil:

condition: template
value_template: '{{ states(''sensor.afvalwijzer_tomorrow'') != ''Geen'' }}'

I’m using this as condition, different sensor it seems

Is it possible u can help me bye teamviewer so i can see what i’m doing wrong?

Unfortunately I can’t get it working… I installed card-mod. Edited code for sensor.today but still no image. (where it says Vandaag)

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: sensor.afvalwijzer_today
image: /local/images/afvalwijzer/
name: Vandaag
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:
    gft: /local/images/afvalwijzer/GFT.png
    papier: /local/images/afvalwijzer/Papier.png
    restafval: /local/images/afvalwijzer/Restafval.png
    plastic: /local/images/afvalwijzer/PMD.png
    Geen: /local/images/afvalwijzer/Geen.png
    unknown: /local/images/afvalwijzer/Geen.png.org
1 Like

This automation works,
But how can i lett it say the correct garbage bin


alias: Bin notifications
trigger:
  - platform: time
    at: '19:11:00'
condition:
  - condition: state
    entity_id: sensor.afvalwijzer_next_in_days
    state: '1'
action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.fire_tablet_media_player
      message: De kliko moet morgen aan de straat
      language: nl