openhab - garbage collection widget for Basic UI
This widget is inspired from Garabage Collection by Thomas Lauterbach.
In contrast to this it’s intended to use with openHAB Basic UI.
Get started
Dependencies
- Installed iCalendar Binding
Files and Locations
Download the complete folder garbageCollection from dist here download. Copy the files and folders with all included sub folders and files to your openhab config location (usually found here: $OPENHAB_CONF) For the full path execute the following command: echo $OPENHAB_CONF.
| location | download |
|---|---|
| $OPENHAB_CONF/html/ | garbageCollection folder from download |
Setup
Group and Items
Create the group gGarabgeCollection and for each collection an own item. The following example is for an item file but you kan create this also in MainUI. Its importend to assoziate each collection item with group gGarbageCollection
Group gGarbageCollection
DateTime garbage_collection_yellowbin "[%1$tT, %1$tY-%1$tm-%1$td]" (gGarbageCollection) {channel="icalendar:eventfilter:xxx:yyy:result_0#begin", stateDescription="" [pattern="%1$tA %1$td.%1$tm.%1$tY"], widgetColor="#cbcb36", widgetText="Leichtstoffe"}
DateTime garbage_collection_bluebin "[%1$tT, %1$tY-%1$tm-%1$td]" (gGarbageCollection) {channel="icalendar:eventfilter:xxx:yyy:result_0#begin", stateDescription="" [pattern="%1$tA %1$td.%1$tm.%1$tY"], widgetColor="blue", widgetText="Papier"}
Importend here is the widgetColor and widgetText. WidgetColor is a a hex- value or string for the color of trash icon shown in the widget. widgetText is the headline of the collection shown in the widget.
iCalendar thing
Setup your iCalendar bridge with your iCal- url and add a event filter for each collection an iCalendar thing (Params for event: max event = 1, text based filter as subject, set start to 0 and provide a proper key subjecte.g. paper)
Sitemap definition
Webview
icon="none"
url="/static/garbageCollection/index.html?lang=en&interval=240"
height=5
url- Parameters
Parameter: lang, not required, default: de
values: de, eng
Parameter: interval [min] , not required, default: 60
This spezified the auto refresh time for this widget in minutes.
Note
It’s possible to add other languages and colors for badges. the file content.js in the folder garbageCollections must be extend. For other languages it would be nice you provide a PR for all to use.
