[SOLVED]Values for rollershutters state do not update in sitemaps

  • Platform information:
    • Hardware: Raspberry 3B+
    • OS: Raspbian GNU/Linux 10 (buster)
    • Java Runtime Environment: openjdk version “11.0.12” 2021-07-20
    • openHAB version: 3.2.0
  • Issue of the topic: values for rollershutters do not update in sitemaps

I have a couple of rollershutter devices connected to openHAB.
Both are Tasmota devices and they are defined in openHAB as follow:

**Items**
Rollershutter switch19_Finestra "Lucernario Camera Matrimoniale [%d %%]" <rollershutter> ["Control", "Level"] { channel="mqtt:topic:rgmqtt:sonoffPs19:finestra", alexa="RangeController.rangeValue" [category="EXTERIOR_BLIND", friendlyNames="@Setting.Opening", supportedRange="0:100:20", unitOfMeasure="Percent", actionMappings="Close=0,Open=100,Lower=(-20),Raise=(+20)", stateMappings="Closed=0,Open=1:100"]}
Rollershutter switch20_Finestra "Lucernario Bagno [%d %%]" <rollershutter> ["Control", "Level"] { channel="mqtt:topic:rgmqtt:sonoffPs20:finestra", alexa="RangeController.rangeValue" [category="EXTERIOR_BLIND", friendlyNames="@Setting.Opening", supportedRange="0:100:20", unitOfMeasure="Percent", actionMappings="Close=0,Open=100,Lower=(-20),Raise=(+20)", stateMappings="Closed=0,Open=1:100"]}

**Things**
Thing topic sonoffPs19 "Sonoff Power Switch 19" {
Channels:
    Type rollershutter : finestra "Lucernaio camera Matr" [
        stateTopic="switch19/stat/RESULT",
        commandTopic="switch19/cmnd/shutterposition1",
        transformationPattern="REGEX:(.*Shutter1.*)∩JSONPATH:$.Shutter1.Position",
        stop="STOP",
        retained=false
    ]
}
Thing topic sonoffPs20 "Sonoff Power Switch 20" {
Channels:
    Type rollershutter : finestra "Lucernaio Bagno" [
        stateTopic="switch20/stat/RESULT",
        commandTopic="switch20/cmnd/shutterposition1",
        transformationPattern="REGEX:(.*Shutter1.*)∩JSONPATH:$.Shutter1.Position",
        stop="STOP",
        retained=false
    ]
}

Everything is working fine, the devices are controlled by Alexa or by sitemaps interface without problems.
The only weird thing is that switch19_Finestra updates continuosly its state in sitemaps (during opening or closing) while switch20_Finestra doesn’t.
switch20_Finestra state jumps directly to 0 or 100 (accordingly with the moving direction) not showing the inbetween percentages.
When I look at the MQTT messages sent in real time both the devices send values for the state that changes along all the movement of the shutters.
I don’t understand where I’m wrong.

Can we see those too?

Look in your events.log for a better understanding of what is going on.

This is from openhab.log and from a subscription to the relevant topic for switch19:

2022-03-01 19:44:42.433 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'switch19_Finestra' received command UP
2022-03-01 19:44:42.445 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'switch19_Finestra' predicted to become UP
2022-03-01 19:44:42.453 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to UP
2022-03-01 19:44:42.457 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 100 to 0
2022-03-01 19:44:42.626 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER2":"OFF"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.626 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER2":"OFF"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.644 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"ON"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.644 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"ON"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.666 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"ShutterPosition1":0}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.666 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"ShutterPosition1":0}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.669 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":100,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:44:42.677 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 100
2022-03-01 19:44:42.681 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 0 to 100
2022-03-01 19:44:42.861 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 97
2022-03-01 19:44:42.866 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 100 to 97
2022-03-01 19:44:43.842 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 83
2022-03-01 19:44:43.845 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 97 to 83
2022-03-01 19:44:44.866 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 69
2022-03-01 19:44:44.870 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 83 to 69
2022-03-01 19:44:45.845 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 55
2022-03-01 19:44:45.853 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 69 to 55
2022-03-01 19:44:46.872 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 40
2022-03-01 19:44:46.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 55 to 40
2022-03-01 19:44:47.832 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 26
2022-03-01 19:44:47.838 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 40 to 26
2022-03-01 19:44:48.868 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 11
2022-03-01 19:44:48.871 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 26 to 11
2022-03-01 19:44:49.693 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"OFF"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:49.695 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"OFF"}' returned null on 'REGEX', discarding message
2022-03-01 19:44:50.214 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":0,"Direction":0,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:44:50.217 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 0
2022-03-01 19:44:50.220 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 11 to 0

----------------------------------
mosquitto_sub -d -t switch19/stat/RESULT

