Hey Oliver,
many thanks for the script. I tried everything out and got the following error:
If the state of the rollingCode is e.g. ‘0x0001’:
2021-03-31 10:53:26.612 [INFO ] [.model.script.Shutter_BueroFlo.rules] - Rule started
2021-03-31 10:53:26.618 [INFO ] [.model.script.Shutter_BueroFlo.rules] - Thing: 'ShutterBueroFlo', Item: 'ShutterBueroFlo', Command: 'DOWN'
2021-03-31 10:53:26.622 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Shutter_BueroFlo-1' failed: Could not cast 0x0001 to org.openhab.core.library.types.DecimalType; line 84, column 35, length 89 in Shutter_BueroFlo
If the state of the rollingCode is e.g. ‘0001’ (i thought maybe he doesn’t like the leading ‘0x’):
2021-03-31 10:56:09.423 [INFO ] [.model.script.Shutter_BueroFlo.rules] - Rule started
2021-03-31 10:56:09.430 [INFO ] [.model.script.Shutter_BueroFlo.rules] - Thing: 'ShutterBueroFlo', Item: 'ShutterBueroFlo', Command: 'DOWN'
2021-03-31 10:56:09.440 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Shutter_BueroFlo-1' failed: Could not cast 0001 to org.openhab.core.library.types.DecimalType; line 84, column 35, length 89 in Shutter_BueroFlo
The referenced line in your rule is:
var String strPayLoad = "YsA1" + strRTSCode + "0" + strRollingCodeHex + strAddress + "\n"
My question is: How do I need to save the rollingCode state? I tried it in decimal values (1 and 101) as well and got the same error.
As short background:
I added a fifth item: The shutter itself, so that I could interact with it on my sitemap.
Rollershutter ShutterBueroFlo "Rolladen Büro Flo" <rollershutter> (gShutter_BueroFlo)
Of course I made sure, that all items are in the same group (gShutter_BueroFlo). And obviously the rule is triggered, as I can see in the logs.
Maybe it has something to do with the type of variable you store the rolling code in and after that parse it to the strPayLoad variable.
I found this link and that link that might help with the format of the rollingCode. Unfortanetly I am not expierienced enough in coding.
I would appreciate your help!