Garbage pickup date (mijnafvalwijzer.nl) custom_component

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

message: "Morgen is afvaldag voor {{states('sensor.afvalwijzer_tomorrow')}}."

Hi All,

As a noob, I am looking to install the Garbage app.
And am wondering if (mijnafvalwijzer.nl) is the correct 1 for me.
This because when testing my “Postcode” for denhaag 2571AE the reply is “ongeldig adres”

Does someone, know what to use for the denhaag area?
THX

Hello People,

I have my automation working now with text to speech.

Here is my solition.
I have now one for every container.

alias: plastic afval
description: ''
trigger:
  - platform: time
    at: '20:00:00'
condition:
  - condition: numeric_state
    attribute: days_until_collection_date
    entity_id: sensor.afvalwijzer_pmd
    below: '2'
action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.fire_tablet_media_player
      message: De oranje kliko moet morgen aan de Straat
      language: nl
mode: single

1 Like