Trying to configure a stepper for volume control on a LG TV, emulating the way its done in the bindings docs. Of course those docs are for text file configs.
The example docs show a switch item with mapping to make it look like a stepper.
I’m trying to use a stepper list item to do something similar, but the question is how to configure it.
The example in the docs uses a rule to convert the 0 and 1 into Increase and Decrease commands to send to the device.
rule "VolumeUpDown"
when Item LG_TV0_VolDummy received command
then
switch receivedCommand{
case 0: LG_TV0_Volume.sendCommand(DECREASE)
case 1: LG_TV0_Volume.sendCommand(INCREASE)
}
end
Is there a way to configure a stepper to directly create Increase and Decrease commands?
It seems like all a stepper does is increase or decrease a number value.
You don’t need no rule and no proxy Item. Of course, LG_TV0_Volume has to be of type Dimmer and the linked channel has to support commands INCREASE and DECREASE.
My explanation was not clear. I’m using MainUI not text items.
I created a Number Item
label: LG Volume Dummy
type: Number
category: ""
groupNames:
- NewTV
tags:
- Setpoint
and then added metadata for a Default List Item Widget for a stepper item and configured max of 1 and Min of 0
No pages
Administration
LGVolumeDummy
L
LG Volume Dummy
Number
1
Tags
tag_fill
Setpoint
Semantic Classification
class
Point_Setpoint
isPointOf
NewTV
Direct Parent Groups
Metadata
Channel Links
Tip: Use the developer sidebar (Shift+Alt+D) to search for usages of this Item
Edit Item Metadata: listWidget
1
value: oh-stepper-item
2
config:
3
step: 1
4
min: 0
5
max: 1
6
buttonsOnly: true
7
but this only gives me an item that moves between 0 and 1.
Is there some way to add mapping to this item to create the Increase and Decrease commands directly?
Not with an oh-stepper-item widget by itself. You’d need to create a widget that includes buttons to send INCREASE/DECREASE commands. I’m pretty sure there are example on the marketplace for this sort of thing. Browse around and look at the code for one that you like.