Client (null) sending CONNECT
Client (null) received CONNACK (0)
Client (null) sending SUBSCRIBE (Mid: 1, Topic: switch19/stat/RESULT, QoS: 0, Options: 0x00)
Client (null) received SUBACK
Subscribed (mid: 1): 0
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (16 bytes))
{"POWER2":"OFF"}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (15 bytes))
{"POWER1":"ON"}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (22 bytes))
{"ShutterPosition1":0}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (54 bytes))
{"Shutter1":{"Position":100,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":97,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":83,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":69,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":55,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":40,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":26,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (108 bytes))
{"Shutter1":{"Position":11,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (16 bytes))
{"POWER1":"OFF"}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch19/stat/RESULT', ... (52 bytes))
{"Shutter1":{"Position":0,"Direction":0,"Target":0}}

Looking now to the same info for switch21 we have:

tail -f /var/log/openhab/openhab.log | grep -e switch20_Finestra -e .mqtt.

2022-03-01 19:55:00.628 [DEBUG] [ing.mqtt.internal.action.MQTTActions] - MQTT publish to OH2/DEVICESLIST performed
2022-03-01 19:55:26.888 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'switch20_Finestra' received command UP
2022-03-01 19:55:26.901 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'switch20_Finestra' predicted to become UP
2022-03-01 19:55:26.908 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch20_Finestra' updated to UP
2022-03-01 19:55:26.917 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch20_Finestra' changed from 100 to 0
2022-03-01 19:55:27.020 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"ON"}' returned null on 'REGEX', discarding message
2022-03-01 19:55:27.038 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"ShutterPosition1":0}' returned null on 'REGEX', discarding message
2022-03-01 19:55:27.055 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":100,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:27.413 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":96,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:28.404 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":81,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:29.388 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":67,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:30.392 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":53,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:31.397 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":39,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:32.398 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":24,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:33.392 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":10,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:34.086 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"POWER1":"OFF"}' returned null on 'REGEX', discarding message
2022-03-01 19:55:34.623 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":0,"Direction":0,"Target":0}}' returned null on 'REGEX', discarding message

----------------------------------
mosquitto_sub -d -t switch20/stat/RESULT

Client (null) sending CONNECT
Client (null) received CONNACK (0)
Client (null) sending SUBSCRIBE (Mid: 1, Topic: switch20/stat/RESULT, QoS: 0, Options: 0x00)
Client (null) received SUBACK
Subscribed (mid: 1): 0
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (15 bytes))
{"POWER1":"ON"}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (22 bytes))
{"ShutterPosition1":0}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (54 bytes))
{"Shutter1":{"Position":100,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":96,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":81,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":67,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":53,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":39,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":24,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (53 bytes))
{"Shutter1":{"Position":10,"Direction":1,"Target":0}}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (16 bytes))
{"POWER1":"OFF"}
Client (null) received PUBLISH (d0, q0, r0, m0, 'switch20/stat/RESULT', ... (52 bytes))
{"Shutter1":{"Position":0,"Direction":0,"Target":0}}

It seems that the same MQTT messages on the topic are decoded for switch19 but not for switch20.
Maybe I’m not seeing something obvious …

Switch 20?

If you haven’t restarted the MQTT binding since your last edit, worth a try. This binding is not too clever about picking up detail xxx.things file edits in flight.

That’s about autoupdate, an openHAB internal feature

That’s a bit curious for switch 19. Are there other channels not shown to us?
(Unfortunately the message doesn’t tell us which thing/channel is at work.)

Sorry for the mistake @rossko57, yes it’s Switch20 as reported in the logs not Switch21 as stated in the comments.
No edits in flight. The behaviour is the one descripted since a lot of time. So also a lot of reboots inbetween :smile:

