Waste Collection Schedule Framework

Wow, thanks for your efforts on this. I’ll have a play with your suggestion later on. Much appreciated

1 Like

Hi

Would it be possible to add in waste collection days for Townsville?
https://www.townsville.qld.gov.au/water-waste-and-environment/waste-and-recycling/bin-collection-days

Example address is 10 Woodwark Drive, Bushland Beach

Thanks in advance

I would say, it’s not possible, sorry. As long as you can’t access data by calling something like an API or download a calendar in ICS format, there is only the scrape of the website and that is complicated and out of the scope of this integration. :slight_smile:

On the other hand, do you really need that? As far as I could see, your bin collection follows a strict timetable, even on holidays. You have collection every week on tuesdays and additionally every other week recycling. This is one of the cases, where it makes much more sense just to setup a simple automation, that covers a weekly and bi-weekly schedule.

1 Like

For newbies like me, struggling with the sensors not showing up: try to collect all your sensors in the configuration.yaml under a single sensor: tag, even if they are from different platforms… For example,

sensor:
  - platform: waste_collection_schedule
    name: Communal waste
    value_template: 'in {{value.daysTo}} days, on {{value.date.strftime("%a")}}'
    types:
      - Green Bin 
  - platform: template
    sensors:
      gla_door_frontleft:
        friendly_name: "Front Left Door"
1 Like

That’s not specific to this integration. :slight_smile: But normally you shouldn’t be able to safe the file, when you have included a domain (in this case the domain is “sensor”) more than once…

But there are so many other ways to keep your configuration files in order, that one can’t take that as a general advice.

Thanks for the clarification :slight_smile: I agree, this is not specific to this integration - it was a red herring for me! I saved the file and the built in yaml checker didn’t flag anything. HA functioned well for weeks (with repeated manual restarts) before I the duplicate domain became suspicious

1 Like

Strange! :slight_smile: Normally you shouldn’t be able to save that file… :thinking: But that is something for another time to investigate. :laughing:

Anyway, good you got it working! :slight_smile: :+1:

1 Like

How to add a new wast collector to the list.

title: `Ôffalkalinder` van Noardeast-Fryslân & Dantumadiel
url: https://offalkalinder.nl/
country:
howto: |
   - Goto <https://offalkalinder.nl/wanneer> and add your postcode and housenummer.  (9074DL, 1)
   - Click on `Zet in agenda`
   - Click on `Kopieer naar klembord`
   - Replace the `url` in the example configuration with this link.
test_cases:
   Oppach:
       url: "https://offalkalinder.nl/ical/1722200000001856"

I’m having issues getting my data to display, whenever I try to add from the ui I get message to say I can only add via the configuration.yaml file, I think I have setup the yaml file, but still can’t see anything in devices or entities, any idea what I’m doing wrong? My yaml file is below:

Summary
# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

waste_collection_schedule:
    sources:
    - name: cheshire_west_and_chester_gov_uk
      args:
        uprn:1234456789
        
sensor:
  - platform: waste_collection_schedule
    name: cheshire_west_and_chester_gov_uk
    details_format: generic

That’s my entire yaml, only thing I changed is the uprn for privacy

On just a short look, your indentation is wrong. :slight_smile:

Yours:

waste_collection_schedule:
    sources:
    - name: cheshire_west_and_chester_gov_uk
      args:
        uprn:1234456789

Instead:

waste_collection_schedule:
  sources:
    - name: cheshire_west_and_chester_gov_uk
      args:
        uprn:1234456789

“Sources” is two spaces to much to the right. :slight_smile:

But normaly that should give an error, if you try to save it that way, at least I thought so…

Was that it? :slight_smile:

the only thing to try if @paddy0174 suggestion doesn’t work would be to put the uprn number in quotes

waste_collection_schedule:
    sources:
    - name: abcdefg
      args:
        uprn: "123456789" 

Doesn’t seem to be, the error I get when validating is

Invalid config for ‘waste_collection_schedule’ at configuration.yaml, line 17: expected dict for dictionary value ‘waste_collection_schedule->sources->0->args’, got ‘uprn:123455678’
Invalid config for ‘waste_collection_schedule’ at configuration.yaml, line 19: ‘sensor’ is an invalid option for ‘waste_collection_schedule’, check: waste_collection_schedule->sensor

Figured it out, missing a space after uprn (in addition to the other suggestions!)

It now returns a single sensor with all of the bins, so you know how I get seperate sensors for each bin? I’m not sure how to get the separate names for each sensor

1 Like

yes, we can help but it’s more beneficial for you to read up with what you need to do. I can post my sensors but they won’t work for you.

if you have 3 different bins you need 3 sensors setup like the example from the docs

sensor:
  - platform: waste_collection_schedule
    name: NAME
    value_template: VALUE_TEMPLATE
    date_template: DATE_TEMPLATE
    add_days_to: ADD_DAYS_TO
    types:
      - Waste Type 1
      - Waste Type 2

waste type 1 and 2 must match what’s returned from the source unless you have specified an alias in the configuration.yaml
if you have 2 bins collected on the same day like I do you can use 1 sensor

this is my sensors for recycling and garden waste which is collected on the same day. hopefully point you in the right direction.

  - platform: waste_collection_schedule
    name: Recycle & Garden
    details_format: upcoming
    value_template: '{{value.types|join(", ")}} {% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %} '
    date_template: '{{value.date.strftime("%d.%m.%Y")}}'
    add_days_to: true
    types:
      - "Recycling (Blue)"
      - "Garden (Brown)"

I am most probably making this more confusing for you (sorry).
check the docs and if you need help just ask.

1 Like

Thank you, that helps!