no the google calendar component makes a sensor based on every calendar that is added to your account.
so if you have the google calendar in HA and you add the ical from your wastecollection to your account, you automaticly get a sensor that has the name from the ical.(or the name you give it in your settings)
if you already use google calendar, that way is simpler then adding a custom component. (or at least in my eyes)
the advantage is that you just get every other ical you add automaticly as a new sensor. (you dont need to add any other custom components)
the only disadvantage is that you only get the next event.
Thanks for sharing the iCal method. Unfortunately my council doesn’t share this info.
Bit of a shame because I thought making this info publicly consumable would be the right thing to do.
I came unstuck with my cURL and css selector method because they recently changed their site layout, quick rewrite of my selector meant I was back in business. I have time to rewrite this as long as they have budget to keep changing their website
That website is horrible - and the following solution is also:
Have a weekly cronjob on a Wednesday night to pull the latest week to a flat file - so you don’t hammer the Dorset site curl https://mapping.dorsetforyou.gov.uk/mylocal/viewresults/10091017024 > dorset.html
Setup 3 command line sensors (one for each waste type
cat dorset.html | pup '.resultListItem' | grep -A 3 "Your next recycling" | head -n 4 |sed -n '3p' | awk '{$1=$1};1'
cat dorset.html | pup '.resultListItem' | grep -A 3 "Your next food" | head -n 4 |sed -n '3p' | awk '{$1=$1};1'
cat dorset.html | pup '.resultListItem' | grep -A 3 "Your next rubbish" | head -n 4 |sed -n '3p' | awk '{$1=$1};1'
Change the sensor color to match the Bin type
You could build some logic into Linux to only pull dates from the future with a further grep if you wanted.
save yourself the trouble of a changing website.
until recently i also got no ical from my area.
but like in your area there was a printable schedule for the whole year.
at the end of the year they provide that for the next year.
because of the repaet in it it isnt that hard to save all dates that the waste is collected in an google calendar.
i used an excel spreadsheet where i did put all dates in and that can be imported in google calendar.
next year all i had to do is change the dates, based on the new list.
its about 30 to 60 minutes at the end of every year, but you probably spend more time if you try to keep track of that website.
I have done this exact thing for mines, it’s a very similar schedule to the OPs. I have it shown on a lovelace panel and alerts to notify me via txt and voice throughout the house to remind me that it’s the day for the bin to go out and what bin(s) need to go out.
I’ve basically gone with the same kind of hacky way you have to end up with 2 sensors, one for each (potential) bin that is to be collected, so sometimes I end up with the ‘unknown’ 2nd sensor too and they aren’t centred in my lovelace card anymore so my OCD doesn’t like it lol.
I’ve been trying to do something with my local authority (Bradford Council) but they seem to have there data is some kinda strange database backend (eb). This is the end point they use:
I’ve tried a couple of web scraping options but the data needs to be searched first (via postcode) and that doesn’t seem to be acheable which the sites I’ve used.
like i said a few days ago, save yourselve the trouble from trying to find a way to scrape it.
collect the data once a year, put it in an ical file and use that for your automations.
That sounds like a good solution, however there are a few limitations I can see:
My local authority only release their schedule for a few months ahead not an entire year. The above method also doesn’t take into account any changes/cancellations of the collection.
i dont know how its at your place but if its anything like here they change very little.
we get a new schedule every year, but i now before the schedule is there which dates it will be.
does it happen regularly that they change or cancel?
we never had a cancelation in 13 years. (and even if they did noone would know in advance)