Garbage Collection

can you be more specific please :slight_smile:

so its look like my item now

Sure. In the widget configuration popup you should replace the text in the “Date Items” field in the screenshot with =items.SortedGarbageDateItems.state

This should do the trick for you!

1 Like

Thank you very much

@DrRSatzteil

Thanks for sharing of this great widget.
I am using this in combination with the local garbage information in Hamburg.

However, I am using this format:

%1$tA, %1$td.%1$tm.

but it shows the Englisch day:
image

I tried to use the options in the State Description in mainUI, but then the entire format was removed (no displayState at all).

Any suggestion how to format this would be greatly appreciated.

PS: If helpful I could share my rule how to extract the data from Hamburgs garbage collection calendar.

PPS: You have a very famous last name nowadays in Germany :wink:

Hi @NCO

my guess would be that you haven’t set the default locale off your openHAB instance to German. Could you check this in the basic settings?

You can imagine that many people talk about my last name these days :sweat_smile: however I have no known relation to Mr. Karl Lauterbach

You mean the regional settings in mainUI?
Sorry, that I did not mention this - it’s set to German:

:rofl:

Yes I was talking about these settings. Ok since these settings are fine another question: where have you put the date format string if not in the state description? Do you use it directly in the widget configuration? I have mine set in the state description and it works fine (as displayState). You may check my posts from may in 2021 above where I shared some screenshots.

I have actually put the same stuff in the state description (see below), but if I put additional Friday=Freitag into the options down there (see below), the entire format is gone and obviously erased:

without the options it returns “Friday ...”

Ok I see. Yeah you cannot just put a mapping like that in options and I don’t think it makes sense to use this field for date types at all. Unfortunately I have no idea why it stills shows the English string, I did not add any special formatting options, afaik this should just be localised correctly just out of the box. I would recommend to address this question in a separate thread. As this does not seem to be related specifically to this widget you will be more likely getting answers this way.

I agree and will do so.
Thanks anyway for your help!
And the nice widget of course :slight_smile:

Hello Thomas,

Very nice widget thank you!
The list part is working for me, but I have a problem to configure the footer part. I don‘t understand how the expression work.

items.garbage_collection.state

What item are you using for this?

Thank you for your help!

This is a group item that contains all the garbage collection date items. It’s state is derived as the earliest date of all member items. This way it always gives you the date of the next garbage collection.

1 Like

Thank you! That did the trick!

Hi,

I am using the widget version by @wars from this post and it’s working fine
 only thing I’m missing is how to add the colors to the Items tag. Right now I’m only getting gray trash icons :thinking:

what exactly should I add to the tag field??

thanks in advance


This is an example for one of the items, the tags are the stuff between the first

DateTime                   AfvalPapierkarton    "Afval PapierKarton"    <trash>    (Trash)      ["red","Point","Timestamp"]      {stateDescription="date"[pattern="%1$tA %1$td %1$tB %1$tY"], widget="widget:trash_label_standalone", listWidget="widget:trash_list_single" [title="Papier & Karton",color="red"]}
1 Like

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