Thanks, and sorry for the [extremely] late reply :-/
I have trash (green bin) Tuesday morning, yard waste (no bin, just pile it up by the curb) Wednesday morning, and recycling (yellow lid) Friday morning. So far I’m just using a pair of rather lame automations to send reminder emails/SMSs to everyone the afternoon before.
My next project is to get big–maybe 12" square–reflective QR code stickers printed up and attach them to the bins so my outside security cameras can recognize them and send increasingly urgent reminders as the pickup time nears. My stepsons are incredibly lazy and so frequently need a serious kick in the pants to actually do anything useful. If we get better integration with the UniFi controller stuff, maybe I can get it to shut off the boys’ internet service until they take the trash out!
I use a scrape sensor to grab the date from my local council website, like this:-
- platform: scrape
resource: https://www.eastleigh.gov.uk/waste-bins-and-recycling/waste-bin-and-recycling-collection-dates/your-waste-bin-and-recycling-collections?uprn=200002902607
name: Glass
select: "dd:nth-of-type(4)"
Then my Google Home notifies me on the morning of collection via an automation trigger and TTS, has been working very well for the last 6 months or so and obviously takes into account any changes due to bank holidays etc.
The link in the example is just a random address from my area
Sorry to bother you, but you wouldn’t mind sharing how you do that, would you? I’m tying myself in knots working out how to work with a bare ‘date’ as a target for a reminder the day before. Most examples seem to use Google Calendar…
No worries if not. Thanks
My council website scraper pulls the date and I use it in a Google TTS announcement every morning, have a look and it might give you some clues. If you leave the date you pulled with your rest sensor as a timestamp and convert the current date to a timestamp it should work I think
{% set date = states.sensor.glass.state.split()[1] + "-" + states.sensor.glass.state.split()[2] + "-" + states.sensor.glass.state.split()[3] %}
{% if date == currentdate %}
Also it's glass collection day, don't forget to put the glass bin outside.
{% endif %}
{% set date = states.sensor.household_waste.state.split()[1] + "-" + states.sensor.household_waste.state.split()[2] + "-" + states.sensor.household_waste.state.split()[3] %}
{% if date == currentdate %}
Also it's household waste collection day, don't forget to put the black bin out.
{% endif %}
{% set date = states.sensor.recycling.state.split()[1] + "-" + states.sensor.recycling.state.split()[2] + "-" + states.sensor.recycling.state.split()[3] %}
{% if date == currentdate %}
Also it's recycling collection day, don't forget to put the green bin out.
{% endif %}
I’m trying to use scrape as well, but I can’t get it to work.
- platform: scrape
resource: http://www.wastenet.org.nz/RecycleRubbish/WasteCollectionSearch.aspx?view=2&id=162121
name: Recycling
select: "div:nth-child(4)"
unfortunately my sensor is not working. Could anyone help me out here?
If I inspect the “day” chrome, there’s no “copy selector” available, only XPath and outerHTML.
*the address is one in my area
Do you use any sensors/automations for rubbish collection? Keen to share?
I use this custom component: https://github.com/bruxy70/Garbage-Collection
configuration.yaml
garbage_collection:
sensors:
- name: "Waste" # Each week on Monday
frequency: "weekly"
collection_days: "mon"
- name: "Recycling" # Bi-weekly on Monday
frequency: "odd-weeks"
collection_days: "mon"
#################################################################
## Garbage Binary Sensors
#################################################################
- platform: template
sensors:
recycling_today:
entity_id: sensor.recycling
friendly_name: "Recycling Today"
value_template: "{{ is_state('sensor.recycling', '0') }}"
- platform: template
sensors:
recycling_tomorrow:
entity_id: sensor.recycling
friendly_name: "Recycling Tomorrow"
value_template: "{{ is_state('sensor.recycling', '1') }}"
- platform: template
sensors:
garbage_today:
entity_id: sensor.waste
friendly_name: "Garbage Today"
value_template: "{{ is_state('sensor.waste', '0') }}"
- platform: template
sensors:
garbage_tomorrow:
entity_id: sensor.waste
friendly_name: "Garbage Tomorrow"
value_template: "{{ is_state('sensor.waste', '1') }}"
#################################################################
## Garbage and Recycling Reminder Automation
#################################################################
- id: garbage_reminder
alias: 'Garbage Reminder'
initial_state: true
trigger:
platform: time
at: '20:00:00'
condition:
condition: time
weekday:
- sun
action:
- service: notify.telegram_general
data_template:
title: '*Information*'
message: >
{% if is_state('binary_sensor.recycling_tomorrow', 'on') %}
Reminder - it is garbage and recycling night.
{% else %}
Reminder - it is garbage and green waste night.
{% endif %}
- condition: state
entity_id: input_boolean.dnd # do not disturb
state: "off"
- service: tts.google_translate_say
entity_id: media_player.entranceway_speaker
data_template:
message: >
{% if is_state('binary_sensor.recycling_tomorrow', 'on') %}
Reminder. It is garbage and recycling night.
{% else %}
Reminder. It is garbage and green waste night.
{% endif %}
Part of my Lovelace Reminders Card:
entities:
- card:
content: '![Image](/local/icons/rubbish_and_recycling/recycling.png)'
style: |
ha-card {
border: solid 2px var(--primary-color);
box-shadow: none;
--ha-card-background: rgba(0, 0, 0, 0);
}
title: Garbage and Recycling Tomorrow
type: 'custom:hui-markdown-card'
conditions:
- entity: binary_sensor.recycling_tomorrow
state: 'on'
type: 'custom:hui-conditional-card'
- card:
content: '![Image](/local/icons/rubbish_and_recycling/recycling.png)'
style: |
ha-card {
border: solid 2px var(--primary-color);
box-shadow: none;
--ha-card-background: rgba(0, 0, 0, 0);
}
title: Garbage and Recycling Today
type: 'custom:hui-markdown-card'
conditions:
- entity: binary_sensor.recycling_today
state: 'on'
type: 'custom:hui-conditional-card'
- card:
content: '![Image](/local/icons/rubbish_and_recycling/garbage.png)'
style: |
ha-card {
border: solid 2px var(--primary-color);
box-shadow: none;
--ha-card-background: rgba(0, 0, 0, 0);
}
title: Garbage and Green Waste Tomorrow
type: 'custom:hui-markdown-card'
conditions:
- entity: binary_sensor.recycling_tomorrow
state: 'off'
- entity: binary_sensor.garbage_tomorrow
state: 'on'
type: 'custom:hui-conditional-card'
- card:
content: '![Image](/local/icons/rubbish_and_recycling/garbage.png)'
style: |
ha-card {
border: solid 2px var(--primary-color);
box-shadow: none;
--ha-card-background: rgba(0, 0, 0, 0);
}
title: Garbage and Green Waste Today
type: 'custom:hui-markdown-card'
conditions:
- entity: binary_sensor.recycling_today
state: 'off'
- entity: binary_sensor.garbage_today
state: 'on'
type: 'custom:hui-conditional-card'
show_header_toggle: false
style: |
ha-card {
border: solid 2px var(--primary-color);
}
title: Reminders
type: entities
I’ll post a screenshot Sunday.
EDIT:
Awesome, thank you.
In my city in Southern California, all bins are collected on the same day every week. Trash, Recycling, and Yard Waste.
Thanks. Did you make those icons? Got the code for your irrigation notification too?
We work on a fortnightly cycle. Waste and FOGO (Food Organics, Garden Organics) one week, then Recycling and FOGO the next.
At Christmas time our council has an extra recycling pickup either the week of or the week after Christmas. That may be a bit hard to add it is not consistent year on year.
Hey tom, did 107 break your reminder card?
Have not updated yet, but it will be because of the use of custom:hui-...
and the way home assistant no longer preloads all cards.
It can be fixed by using this: