Add support for schedules from ICS / iCal files. Files can be either stored in a local folder or fetched from a static URL. The waste type will be taken from the summary
attribute.
This source has been successfully tested with the following service providers:
- Limburg.net / limburg.net
- Abfallbehandlungsgesellschaft Havelland mbH (abh) / abfall-havelland.de
- Abfallentsorgung Kreis Kassel / abfall-kreis-kassel.de
- Abfallwirtschaft Freiburg / abfall-eglz.de
- Abfallwirtschaft Landkreis Haßberg / awhas.de
- Abfallwirtschaft Potsdam-Mittelmark (APM) / apm-niemegk.de
- Abfallwirtschaftsbetrieb Ilm-Kreis / ilm-kreis.de
- Abfallwirtschaftsbetrieb Landkreis Karlsruhe / awb-landkreis-karlsruhe.de
- Abfallwirtschaftsbetrieb München / awm-muenchen.de
- Abfallwirtschaftsgesellschaft Landkreis Schaumburg / aws-shg.de
- AVL - Abfallverwertungsgesellschaft des Landkreises Ludwigsburg mbH / avl-ludwigsburg.de
- Awista Starnberg / awista-starnberg.de
- Blaue Tonne - Schlaue Tonne / blauetonne-schlauetonne.de
- EDG Entsorgung Dortmund / edg.de
- Entsorgungsbetrieb Märkisch-Oderland / entsorgungsbetrieb-mol.de
- Entsorgungsgesellschaft Görlitz-Löbau-Zittau / abfall-eglz.de
- FES Frankfurter Entsorgungs- und Service GmbH / fes-frankfurt.de
- Gelsendienste Gelsenkirchen / gelsendienste.de
- Hallesche Wasser und Stadtwirtschaft GmbH / hws-halle.de
- Kreisstadt Groß-Gerau / gross-gerau.de
- Landkreis Hameln-Pyrmont / hameln-pyrmont.de
- Landkreis Northeim (unofficial) / abfall.nerdbridge.de
- Landkreis Stade / landkreis-stade.de
- Landratsamt Bodenseekreis / bodenseekreis.de
- Lebacher Abfallzweckverband (LAZ) / lebach.de
- Lübeck Entsorgungsbetriebe / luebeck.de
- Mein-Abfallkalender.de / mein-abfallkalender.de
- Oberhavel AWU / awu-oberhavel.de
- Stadt Detmold / detmold.de
- Stadt Koblenz / koblenz.de
- Stadt Osnabrück / osnabrueck.de
- Stadtentsorgung Rostock / stadtentsorgung-rostock.de
- Stadtreinigung Leipzig / stadtreinigung-leipzig.de
- Technischer Betriebsdienst Reutlingen / tbr-reutlingen.de
- ZAH Hildesheim / zah-hildesheim.de
- ZfA Iserlohn / zfa-iserlohn.de
- Zweckverband Abfallwirtschaft Oberes Elbtal / zaoe.de
- Zweckverband Abfallwirtschaft Region Trier (A.R.T.) / art-trier.de
- Zweckverband Abfallwirtschaft Südwestsachsen (ZAS) / za-sws.de
- Trondheim / trv.no
- ReCollect / recollect.net
In addition, users reported that the following service providers are working:
- ReCollect.net (Notes)
- Western Disposal Residential (Colorado) (Unofficial, Notes)
waste_collection_schedule:
sources:
- name: ics
args:
url: URL
file: FILE
offset: OFFSET
method: METHOD
params: PARAMS
year_field: YEAR_FIELD
regex: REGEX
split_at: SPLIT_AT
version: 2
verify_ssl: VERIFY_SSL
headers: HEADERS
url
(string) (optional)
URL to ICS / iCal file. File will be downloaded using a HTTP GET request.
If the original url contains the current year (4 digits including century), this can be replaced by the wildcard {%Y}
(see example below).
You have to specify either url
or file
!
file
(string) (optional)
Local ICS / iCal file name. Can be used instead of url
for local files.
You have to specify either url
or file
!
Notes:
-
Some users have reported that on their installation, only local files below the folder
config/www
are accessible by the system. Therefore place the ics file there. -
If you are using relative paths (like in the example below), the path depends on which working directory your Home Assistant instance is running on. And this might depend on the installation method (core vs supervisor vs OS vs ...). Therefore check the log output, it tells you the current working directory.
This example should work for HAOS based installations:
# file location: config/www/calendar.ics waste_collection_schedule: sources: - name: ics args: file: "www/calendar.ics"
offset
(int) (optional, default: 0
)
Offset in days which will be added to every start time. Can be used if the start time of the events in the ICS file are ahead of the actual date.
method
(string) (optional, default: GET
)
Method to send the URL params
.
Need to be GET
or POST
.
params
(dict) (optional, default: None)
Dictionary, list of tuples or bytes to send in the query string for the HTTP request.
This gets
- urlencoded and either attached to the raw URL when GET method is used.
- send with
Content-Type: application/x-www-form-urlencoded
and an automatically generatedContent-Length
header as POST method HTTP body.
Only used if url
is specified, not used for file
.
year_field
(string) (optional, default: None)
Field in params dictionary to be replaced with current year (4 digits including century).
regex
(string) (optional, default: None)
Regular expression used to remove needless text from collection types.
See also example below.
split_at
(string) (optional, default: None)
Delimiter to split event summary into individual collection types. If your service puts multiple collections types which occur at the same day into a single event, this option can be used to separate the collection types again.
version
(integer) (optional, default: 2)
Selects the underlying ICS file parser:
- version: 1 uses
recurring_ical_events
- version: 2 uses
icalevents
verify_ssl
(boolean) (optional, default: True)
Allows do disable SSL certificate checks in case the HTTPS server of your service provider is misconfigured and therefore doesn't send intermediate certificates. Unlike browsers, python doesn't support automatic fetching of missing intermediates.
Set this option to False
if you see the following warning in the logs:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
.
headers
(dict) (optional, default: empty dict)
Add custom headers to HTTP request, e.g. referer
. By default, the user-agent
is already set to Mozilla/5.0 (Windows NT 10.0; Win64; x64)
.
See also example below.
waste_collection_schedule:
sources:
- name: ics
args:
file: "test.ics"
waste_collection_schedule:
sources:
- name: ics
args:
url: "https://abc.com"
headers:
referer: special-referer
Unofficial calendar maintained by burkemw3@gmail.com
sensor:
- platform: waste_collection_schedule
name: Trash Recycling # whatever you want the UI to show. Consider adding a similar prefix for both sensors so they get sorted together, "Trash" in this case
types:
- Recycling # matches alias in waste_collection_schedule below
- platform: waste_collection_schedule
name: Trash Compost
types:
- Compost
waste_collection_schedule:
sources:
- name: ics
args:
url: https://calendar.google.com/calendar/ical/gn2i5lqgobo5deb6p7j69l9aq8%40group.calendar.google.com/public/basic.ics
customize:
- type: Wednesday E Compost # from calendar event name
alias: Compost # matches type in sensor configuration above
- type: Wednesday E Recycling
alias: Recycling
waste_collection_schedule:
sources:
- name: ics
args:
file: waste.ics
regex: "Abfuhr: (.*)"
Removes the needless prefix "Abfuhr: " from the waste collection type.