Squeezebox volume increment / decrement

I am trying to create some buttons that will increase and decrease the squeezebox volume by 5

I tried this in my rule:
var int myvol = sq_masterbedroom_volume.state
myvol = myvol + 5
squeezeboxVolume(“masterbedroom”,myvol)

but it did not work. is there an easy way to accomplish this without using variables? I’m guessing I am not casting something correctly…

got it :slightly_smiling:
var int myvol = (sq_masterbedroom_volume.state as DecimalType).intValue
myvol = myvol + 5
squeezeboxVolume(“masterbedroom”,myvol)

1 Like