Items:
Number Sender “Radio”
Dimmer Volume “Volume [%.1f %%]”
Rules:
rule “Volume”
when
Item Volume received command
then
if (receivedCommand instanceof PercentType) {
setMasterVolume(receivedCommand)
} else {
if (receivedCommand == INCREASE) increaseMasterVolume(20)
if (receivedCommand == DECREASE) decreaseMasterVolume(20)
}
end
First, my item is NotificationVolume and I see that yours is Volume. So you should change the executeCommandLine accordingly. I see that your second example uses the right item, but the first one didn’t.
Second, as you can see, the volume is set in percent, so, if you Volume has states of 1, 2 and so on you can multiply the value by 10 or change the mappings to 10, 20, etc.
hi sorry im dig it i used this rule for long time but now when updated to openhab 3 when i try to use it log file says “cant find coomand” if i use command form terminal i can change volume