job
(Joachim Boeddeker)
November 12, 2018, 12:52pm
13
@Branden_Smale
The item is just a string item, nothing more.
Every received command calls a script of the given name.
I use the same list of functions in several places in the UI, currently i need to hardcode all the key/value pairs in the sitemap several times. I would like to use a simple map transformation for that. If you know how to do it, please let me know.
Have a look here for details.
This is a simple concept for scene management. I really like it for its simplicity.
The following is needed:
1 item
1 rule
plenty of scripts: one per scene (openHAB flavor, no shell scripts)
1 sitemap
The main concept is simple. Each script defines a special scene. With a specialized mapping in the sitemap you can call the script you like.
Prior to that concept, i had several SwitchITems which each triggered a special rule. This bunch of SwitchItems could be removed.
The item:
String call…
Another thing is the configuration of Keymappings. You have your pool of functions which you want to be configured for some keys/keypresses.
Have a look here for details:
I have a number of Buttons around my house to trigger functions. But which functions at which locations?
That’s so difficult to plan apart from the obvious “turn the local light on”. The scene management provided me the idea how to simplify this.
I use the following keys/buttons, depending on location:
If the key is located near wall switches i use the homematic ones: HM-PB-2-WM55 .
For buttons located e.g. under the table or somewhere else i use the Xiaomi Aqara switches .
Both switche…
And, last but not least, here is the github issue i opened:
opened 12:15AM - 08 Sep 18 UTC
The mappings keyword allows to add a list of key/value pairs to a Switch or a Se… lection.
It would be great if something reusable could be added to this. Currently every switch or selection needs its own list. I use such lists in several places, it is an ugly copying within the sitemaps.
Examples:
* a list of basic colors (https://community.openhab.org/t/set-color-item-to-a-basic-color-in-sitemap/50731/3?u=job)
* a list of scripts to call for buttons/keys (https://community.openhab.org/t/configurable-buttons-switches-another-good-use-of-scripts/50810)
* a list of playlists for each squeezebox (i use 7 instances) (`Selection item=SB_SetM3U mappings=["PL1"="Playlist1","PL2"="Playlist2", ..., "PLn"="Playlistn"]`)
* a list of tv channels for each Kodi (i use 4 instances) (`Switch item=KUKodi_pvropentv mappings=["Das Erste"="ARD","ZDF HD"="ZDF","RTL SD"="RTL","Sat.1 SD"="Sat1","ProSieben SD"="Pro7"]`)
* a list of standard volume levels (`Selection item=KUKodi_volume mappings=[10=" 10",20=" 20",30=" 30",40=" 40",50=" 50",60=" 60",70=" 70",80=" 80",90=" 90",100="100"]`)
* a list of of standard lighting levels (`Switch item=HTSL_DIMM label="" mappings=[10="10",25="25",50="50",75="75",100="100"]`)
Reusing a map transformation would be a good thing:
* `Switch item=KUKodi_pvropentv mappings=[MAP(tvchannels.map)]`
* `Selection item=KUKodi_volume mappings=[MAP(volumelevels.map)]`
* `Switch item=HTSL_DIMM label="" mappings=[MAP(lightinglevels.map)]`
* `Selection item=WZL_COLOR label="" mappings=[MAP(colors.map)]`
* `Selection item=SB_SetM3U mappings=[MAP(playlists.map)]`
Thanks