Garbage Collection

Hi Ian,

Let me try to help you explain what you need:

  1. For every line that should be shown in the widget list you will need an item of type DateTime. To get a human readable displayState from this item you will need to apply the state description metadata (Open the item in Main Ui and click ‚Add metadata‘ → select ‚State Description‘. Then fill in the pattern value something like: ‚ %1$tA %1$td.%1$tm.%1$tY‘ and check out the resulting display in the main UI. Please search the forums and/or documentation if you need more help on the pattern syntax. I think there should be plenty of helpful resources around.

  2. I should have updated the first post, sorry for not doing so. Please use the garbage_list_v1 version of the widget that I posted on Jan 26. there is no need for this item anymore. I will update the first post when I find some more time.

I hope this will help you to get on the right track. Please let me know if you got it working!

Haven’t had much time yet over the holidays, but I’ll let you know - I think I understand it so it should be workable! Thanks for the help!

Got it working fine! Thanks very much. I’ll come back in a few days and post exactly what I had to do (for us newbies).

Now I just need to write a script to update the date items and I’m golden - thanks very much for your help!

1 Like

Updated the first post with the latest code and improved explanations.

Great work. Thank you.

First, thanks. Great widget.
I’m new to openHab, and it took me some time to understand, what is required.

For every other newbie, a short summary using the web interface to maybe speed them up :slight_smile:

My assumption for the reader:

  • You are familiar with CalDav,
  • You have a calendar with at least two meeting series, named “paper” and “glass”
  • You installed the widget “Garbage Collection”

To get this widget running, you have to follow this step

  1. Install icalendar
  2. Add a icalendar configuration for your calender
  3. Add an event filter
    3.1 for each type you like to display (e.g. two event filter in case of paper and glass to be displayed)
    3.2 with max event == 1
    3.4 with a text based filter, e.g. using the subject
    3.5 provide the proper subject of the calender entry, e.g. paper or glass
    3.6 set Start to 0, as shown here Garbage Collection - #36 by DrRSatzteil
  4. Add an item for each event filter
    4.1 Each item is of type DateTime
    4.2 Every item is linked to one event filter only
    4.3 The used channel is “result_0#begin”
    4.4 Adjust the meta description of each item to “%1$tA %1$td.%1$tm.%1$tY” like written here Garbage Collection - #32 by DrRSatzteil. Otherwise, the date in the footer for each type is missing, like here: Garbage Collection - #27 by wars

Now all pre-conditions should be fulfilled, so that the widget can be easily configured as described here Garbage Collection

7 Likes

Hi,

@Panji
I tried your guide by creating a local calender.ics and save it to the openhab pi. ICalender Binding URL has a local address.

Following your points I end up that all my channel filter items are “UNDEF”.

Regarding search subject i tried the blank name of the event as well as “SUMMARY:Eventname”. ← why this : see an extract of my .ics file:
I also tried both types of the search expression.

SUMMARY:Gelber Sack
DTSTART;TZID=Europe/Berlin:20220125T070000
DTEND;TZID=Europe/Berlin:20220125T080000
TRANSP:OPAQUE
SEQUENCE:3
X-MOZ-GENERATION:3
END:VEVENT
END:VCALENDAR

My local time is proper set .

What do I miss?
Thanks for your help

Phil

Sorry, but I have no idea.

General hints would be:

  1. Check the openhab log files
  2. Check the permission, if the file can be reached via web from localhost

But because this issue is not related to this widget, I would also recommend to create a new topic :slight_smile:

  1. There werent any logs regarding calender binding or event filter.
  2. Permissons are granted and location is reachable (same folder like OpenHAB UI images)
  3. A reboot always helpts :see_no_evil:

I did a reboot because of other reasons and left all my calendar settings. After reboot everything works fine.

Thanks anyway for your hints

Hi i am still trying to make this work but i am stuck with the new item that have the sorted items. i have put all the metadata name and color, i have create a new item (SortedGarbageDateItems) as string?? my question is how to use the new item (SortedGarbageDateItems) in the widget ??

Thanks
Nikos

You should simply use this as the datearray parameter in the widget.

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.