I would set this one up a little differently. Instead of having the UI item “in the middle” - I would put it on the side. Like this:
I added a trigger because the UI item goes into “rapid fire” mode sending tons of messages through while you slide the slider. I also added debugs to everything. You’ll want to start watching Debug1 from OpenHAB and Debug7 which is where I’m putting the UI numbers into the mix. I wasn’t able to see what’s coming out of the openhab rollershutter item since I don’t have any actual rollershutter items.
My best advice is the same every time - watch the debug screen. Then you’ll be able to see where your code is falling apart.
Code for the picture above:
[{"id":"97f5514b.dcd9b","type":"function","z":"210e394a.f9e70e","name":"Target Position ","func":"var input = 100 - parseFloat(msg.payload)\nvar delay = {payload:0};\nif(input < 101){\n msg.payload = {\n \"TargetPosition\": input\n };\n delay.payload = {\n \"CurrentPosition\": input\n };\n return [msg,delay];\n}","outputs":2,"noerr":0,"x":1080,"y":240,"wires":[["8262c6ca.81bf9","d73fcfa2.f9d92"],["8262c6ca.81bf9","455bad8e.e3c59c"]]},{"id":"8262c6ca.81bf9","type":"homekit-service","z":"210e394a.f9e70e","bridge":"f5487faf.eba98","name":"Rollo Büro","serviceName":"WindowCovering","manufacturer":"Hager","model":"Default Model","serialNo":"Default Serial Number","characteristicProperties":"{}","x":1330,"y":240,"wires":[["b66b0057.a31638","c070c6bf.3bae7"]]},{"id":"e5abf35e.bdebd","type":"openhab2-in","z":"210e394a.f9e70e","name":"","controller":"","itemname":"","x":790,"y":240,"wires":[["97f5514b.dcd9b","6b14bc38.8bf314"],[]]},{"id":"455bad8e.e3c59c","type":"debug","z":"210e394a.f9e70e","name":"Debug5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1270,"y":320,"wires":[]},{"id":"d73fcfa2.f9d92","type":"debug","z":"210e394a.f9e70e","name":"Debug2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1290,"y":200,"wires":[]},{"id":"65eb4af7.60975c","type":"function","z":"210e394a.f9e70e","name":"MSG to String","func":"msg.payload = String(msg.payload);\nreturn msg;","outputs":2,"noerr":0,"x":1200,"y":480,"wires":[["1e393df4.a436aa","97f5514b.dcd9b"],[]]},{"id":"b66b0057.a31638","type":"function","z":"210e394a.f9e70e","name":"Rollo out","func":"var t = context.get('t')||0;\nvar delay = {payload:0}\nif(msg.payload.TargetPosition){\n t = msg.payload.TargetPosition;\n context.set('t',t);\n msg.payload=100 - t\n}\nif(msg.payload.TargetPosition === 0){\n t = msg.payload.TargetPosition;\n context.set('t',t);\n msg.payload=100 -t\n}\nif (msg.hap.context !== undefined){\n delay.payload = {\n \"CurrentPosition\": 100 - t\n };\n return [msg,delay]\n}","outputs":1,"noerr":0,"x":1520,"y":220,"wires":[["803dba0.876a9c8","e17427f8.b991c8"]]},{"id":"c070c6bf.3bae7","type":"debug","z":"210e394a.f9e70e","name":"Debug3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1520,"y":280,"wires":[]},{"id":"6b14bc38.8bf314","type":"debug","z":"210e394a.f9e70e","name":"Debug1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":180,"wires":[]},{"id":"1e393df4.a436aa","type":"debug","z":"210e394a.f9e70e","name":"Debug7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1400,"y":560,"wires":[]},{"id":"88d696fa.f8fb38","type":"trigger","z":"210e394a.f9e70e","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"250","extend":true,"units":"ms","reset":"","bytopic":"all","name":"","x":1000,"y":480,"wires":[["65eb4af7.60975c"]]},{"id":"803dba0.876a9c8","type":"openhab2-out","z":"210e394a.f9e70e","name":"","controller":"","itemname":"","topic":"ItemCommand","payload":"","x":1740,"y":220,"wires":[[]]},{"id":"e17427f8.b991c8","type":"debug","z":"210e394a.f9e70e","name":"Debug4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1740,"y":280,"wires":[]},{"id":"270d4255.31ea56","type":"ui_slider","z":"210e394a.f9e70e","name":"","label":"Rolladen Büro","group":"451c1b2a.85ce2c","order":3,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":800,"y":480,"wires":[["b50ce67d.42236","88d696fa.f8fb38"]]},{"id":"b50ce67d.42236","type":"debug","z":"210e394a.f9e70e","name":"Debug6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1200,"y":560,"wires":[]},{"id":"f5487faf.eba98","type":"homekit-bridge","z":"","bridgeName":"Homekit-Bridge","pinCode":"031-45-154","port":"","manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number"},{"id":"451c1b2a.85ce2c","type":"ui_group","z":"","name":"Büro","tab":"b8235cb8.717308","order":2,"disp":true,"width":"6","collapse":false},{"id":"b8235cb8.717308","type":"ui_tab","z":"","name":"Obergeschoss","icon":"dashboard","order":3}]