Garbage Collection

Thanks a ton Ward!

For people using UI configuration:

Open the items configuration page and simply add the color (e.g. red or yellow or black or similar) to the “Add Tag” input field below “Non Semantic Tag” section and press enter …and do not forget to save your settings before leaving the page :wink: simple as that…

Here my attempt for everyone who prefers to use config files using the widget in post 1 provided. Refreshing the calendar every 12 hours because I don’t know their limitations:

Thank you very much @DrRSatzteil

Thing

Bridge icalendar:calendar:garbagecollection "Garbage Collection" @ "Internet" [ url="URL TO MY CITIES CALENDAR FOR MY STREET", refreshTime=360 ]
Thing icalendar:eventfilter:yellowbin "Yellow Bin Events" (icalendar:calendar:garbagecollection ) [ maxEvents=1, datetimeUnit="DAY", datetimeStart=0, datetimeRound=true, textEventField="SUMMARY", textEventValue="Gelbe Tonne", textValueType="TEXT" ]
Thing icalendar:eventfilter:bluebin "Yellow Bin Events" (icalendar:calendar:garbagecollection ) [ maxEvents=1, datetimeUnit="DAY", datetimeStart=0, datetimeRound=true, textEventField="SUMMARY", textEventValue="Blaue Tonne", textValueType="TEXT" ]
Thing icalendar:eventfilter:blackbin "Yellow Bin Events" (icalendar:calendar:garbagecollection ) [ maxEvents=1, datetimeUnit="DAY", datetimeStart=0, datetimeRound=true, textEventField="SUMMARY", textEventValue="Restabfalltonne", textValueType="TEXT" ]

Items

DateTime garbage_collection "[%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:calendar:garbagecollection:next_start", stateDescription=""[pattern="%1$tA %1$td.%1$tm.%1$tY"] }
DateTime garbage_collection_yellowbin "[%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:eventfilter:yellowbin:result_0#begin", stateDescription=""[pattern="%1$tA %1$td.%1$tm.%1$tY"] }
DateTime garbage_collection_bluebin "[%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:eventfilter:bluebin:result_0#begin", stateDescription=""[pattern="%1$tA %1$td.%1$tm.%1$tY"] }
DateTime garbage_collection_blackbin "[%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:eventfilter:blackbin:result_0#begin", stateDescription=""[pattern="%1$tA %1$td.%1$tm.%1$tY"] }

Footer

="Nächste Abholung: " + ((dayjs(items.garbage_collection.state).diff(dayjs().startOf("day"), "days")) == 0 ? "Heute" : (dayjs(items.garbage_collection.state).diff(dayjs().startOf("day"), "days")) == 1 ? "Morgen" : "In " + (dayjs(items.garbage_collection.state).diff(dayjs().startOf("day"), "days")) + " Tagen")

Date Array

"Restmüll","black","f7:trash","garbage_collection_blackbin"|"Gelbe Tonne","yellow","f7:trash","garbage_collection_yellowbin"|"Blaue Tonne","blue","f7:trash","garbage_collection_bluebin"
4 Likes

Hey, I installed the “Garbage Collection” widget but it doesn’t work well, does anyone have any idea what to do?


Hard to say… I assume the items you are referencing are all existing and have valid types and values?

What Items do you mean, i just added the widget to my main layout, should i nedd to create an item as well? If so, could you show me how?
That would be very nice, I am new to this matter

Hi @Fabian1,
I am also using this widget (@DrRSatzteil thanks for this one :slight_smile:).

As @DrRSatzteil already stated, you need the Items holding the dates for the different garbage types. E.g. the dates can be fed by the iCalendar binding.

In my instance I fetch the garbage dates from our local garbace collection company via an ics link and the iCalendar binding:

The Channels of the iCalendar Things are linked to various Items used in the widget:


(list not complete)

These Item names you have to add to the configuration of the widget. Maybe this is a bit different if you are not familiar with widgets using “widget expressions” instead of simply providing an item selector.

In my case this looks then like:
Footer

='Nächste Abholung: ' + ((dayjs(items.MuellkalenderEintragsfilter_Result_0_Begin.state).diff(dayjs().startOf("day"), "days")) == 0 ? "Heute" : (dayjs(items.MuellkalenderEintragsfilter_Result_0_Begin.state).diff(dayjs().startOf("day"), "days")) == 1 ? "Morgen" : "In " + (dayjs(items.MuellkalenderEintragsfilter_Result_0_Begin.state).diff(dayjs().startOf("day"), "days")) + " Tagen")

Date Items

"Restmüll","black","f7:trash","Muellkalender_Restmuell_Ergebnisstart"|"Bioenergietonne","teal","f7:trash","Muellkalender_Bioenergietonne_Ergebnisstart"|"Verpackungstonne","yellow","f7:trash","Muellkalender_Verpackungstonne_Ergebnisstart"|"Altpapier","blue","f7:trash","Muellkalender_Altpapier_Ergebnisstart"

In the end this looks like:
image

Regards
Jonathan

1 Like

Thanks for that great widget!

What colours are available in this? Our compost bin is brown, but if I’d put in brown it’ll come out as red?

As far as I know you can use any of the f7 colour themes:

Unfortunately there aren’t too many options there.

1 Like

For anyone who don’t want to handle this, via CalDav and intern calendar. I started a platform to fetch garbage information and provide a simple API: müll.io (German only currently) Feedback is welcome, and I can add more providers, if someone need a special provider.

1 Like

Thanks for sharing, looks interesting. However my address is not covered yet. The local provider is https://www.bonnorange.de/.

That’s awesome, I will have to check later if Berlin BSR and Berlin Alba are already on it.

Added Bonn a few seconds ago. Have fun.

Great, thanks! :blush:

Great work! Thank you!

I try to make a similar widget that should fit next to yours showing the next upcomming events. How did you make the subtitle of an list item gray and slightly smaler? I cant find any way to do so? Maybe someone can give me a hint how to style the subtitle from an list item.

// Edit, found it… you are using “footer” not “subTitle”…

1 Like

Any news regarding the widget? :relaxed:

I don’t know if Recklinghausen is included…

https://www.zbh-ksr.de/abfallkalender/abfallkalender22.php

1 Like

Can someone share the configuration example? I am confused what shall I type there.
I do not know how to configure this widget.
I have all things working properly

Hello,
it seems that the footer does not work for me:
I have “heute” (today) displayed and next delivery is next week :frowning:

="Nächste Abholung: " + ((dayjs(Garbage_Calender_Next_Event_Start).diff(dayjs().startOf("day"), "days")) == 0 ? "Heute" : (dayjs(Garbage_Calender_Next_Event_Start).diff(dayjs().startOf("day"), "days")) == 1 ? "Morgen" : "In " + (dayjs(Garbage_Calender_Next_Event_Start).diff(dayjs().startOf("day"), "days")) + " Tagen")

image

What if you try

… (items.Garbage_Calender_Next_Event_Start.state)…
instead of

… (Garbage_Calender_Next_Event_Start)…

Cheers
Jonathan

than i have NaN (I tested it before)
image