So I integrated my 70" sharp aquos tv into OH with Power and inputs etc. I am working now on the volume which works if i set an actual number. What I need is some way to increment the number like with the setpoint command preferably. my current setup is this,
Your best bet is a rule. Put a slider or setpoint on your sitemap and use a Number Item. then write a rule that triggers when the Number Item is updated and send out the new volume to the TV.
rule "Volume Up/Down"
when
Item Volume received command
then
var Number percent = 0
if(Volume.state instanceof DecimalType) percent = Volume.state as DecimalType
You want to use a setpoint to adjust the value of an Item. The setpoint is issuing INCREASE and DECREASE command which means your Item needs to be able to understand INCREASE and DECREASE commands. Looking at the list of Item types and what they accept on the Items wiki page I see that Number only accepts Decimal commands.
I think what you want to use is a Dimmer type. It will accept OnOff, Increase/Decrease, or Percent type commands which is perfect in this situation as Percent can only between 0 and 100. I think if you use a Dimmer you don’t even need have the rule.