diff --git a/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/handler/CloudDeviceHandler.java b/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/handler/CloudDeviceHandler.java index 18e19daf3386e..10a1bf2ae577c 100644 --- a/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/handler/CloudDeviceHandler.java +++ b/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/handler/CloudDeviceHandler.java @@ -257,6 +257,9 @@ protected void handleUpDownCommand(final ChannelUID channelUID, final UpDownType switch (channel.getFunction().getName()) { case CONTROLLINGTHEROLLERSHUTTER: handleOneZeroCommand(channelId, command == UP, REVEAL, SHUT); + final int value = command == UP ? 100 : 0; + updateState(channelUID, new PercentType(value)); + break; } } @@ -300,7 +303,7 @@ protected void handlePercentCommand(final ChannelUID channelUID, final PercentTy final pl.grzeslowski.jsupla.api.generated.model.Channel channel = queryForChannel(channelId); switch (channel.getFunction().getName()) { case CONTROLLINGTHEROLLERSHUTTER: - final int shut = command.intValue(); + final int shut = 100 - command.intValue(); logger.debug("Channel `{}` is roller shutter; setting shut={}%", channelUID, shut); final ChannelExecuteActionRequest action = new ChannelExecuteActionRequest().action(REVEAL_PARTIALLY).percentage(shut); channelsApi.executeAction(action, channelId); diff --git a/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/internal/cloud/functionswitch/FindStateFunctionSwitch.java b/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/internal/cloud/functionswitch/FindStateFunctionSwitch.java index 907241dd56231..31e75d7b41eb7 100644 --- a/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/internal/cloud/functionswitch/FindStateFunctionSwitch.java +++ b/bundles/org.openhab.binding.supla/src/main/java/org/openhab/binding/supla/internal/cloud/functionswitch/FindStateFunctionSwitch.java @@ -138,7 +138,11 @@ public Optional onOpeningSensorDoor(Channel channel) { @Override public Optional onControllingTheRollerShutter(Channel channel) { - return of(channel).map(Channel::getState).map(ChannelState::getShut).map(PercentType::new); + return of(channel) + .map(Channel::getState) + .map(ChannelState::getShut) + .map(shut -> 100 - shut) + .map(PercentType::new); } @Override