Value + 1

Hello,

I like to send after change (switch) my curent value + 1.

How I have to create my rule?

rule "Lauter PLUS"
when
Item OnkyoPlus received update
then
onkyoVolume1 = onkyoVolume1 + 1
end

Dimmer onkyoVolume1 “Lautstärke [%d]” (Onkyo) {onkyo=“INIT:Musik:VOLUME_QUERY, INCREASE:Musik:VOLUME_UP, DECREASE:Musik:VOLUME_DOWN, *:Musik:VOLUME_SET”, knx=“0/6/4”}
Switch OnkyoMinus “Lautstärke Plus” (gHidden) { knx=“0/6/8” }
Switch OnkyoPlus “Lautstärke Minus” (gHidden) { knx=“0/6/9” }

Background: controll via KNX controller

Shouldn’t
sendCommand(onkyoVolume1,VOLUME_UP)
do the trick?

was not successful …any other idee?

if you look in events.log, what command gets sent when you press the Dimmer item?
if you send this command in the rule it should work…

Shouldn’t be

sendCommand(onkyoVolume1,INCREASE)

?

is not working - how I can use the current voume no. + 1?

var Number TheVolume= (onkyoVolume1.state as DecimalType)+1
sendCommand(onkyoVolume1,TheVolume)

Dimmer Items take values from 0 to 100, so adding 1 will not make much of a difference. Play with the value.
Also you need to make sure that the values you send to not go below 0 or above 100.

Thanks a lot! It works :slight_smile: great