Is this script to sort the dates?? and if yes, how to use with the widget?
Thanks
Nikos
Is this script to sort the dates?? and if yes, how to use with the widget?
Thanks
Nikos
Yes this script is meant to sort the dates. I do not use it yet but you can see that it relies on custom Item metadata. This would be the ideal solution in my opinion (at least in theory) but since the support for custom metadata is still pretty limited in main ui I haven’t really used this feature.
As DrRSatzteil (netter Name btw. ) already wrote the script is meant to sort the dates. On my setup the script gets called everytime a garbage items changes. Color and name are set as custom namespace on each item. These are used to beautify the list.
Can you please tell me how to use it ? I am just now try to migrate my oh2 to oh3 and all these metadata confuse me.
Sure. Got to your item list and select the appropriate item. Click on the “Add Metadata” button and select “Enter custom namespace”. Enter e.g. “color” and finally you should end with something like this
value: yellow
config: {}
thanks for your reply but i am think its too difficult for me i have all Ready put the custom metadata like you told me, when i run the script i get this error:
Script execution of rule with UID ‘4c3bed8d7f’ failed: TypeError: Cannot get property “value” of null in at line number 23
next question is how to use the “SortedGarbageDateItems” item to the garbage widget??
Wauw, this is indeeed working! thanks!!! I will use this in several other widgets as well.
I’m a bit of an OpenHAB beginner and definitely new to widgets, but I’m trying to get this to work. I got the widget and it works statically, with some missing items, but I’m not sure how to make and populate the items:
I think I understand the rest, but I need to get over this hurdle first. Any help?
Thanks!
Hi Ian,
Let me try to help you explain what you need:
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.
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!
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
My assumption for the reader:
To get this widget running, you have to follow this step
Start
to 0, as shown here Garbage Collection - #36 by DrRSatzteil
Now all pre-conditions should be fulfilled, so that the widget can be easily configured as described here Garbage Collection
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:
But because this issue is not related to this widget, I would also recommend to create a new topic
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.