Waste Collection Schedule Framework

I started with a very basic setup to learn HA. Waste Collection Schedule is installed via HACS. I added the code below to configuration.yaml, but nothing shows up in my calendar.

#afval kalender
waste_collection_schedule:
  sources:
    - name: circulus_nl
      args:
        postal_code: XXXXNP
        house_number: 12

sensor:
  - platform: waste_collection_schedule
    name: Circulus
    value_template: '{{value.daysTo}}'

WHen I start the fetch data service manually nothing happens. I cant see any activity in the logger. What am I missing?

Hello. I’ve tried to check everything but I couldn’t find a mistake. I’ve tried it both with a url and the ics file in the www folder but always get the same result. It won’t show the days remaining. I also have removed the unit of measurement and checked a 100 times if the type and alias both in the configuration.yaml file and sensors.yaml file match with the ics file. does anybody know where I made a mistake?




Try daysTo instead of dayTo.

Yep, that did it. Thank you so much :slight_smile:

Just updated to HA Core 2024.2.5 which seemed to cause waste collection to stop.
Can anyone confirm?

1 Like

it did not stop but for me the issue came back:

fetch failed for source ICS: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 134, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 181, in fetch return self.fetch_file(self._file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 212, in fetch_file return self._convert(f.read()) ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 215, in _convert dates = self._ics.convert(data) ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS_v1.py", line 39, in convert end_date = start_date.replace(year=start_date.year + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: day is out of range for month

which was running fine for quite a while.

It no longer works for me either after the HA Core 2024.2.5 update.

Works again today, because it’s a problem in leap years.

Hi. I have no clue where I have made a mistake. I am trying to set up the source where the argument is supposed to be house_number, but when I restart my home assistant, I get the error that house_number is an unexpected argument. Can anyone see where I have made a mistake?

waste_collection_schedule:
sources:
- name: renosyd_dk
args:
house_number: “my_house_number”

@Studs495 Please check the indentation of (especially) house_number. Follow exactly the indentation from the example.

@mampfes I realize that the indentation wasnt inserted properly in my question, but I have the exact same indentation as the example. I also copied the example to configuration.yaml without changing anything, and it still gives me the unexpected argument error.

I’ve been trying all day to get this set up but I’m struggling a little.

Here is the basic setup and the results.

#configuration.yaml

waste_collection_schedule:
  sources:
    - name: bradford_gov_uk
      args:
        uprn: "#########"

#sensor.yaml

- platform: waste_collection_schedule
  name: NAME

I’m looking to have 2 sensors, 1 for Recycling and 1 for General, if I use the following then I get ‘unavailable’.

#configuration.yaml

waste_collection_schedule:
  sources:
    - name: bradford_gov_uk
      args:
        uprn: "100051139490"
      customize:
        - type: RECYCLING
          alias: Recycling
          picture: https://onlineforms.bradford.gov.uk/ufs/bfdextra/images/RECY/general.jpg
        - type: REFUSE
          alias: General
          icon: mdi:bin
          picture: https://onlineforms.bradford.gov.uk/ufs/bfdextra/images/RECY/recycle.jpg
        - type: GARDEN
          alias: Garden
          show: false
          icon: mdi:bin
          picture: false

#sensor.yaml

- platform: waste_collection_schedule
  name: General
  types: REFUSE

- platform: waste_collection_schedule
  name: Recycling
  types: RECYCLING

Please point out the obvious thing that I’m doing wrong :slight_smile:
Thanks.

I am trying the same and cant even get as far as you. Here’s my basic setup…

Screenshot 2024-03-08 203129|325x187

I am simply getting state unknown. Can you see any reason for this please?

I have reloaded the yaml files and ran service: waste_collection_schedule.fetch_data.

I suspect it may be to do with the sensor name

not sure if it helps but this is what I use.

waste_collection_schedule:
    sources:
    - name: cherwell_gov_uk
      args:
        uprn: "#########" 
      customize:
      - type: Green Bin
        picture: https://forms.cherwell.gov.uk/images/bin-collections/bin-collection-green.svg
        alias: Rubbish
      - type: Blue Bin
        picture: https://forms.cherwell.gov.uk/images/bin-collections/bin-collection-blue.svg
        alias: Recycling
      - type: Brown Bin
        picture: https://forms.cherwell.gov.uk/images/bin-collections/bin-collection-brown.svg
        alias: Garden

then all waste type sensor.

  - platform: waste_collection_schedule
    name: all-waste-types
    details_format: upcoming
    value_template: '{{value.types|join(", ")}} {% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %} '
    add_days_to: true 

then finally Mushroom Template

type: custom:stack-in-card
mode: vertical
cards:
  - type: horizontal-stack
    card_mod:
      style: |
        ha-card {
          box-shadow: none;
          
        }
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
            box-shadow: none;

             }
        primary: Bin Collection
        secondary: ' {{ states(''sensor.all_waste_types'') }}'
        icon: mdi:sack
        icon_color: >-
          {{ 'blue' if '0 days' in states('sensor.all_waste_types') else 'blue'
          }}
        tap_action:
          action: none
        hold_action:
          action: none
        double_tap_action:
          action: none
      - type: custom:mushroom-chips-card
        chips:
          - type: template
            content: ''
            icon: mdi:trash-can
            icon_color: >-
              {{ 'green ' if 'Rubbish' in states('sensor.all_waste_types') else
              'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'green' if 'Rubbish' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;
                }
                ha-card:after {
                  content: "{{ 'done' if 'Rubbish' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'green' if 'Rubbish' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
          - type: template
            content: ''
            icon: mdi:recycle
            icon_color: >-
              {{ 'indigo' if 'Recycling' in states('sensor.all_waste_types')
              else 'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'indigo' if 'Recycling' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;        
                }
                ha-card:after {
                  content: "{{ 'done' if 'Recycling' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'indigo' if 'Recycling' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
          - type: template
            content: ''
            icon: mdi:leaf
            icon_color: >-
              {{ 'brown' if 'Garden' in states('sensor.all_waste_types') else
              'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'brown' if 'Garden' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;
                }
                ha-card:after {
                  content: "{{ 'done' if 'Garden' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'brown' if 'Garden' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
        alignment: end
        card_mod:
          style: |
            ha-card {
              top: 10px;
              right: 17px;
            }
card_mod:
  style: |
    ha-card {
      background: #1c1c1c !important ; 
      --ha-card-box-shadow: 0px;
    }
 

gives me this

1 Like

Really like this layout but can’t get your Mushroom code to work. I have card-mod, stack-in-card and mushroom installed. Are there any other HACS you have installed to get this to work?

it’s not my code but I changed it for my needs. I tried to find the post but can’t find it.
what errors are you getting.
there’s alot of entity’s to change within

Is there any way to change the sensor state from “recycling in x days” to just “x days” please?

I’m not getting any errors but it just doesn’t seem to be applying the CSS styling. Think I just need to read up a bit more on the code and figure out what I need to change.

I’ve edited the colours and waste names but issue is with the application of the styling.

type: custom:stack-in-card
mode: vertical
cards:
  - type: horizontal-stack
    card_mod:
      style: |
        ha-card {
          box-shadow: none;
          
        }
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
            box-shadow: none;

             }
        primary: Bin Collection
        secondary: ' {{ states(''sensor.all_waste_types'') }}'
        icon: mdi:sack
        icon_color: >-
          {{ 'blue' if '0 days' in states('sensor.all_waste_types') else 'blue'
          }}
        tap_action:
          action: none
        hold_action:
          action: none
        double_tap_action:
          action: none
      - type: custom:mushroom-chips-card
        chips:
          - type: template
            content: ''
            icon: mdi:trash-can
            icon_color: >-
              {{ 'black ' if 'general waste' in states('sensor.all_waste_types')
              else 'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'black' if 'general waste' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;
                }
                ha-card:after {
                  content: "{{ 'done' if 'general waste' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'black' if 'general waste' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
          - type: template
            content: ''
            icon: mdi:recycle
            icon_color: >-
              {{ 'brown' if 'Recycling' in states('sensor.all_waste_types') else
              'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'brown' if 'Recycling' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;        
                }
                ha-card:after {
                  content: "{{ 'done' if 'Recycling' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'brown' if 'Recycling' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
          - type: template
            content: ''
            icon: mdi:leaf
            icon_color: >-
              {{ 'brown' if 'Garden waste' in states('sensor.all_waste_types')
              else 'grey' }}
            card_mod:
              style: |
                ha-card {
                  background: rgba(var(--rgb-{{ 'green' if 'Garden waste' in states('sensor.all_waste_types') else 'grey' }}), 0.2) !important;
                  border: none;
                  box-shadow: none;
                }
                ha-card:after {
                  content: "{{ 'done' if 'Garden waste' in states('sensor.all_waste_types') else 'close' }}";
                  position: absolute;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  background: rgb(var(--rgb-{{ 'green' if 'Garden waste' in states('sensor.all_waste_types') else 'grey' }}));
                  color: var(--card-background-color);
                  font-weight: bolder;
                  border-radius: 50%;
                  top: -5px;
                  right: -5px;
                  width: 16px;
                  height: 16px;
                  font-size: 11px;
                  font-family: 'Material Icons';
                }
        alignment: end
        card_mod:
          style: |
            ha-card {
              top: 15px;
              right: 50px;
            }
card_mod:
  style: |
    ha-card {
      background: #1c1c1c !important ; 
      --ha-card-box-shadow: 0px;
    }

ah you need Google material icons. have a search on here for how to integrate . I am at work but can help better later

Hi there

I am just installed the integration and it works :slight_smile:

I love the entity filter cards a lot for my overview on the wall tablet.

Is there a way to let only show the next date if it is today/tomorrow?
so for “nächste Abholung” I want an entity filter, but dont know what I need therefore…