Hi guys,
I’m having some trouble working out how to run a script per button/mapping in my sitemap. I’d like to be able to have a single item in my sitemap with mappings for + and - that allow me to run a different script per + or - button and ideally have that script run each time the button is pressed.
I’ve tried the following:
Things:
Thing exec:command:TV_GF_Vol_Up "TV" [ command="python /home/openhabian/addons/BlackBeanControl/BlackBeanControl.py -c LG_TV_Vol_Up -d Lounge", timeout=15, interval=0, autorun=true ]
Thing exec:command:TV_GF_Vol_Down "TV" [ command="python /home/openhabian/addons/BlackBeanControl/BlackBeanControl.py -c LG_TV_Vol_Down -d Lounge", timeout=15, interval=0, autorun=true ]
Items:
String TV_GF_Volume "TV" { channel="ON:exec:command:TV_GF_Vol_Up:input, OFF:exec:command:TV_GF_Vol_Down:input" }
Sitemap:
Switch item=TV_GF_Volume label="Volume" mappings=[OFF="-", ON="+"]
All that happens when I press the + or - button is that each of the commands is run one after the other.
Also when I press either of the buttons multiple times I don’t get the command running a second time, it only runs when changing states.
I have a workaround with a single button per + and - with a rule that triggers the exec binding, but it feels very messy. I’m no OH pro but I feel like the above should work.
Thanks in advance for your help.