Item-type Number and INCREASE/DECREASE commands


in the lgwebos binding I am using INCREASE and DECREASE commands to send optimized “up” and “down” messages to the smart TV. It corresponds to pressing “up” or “down” buttons on the remote control.

I noticed that INCREASE and DECREASE are accepted for channel of item-type Dimmer, but not anymore for channel of item-type Number. Probably since 2.2 -> 2.3.

Is this a bug? Or is this there a way that I can tell openhab in the thing-types.xml file that those commands are acceptable?

<channel-type id="volumeType">
	<description>Current Volume Setting</description>
	<state min="0" max="100" step="1"></state>
<channel-type id="channelType">
	<description>Current Channel</description>
	<state min="1" step="1"></state>

Kind Regards

Number has only ever been documented to support DecimalType. If it accepted INCREASE/DECREASE in the past I suspect it was a mistake that it ever worked.

I see no reason why Number shouldn’t support those commands though so I suggest filing an issue at the Eclipse Smarthome github. It would be an enhancement request.

However, if your volume isn’t supposed to go over 100 anyway, Dimmer is the appropriate Item to use anyway as it has built in protection to prevent the number from going over 100 or under 0.

raised ticket #6166

Interesting idea. Perhaps the same result could be achieved by generalizing the Dimmer type instead - somehow being able to optionally specify Max/Min/Step parameters.

As Item Commands get passed to bindings, there may some knock-on if new commands are added to Number type. Although I would imagine they should just get ignored.