I am developing a binding which interfaces to a device which has a concept called Programs, which are very similar to Rules within Openhab.
I have a Program thing, and then a channel called ‘control’. You could use this channel to run, run the then clause, run the else clause, or stop the program. I see this as rather similar to how the Sonos binding controls the players.
I can do this within a sitemap:
Switch item=isy_program_isybridge_shower_preheat_control mappings=["run"="Run","runThen"="Run Then","runElse"="Run Else","stop"="Stop"] label="Preheat Shower - Run"
Can I specify that mapping info somewhere within the binding so that when a user adds the program_control item to a sitemap, they automatically can get such behavior? It would be nice if it rendered with all these choices automatically within the Paper UI as well.
Because ON/OFF don’t really make sense for the item, the default behavior of just adding the item to a sitemap won’t work, and that’s less than great for a newish user which hasn’t discovered mapping yet, surprised didn’t read the documentation thoroughly enough
The following won’t work because ON/OFF aren’t valid commands for this item.
In my example I could map ON and OFF as defaults which kind of make sense in this example, but I doubt that would be the case for many other items.
Should I be using an item type other than switch? I would prefer to render the item as a label and the 4 push buttons to trigger changes.