Sitemap button state

Hi everyone,
I’ve searched a lot, but it seems I’m unable to find the correct answer to a really simple question…

I’m trying to have a simple button (not a switch) in my sitemap… Visually I like the mapping representation, but I simply don’t want the button to remain selected. That’s also a problem when I try to press the already selected button, since my rules don’t fire because the state is already selected…

This is what I have so far:
Items:

Number      iSC_PT_INPUT    "Input"

Sitemap:

Switch item= iSC_PT_INPUT label="Button" mappings=[0="Close", 1="Open"]

Rules:

rule rSC_PT
when
    Item iSC_PT_INPUT received command
then
    if (receivedCommand == 0) {
    //close all rollershutters
        rs.sendCommand(DOWN)
  }
end

…It’s all about rollershutters…

Please setup the Item as follows:

Number      iSC_PT_INPUT    "Input" {autoupdate="false"}

This will prevent openHAB from setting the state of iSC_PT_INPUT according to the last command.

I already tried that, but the button still remains highlighted…

Number      iSC_PT_INPUT    "Input"
rule rSC_PT
when
    Item iSC_PT_INPUT received command
then
    if (receivedCommand == 0) {
    //close all rollershutters
        rs.sendCommand(DOWN)
    }
    iSC_PT_INPUT.postUpdate(2)
end

Yes it should work by setting a value that is not covered by the mappings.

Thanks for the answers (and tips), but it doesn’t seem to work…
The log correctly display a changed value (from 0 to 2), but in the basic UI the button sill remains selected…

Any other ideas or different items to use?

What OS, oH and java-version do you use?
Have you restartet OH after changing the rule?

Ok, I didn’t restart OH after the update…now it works :slight_smile:
thanks a lot :slight_smile: