Bin / Waste Collection


#142

yup its called a button on a dashboard.
when we put the bin out and come in agai, we push the button that we did it so that we dont get reminders anymore.
untill then we are reminded every hour.


#143

Would you be able to share the code for that?


#144

its an appdaemon app.
do you have appdaemon installed?

what it actually does:
check google calendar (installed in HA) at 0:00
if a bin needs to go out next day an input boolean is flipped to on
every day between set times it checks on the hour if the boolean is on
if the boolean is on it checks the calendars which bin needs to go out and send a notify (in my case alexa TTS)


#145

Wow, RFID on a trashcan? That seems overkill to me. But I guess a few bad seeds will do that to ya. I honestly never thought about putting trash in a bin and rolling to another house on the street.


#146

#147

Works perfectly for me as this is the same method my council use for the bin collections.

For the days left I used the following python script:

import datetime
import bin_collection_dates
from datetime import *

today = date.today()
future = bin_collection_dates.next_collection
diff = future - today
days_left = str(diff.days)
print(days_left)

This assumes that your bin collection dates script is called bin_collection_dates.py

Thanks for the scripts @Rookeh!!!


#148

HI,

sorry to bump into this thread, but I would really like to have this sensor for days_left.

I use another waste package (@xirixiz’s mijnafvalwijzer) and have a sensor giving me the next pickup in this format:

  - platform: scrape
    resource: !secret scrape_resource_date
    name: Afval Datum
    select: ".firstDate"
    scan_interval: 60 

with this as output:

20

would there be any way to reformat that, and use it in a template to count the days left?

thanks for any help


Garbage pickup date (mijnafvalwijzer.nl) custom_component
#149

How about something like this?


#150

thanks,

I’ll note that one.
it doesn’t work though in my setting, because my sensor.afval_datum doesn’t return a timestamp, but a string.
Can we somehow make a timestamp out of a string?


#151

Can you try something like


#152

Would anyone be able to help with the following website? https://www.sedgemoor.gov.uk/article/1448?n=148663&e=331382&u=10009328112.

Unable to scrape the information required, and cannot install pup to be able to scrape that info either.

Any help would be appriciated!


#153

I’ll give you a hand mate after Christmas- struggling for time at the min


#154

Your council website is pretty easy to read - have you tried a simple scrape sensor

  - platform: scrape
    resource: "https://www.sedgemoor.gov.uk/article/1448?n=148663&e=331382&u=10009328112"
    name: "Refuse Collection"
    select: ".mysedgemoor-list__item__wrapper:nth-child(9)"
    scan_interval: 300

and

  - platform: scrape
    resource: "https://www.sedgemoor.gov.uk/article/1448?n=148663&e=331382&u=10009328112"
    name: "Garden Collection"
    select: ".mysedgemoor-list__item__wrapper:nth-child(11)"
    scan_interval: 300

#155

Thanks Rob for the help! The refuse scrape worked, but for the Garden Collection i just get unknown for this. I’ve tired to play around with the nth-child but nothing appears


#156

Can you try

select: “.mysedgemoor-list__item__wrapper:nth-child(11) .mysedgemoor-list__data”


#157

Just tried that one again, it is unable to scrape the information


#158

For completeness here is @Stringyb92’s solution for anyone else interested.

      - platform: scrape
    resource: "https://www.sedgemoor.gov.uk/article/1448?n=148663&e=331382&u=10009328112"
    name: "Refuse Collection Scrape"
    select: ".content__wrapper--withmenu > div:nth-of-type(7) > div:nth-of-type(2)"
    scan_interval: 86400
    headers:
      User-Agent: Mozilla/5.0

  - platform: scrape
    resource: "https://www.sedgemoor.gov.uk/article/1448?n=148663&e=331382&u=10009328112"
    name: "Garden Waste Collection Scrape"
    select: ".content__wrapper--withmenu > div:nth-of-type(9) > div:nth-of-type(2)"
    scan_interval: 86400
    headers:
      User-Agent: Mozilla/5.0