Garbage collection calendar - repohub/fhem GitHub Wiki

Abfallkalender / Garbage collection calendar

Goal of this section is to show garbage collection information in my FTUI instance:

FTUI screenshot of wastebin
FTUI screenshot of wastebin warn

Gimmicks are time until day of collection as bubble and on day of collection change background colour.

Helper script

First of all we need ics or calendar data to show the garbage collection date. I did not wanted to use google calendar or similar as I need my privacy. Therefore I collect the data directly from the garbage collection companies in Berlin called BSR and ALBA. Unfortunately their pages do not provide the data directly, but with some tricks the ics files can be downloaded. Please see the script abfall2ics_public.sh directly for further step by step information.

fhem.cfg

Next step is adding the calendar information to fhem.

define AbfallAlba Calendar ical file /tmp/alba.ics 86400 (info)

define albaABFALL ABFALL AbfallAlba (info)
attr albaABFALL calendarname_praefix 0
attr albaABFALL date_style date
attr albaABFALL delimiter_reading |
attr albaABFALL delimiter_text_reading und
attr albaABFALL stateFormat next_text in next_days Tag(en)
attr albaABFALL weekday_mapping Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag

define trigger_albaABFALL at *00:10:00 set albaABFALL update (This trigger is necessary to update)

and similar for BSR:
define AbfallBSR Calendar ical file /tmp/bsr.ics 86400
define bsrABFALL ABFALL AbfallBSR
attr bsrABFALL calendarname_praefix 0
attr bsrABFALL date_style date
attr bsrABFALL delimiter_reading |
attr bsrABFALL delimiter_text_reading und
attr bsrABFALL stateFormat next_text in next_days Tag(en)
attr bsrABFALL weekday_mapping Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag
define trigger_bsrABFALL at *00:10:00 set bsrABFALL update

FTUI

  <li data-row="1" data-col="4" data-sizex="4" data-sizey="2">
                <div class="hbox">
                    <div class="vbox">
                        <div data-type="label" class="small" style="margin-left: -20px; z-index: 100">Rest</div>
                        <div data-device="bsrABFALL" data-type="symbol" class="normal warn top-narrow" 
                          data-get="AbholungHausmuell_days" data-get-warn="(\d+)" 
                          data-get-on="([1-9]$|10|[1-9][1-9])"
                          data-get-off="(^0$)"
                          data-on-color="#333333"
                          data-off-color="#333333"
                          data-icon="fa-trash"
                          data-on-background-color="lightgray"
                          data-off-background-color="red"
                          data-icon="fa-trash-o"
                          data-background-icon="fa-square">
                        </div>
                        <div class="small top-narrow" data-device="bsrABFALL" data-get="AbholungHausmuell_weekday" data-type="label"></div>
                    </div>
                        &nbsp;
                    <div class="vbox">
                        <div data-type="label" class="small" style="margin-left: -20px; z-index: 100">Bio</div>
                        <div data-device="bsrABFALL" data-type="symbol" class="normal warn top-narrow" 
                          data-get="AbholungBiogut_days" data-get-warn="(\d+)" 
                          data-get-on="([1-9]$|10|[1-9][1-9])"
                          data-get-off="(^0$)"
                          data-on-color="#663300"
                          data-off-color="#663300"
                          data-on-background-color="lightgray"
                          data-off-background-color="red"
                          data-icon="fa-trash"
                          data-background-icon="fa-square">
                        </div>
                        <div class="small top-narrow" data-device="bsrABFALL" data-get="AbholungBiogut_weekday" data-type="label"></div>
                    </div>
                        &nbsp;
                    <div class="vbox">
                        <div data-type="label" class="small" style="margin-left: -20px; z-index: 100">Gelber</div>
                        <div data-device="albaABFALL" data-type="symbol" class="normal warn top-narrow" 
                          data-get="Wertstofftonne_days" data-get-warn="(\d+)" 
                          data-get-on="([1-9]$|10|[1-9][1-9])"
                          data-get-off="(^0$)"
                          data-on-color="#CCCC00"
                          data-off-color="#CCCC00"
                          data-on-background-color="lightgray"
                          data-off-background-color="red"
                          data-icon="fs-dustbin"
                          data-background-icon="fa-square">
                        </div>
                        <div class="small top-narrow" data-device="albaABFALL" data-get="Wertstofftonne_weekday" data-type="label"></div>
                    </div>
                </div>
        </li>
⚠️ **GitHub.com Fallback** ⚠️