I reported only the relevant part (at leat in my humble opinion but maybe it is much more humble than my expectations :grimacing:) of the things file.
This are the complete definitions for Switch19 and Switch20:

    // Sonoff Power Switch 19 (4CH Pro)
    Thing topic sonoffPs19 "Sonoff Power Switch 19" @ "MQTT-Tasmota" {
    Channels:
        Type rollershutter : finestra "Lucernaio camera Matr" [
            stateTopic="switch19/stat/RESULT",
            commandTopic="switch19/cmnd/shutterposition1",
            // transformationPattern="JSONPATH:$.Shutter1.Position",
            transformationPattern="REGEX:(.*Shutter1.*)∩JSONPATH:$.Shutter1.Position",
            stop="STOP",
            retained=false
        ]
        Type rollershutter : oscurante "Oscurante camera Matr" [
            stateTopic="switch19/stat/RESULT",
            commandTopic="switch19/cmnd/shutterposition2",
            // transformationPattern="JSONPATH:$.Shutter2.Position",
            transformationPattern="REGEX:(.*Shutter2.*)∩JSONPATH:$.Shutter2.Position",
            stop="STOP",
            retained=false
        ]
        Type string : wifi-ap "Wifi AP" [ 
            stateTopic="switch19/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.AP"
        ]
        Type string : wifi-ssid "Wifi SSID" [ 
            stateTopic="switch19/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.SSId"
        ]
        Type string : wifi-rssi "Wifi RSSI" [ 
            stateTopic="switch19/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.RSSI"
        ]
        Type string : uptime "Uptime" [ 
            stateTopic="switch19/tele/STATE",
            transformationPattern="JSONPATH:$.Uptime"
        ]
        Type string : time "Time" [ 
            stateTopic="switch19/tele/STATE",
            transformationPattern="JSONPATH:$.Time"
        ]
        Type switch : unreachable "Unreachable" [ 
            stateTopic="switch19/tele/LWT",
            on="Offline",
            off="Online"          
        ]
        Type string : version "Versione" [
            stateTopic="switch19/stat/STATUS2", 
            transformationPattern="JSONPATH:$.StatusFWR.Version"
        ]
    }

    // Sonoff Power Switch 20 (DUALR3 v2.0)
    Thing topic sonoffPs20 "Sonoff Power Switch 20" @ "MQTT-Tasmota" {
    Channels:
        Type rollershutter : finestra "Lucernaio Bagno" [
            stateTopic="switch20/stat/RESULT",
            commandTopic="switch20/cmnd/shutterposition1",
            transformationPattern="REGEX:(.*Shutter1.*)∩JSONPATH:$.Shutter1.Position",
            stop="STOP",
            retained=false
        ]
        Type string : wifi-ap "Wifi AP" [ 
            stateTopic="switch20/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.AP"
        ]
        Type string : wifi-ssid "Wifi SSID" [ 
            stateTopic="switch20/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.SSId"
        ]
        Type string : wifi-rssi "Wifi RSSI" [ 
            stateTopic="switch20/tele/STATE",
            transformationPattern="JSONPATH:$.Wifi.RSSI"
        ]
        Type string : uptime "Uptime" [ 
            stateTopic="switch20/tele/STATE",
            transformationPattern="JSONPATH:$.Uptime"
        ]
        Type string : time "Time" [ 
            stateTopic="switch20/tele/STATE",
            transformationPattern="JSONPATH:$.Time"
        ]
        Type switch : unreachable "Unreachable" [ 
            stateTopic="switch20/tele/LWT",
            on="Offline",
            off="Online"          
        ]
        Type string : version "Versione" [
            stateTopic="switch20/stat/STATUS2", 
            transformationPattern="JSONPATH:$.StatusFWR.Version"
        ]
    }

I’ve also tried to put autoupdate in the item definition, but both false or true behaves in the same way: switch20 doesn’t show running values in sistemaps while the shutter is opening or closing.

If that is true, there is a clue to a problem. Duplicate Item entries or something, perhaps.

All that disabling autoupdate will do is to prevent the ‘predicted’ events generated after commands. That can be useful when looking into lack of device originated updates, but it certainly will not fix anything here.

I suggest a very close look at your Thing/channel properties using the GUI for oddities. It is not unknown for invisible control characters to end up in Things text files and corrupt parameters.
Do the other channels/Items associated with this topic Thing work as expected?

Failing that, type in a replacement channel config (no copy-paste) and restart the binding.

Maybe I wasn’t clear in my statement: “behaves in the same way” means that switch20 doens’t update continuosly its state neither with autoupdate=“false” nor with autoupdate=“true”. Of course with false not prediction occurs, while with true it occurs.
But this is not the problem I’m looking at.
I noted that while for switch19 I found state message in the logs:

2022-03-01 19:44:42.861 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 97
2022-03-01 19:44:42.866 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 100 to 97
2022-03-01 19:44:43.842 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'switch19_Finestra' updated to 83
2022-03-01 19:44:43.845 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'switch19_Finestra' changed from 97 to 83
...

when I look at switch20 I found discard messages from the mqtt transformation:

2022-03-01 19:55:27.413 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":96,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:28.404 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":81,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:29.388 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":67,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message
2022-03-01 19:55:30.392 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation '{"Shutter1":{"Position":53,"Direction":1,"Target":0}}' returned null on 'REGEX', discarding message

It is clear that if the transformation discard the message no update can be rendered on the sitemap.
I think this is the point but I don’t see where the two channel definitions are different.
The mqtt messages are:

switch19 ->>>> {"Shutter1":{"Position":95,"Direction":1,"Target":0},"Shutter2":{"Position":100,"Direction":0,"Target":100}}
switch20 ->>>> {"Shutter1":{"Position":19,"Direction":-1,"Target":100}}

The REGEX expression (.Shutter1.) returns in both cases the complete JSON.
This JSON is then fed into the JSONPATH transformation that should return the value of the key Shutter1.Position
Where I’m wrong?

Suggestions already offered.

I sorted it out.
I don’t really know where the culprit was but now the state value updates in realtime in sitemaps.
I added a new channel definition just below the switch20’s rolleshutter one, just to try to find the reason why I had trasformation discard messages.

        Type number : test "test" [
            stateTopic="switch20/stat/RESULT",
            transformationPattern="REGEX:(.*Shutter1.*)∩JSONPATH:$.Shutter1.Position"
        ]

The discard messages disappeared and the sitemap started to show changing values.
I then removed the addition I made and everything continued to work.

I think was the unsubscribing e and re-subscribing of all the channels from the related topics. The binding seemed not aware of the real definition of channels.

Thank you @rossko57 for pointing me towards the solution.