Rollershutter with transformation does no longer send up/down commands after upgrade from 3.4 to 4.0.2

In openhab 3.4 I had the following item:

Rollershutter    rolladenGaragentor      "Garagentor [%d %%]"                 <blinds>    (gGaragenTor)              ["OpenState"]    {influxdb="Jalousien" [floor="Aussen"], channel="knx:device:bridge:backbone:garagedoor:Steuerung" [profile="transform:JS", function="torfix.js"]}

with this simple transformation:

(function (i) {
    return 100 - parseInt(i);

it worked fine. With openhab 4.0.2 I adopted the item code like this:

Rollershutter    rolladenGaragentor      "Garagentor [%d %%]"                 <blinds>    (gGaragenTor)              ["OpenState"]    {influxdb="Jalousien" [floor="Aussen"], channel="knx:device:bridge:backbone:garagedoor:Steuerung" [profile="transform:JS", toItemScript="torfix.js", toHandlerScript="torfix.js"]}

If I operate the rollershutter outside of openhab, the values in openhab are updating correctly.

However if I press the up/down buttons in openhab the value changes immediately to 100 or to 0 and no up/down command gets send to the knx bus.

In OH4, to have the JavaScript transform, you must install one of the JavaScript scripting add-ons. If you were using the built-in JavaScript in OH3, that is no longer installed by default.

The JS scripting addon is installed, the transformation is working as expected, but as I said the up/down button doesn’t work.

In OH 4 the transform profile now has two parts. There’s the Thing to Item transformation and the Item to Thing transformation. I’ve no idea how these are represented in a text based Item config.

But it sounds like you need an Item to Thing transformation perhaps, or maybe a transformation on the Channel config. I don’t use KNX so can’t be more specific.

WE’re going to need more specifics on what up down button. Are you using sitemaps, MainUI? Is this a button you’ve created or a default widget?

I have both toItemScript and toHandlerScript specified, so this should handle both directions.
However I’m unsure if I need to modify the javascript code to return the proper unit, which should be Dimensionless with ‘%’

As to what UI I’m refering to,I use just the default MainUI, specifically the autogenerated buttons / rollershutter control by the semantic model.

I think it’s worth investigating if the unit is the issue. There’s already been one report of a % unit in a label interfering with the proper function of a widget:

Try removing the unit in the label on the item.

By my understanding this shouldn’t happen: 1) I though the new UoM only applied to Number:unit items, but that’s a dimmer item in the previous report so it’s possible this extends to the your rollershutter item, 2) the arrows in the rollershutter widget are sending UP and DOWN commands, so I have no idea why the UoM should interfere with that.

It is supposed to only be looked at for Number:Unit Items. In all other cases it is supposed to be ignored. If that isn’t the case an issue should be filed.