Not directly. You can create a Proxy Item to receive the UP/DOWN from the Setpoint on the sitemap and using a Rule sendCommand(“INC”/“DEC”) to your Item that needs the String.
oh, @rlkoshak glad to hear! That sounds good.
How does a proxy receiving an up/down arrow look like?
I’m not able to find a documentation that describes how to separate the up and down buttons in rules…
@rossko57 - Thats not what i’m seeking, found tonns of samples like this here in this community.
What i’m looking for, is the determination of up and down from a setpoint as separate commands.
(dummycode i wold like to see work):
rule "my conversion rule"
when
Item some_dummy_item received command
then
if(some_dummy_item == up) some_real_item.sendCommand("INC")
if(some_dummy_item == down) some_real_item.sendCommand("DEC")
end
Oh right, that makes it harder. I’d use something with regular up/down buttons, but if you must use a setpoint;
You will need to compare the numeric command with the current state of the Item, to see if setpoint commanded more or less. I think you’d need autoupdate ="false" on your dummy Item to make it reliable.
What value do you want displayed in your setpoint? You would probably want another rule to couple the real value of your device back to the dummy Item used for setpoint.
rule "setpoint follow"
when
Item testNum received command
then
if (receivedCommand > testNum.state) {
realItem.sendCommand("INC")
} else if (receivedCommand < testNum.state) {
realItem.sendCommand("DEC")
} else {
// maybe it is maxed out
logInfo("test", "Unexpected " + receivedCommand.toString)
}
end
rule "setpoint state"
when
Item realItem changed
then
testNum.postUpdate(realItem.state)
end
That would assume your “real Item” could accept string commands, and has some feedback from the target device.
But from what you posted earlier, neither of those is true?
You can change to a String type Item of course.
If you have no feedback, you don’t need the second rule or autoupdate="false"
But you will need to post a valid number at startup to get the setpoint working.