ReentrantLock - Errors

i have multiple rules which uses the lambda, sometimes i got errors during the execution of the rule/lambda if i switches the items very fast. if i do slowly, than everything works fine.
i tried to use reentrantlock, but i got errors. why?

import java.util.concurrent.locks.ReentrantLock

var java.util.concurrent.locks.ReentrantLock lock_rollo_lambda  = new java.util.concurrent.locks.ReentrantLock()

/*
 * Error during the execution of rule 'rule_ardu02_out_20_13_P_00_01_received_command': The name 'lock_rollo_lambda' cannot be resolved to an item or type.
*/

val Functions$Function3 rollo_lambda = 
[
    ...
|
	lock_rollo_lambda.lock()		// <-- NO ERROR
...
	lock_rollo_lambda.unlock()		// <-- red-lined: Type mismatch: cannot convert from void to Object
]

Why hide the code? It’s not helping. You have to pass the global lock into the lambda.

i thought it was (is) not important, and it is a little bit long.

import org.openhab.core.library.types.*
import org.openhab.core.types.*
import org.eclipse.xtext.xbase.lib.*
import org.eclipse.smarthome.core.library.items.*
import java.util.Locale
import java.util.concurrent.locks.ReentrantLock


var java.util.concurrent.locks.ReentrantLock lock_rollo_lambda  = new java.util.concurrent.locks.ReentrantLock()

/*
 * Error during the execution of rule 'rule_ardu02_out_20_13_P_00_01_received_command': The name 'lock_rollo_lambda' cannot be resolved to an item or type.
*/

val Functions$Function3 rollo_lambda = 
[
    org.openhab.core.library.items.RollershutterItem rsiRollershutterItem,
    org.openhab.core.types.Command receivedCommand,
    org.openhab.core.library.items.StringItem rsiStatusItem |
    
	lock_rollo_lambda.lock()

	// ardu02_out_20_13_P_06_07
	val int		_threadSleepTime	= 250
	var int		_whileExitCounter	= 0
	val int		_whileExitCountMax	= 20

	val _NameArray				= rsiRollershutterItem.name.split("_")
	val String	_rsiNodeName	= _NameArray.get(0)
	val String	_rsiDirecion	= _NameArray.get(1)
	val int		_rsiExpAddress	= Integer::parseInt(_NameArray.get(2))
	val int		_rsiExpBank		= Integer::parseInt(_NameArray.get(3))
	val String	_rsiPinIdent	= _NameArray.get(4) // ignore it
	val int		_rsiRelPower	= Integer::parseInt(_NameArray.get(5))
	val int		_rsiRelDirec	= Integer::parseInt(_NameArray.get(6))

	val String _strRelaisPower_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelPower)
	val String _strRelaisPower_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelPower)

	val String _strRelaisDirec_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)
	val String _strRelaisDirec_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)

	logInfo("rule.info", rsiRollershutterItem.name)
	logInfo("rule.info", rsiStatusItem.name)
	logInfo("rule.info", _strRelaisPower_On)
	logInfo("rule.info", _strRelaisPower_Off)
	logInfo("rule.info", _strRelaisDirec_On)
	logInfo("rule.info", _strRelaisDirec_Off)
	
	publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)

	while (rsiStatusItem.state == "1" && receivedCommand != STOP && _whileExitCounter < _whileExitCountMax)
	{
		logInfo("rule.info", "Warteschleife")
		Thread::sleep(500)
		publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)
		_whileExitCounter++
	}
	
	if (rsiStatusItem.state == "0" && receivedCommand != STOP)
	{
		if (receivedCommand == UP)				//  UP
		{
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "sub/i2c", _strRelaisDirec_On)
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "sub/i2c", _strRelaisPower_On)			
		}
		else if (receivedCommand == DOWN)		//  DOWN
		{
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "sub/i2c", _strRelaisDirec_Off)
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "sub/i2c", _strRelaisPower_On)			
		}
	}
	else									// STOP
	{
		publish("mosquitto_cubie", "sub/i2c", _strRelaisPower_Off)
		Thread::sleep(_threadSleepTime)
		publish("mosquitto_cubie", "sub/i2c", _strRelaisDirec_Off)			
	}

	lock_rollo_lambda.unlock()
	//Thread::sleep(_threadSleepTime)
	//logInfo("rule.info", "i got error if i were commented out"
]

i figured out, if it is the last statement in the lambda, than i got this error, if i comment out the last comments, than always only the last line=last command got the error.

the designer says (for the last line): Type mismatch: cannot convert from void to Object

See Rich’s tip here concerning true

I still think you need to pass the reentrant lock into the lambda. The error message is telling you that.

i don’t think so, but i’ll give it a try.

strange is the behaviour, i think, about the “last line error”.
every command i wrote in the last line produces an error.

Lambdas do not have access to global vars and vals. @rossko57 is right, you must pass the reentrant lock to the lambda.

And the link he provided is the source of your error. The last line of a lambda must either be an object, a primitive, or a call to a method that returns one of these. Nether Thread::sleep nor logInfo return anything (I.e. they return void) so they cannot be the last line executed in a lambda.

ok, i’ll try it.
did i use always the same lock for every rule who calls the lambda?

That is the purpose of the lock - if there is only one shared lock then only one thread can execute at a time, and the others have to wait their turn for the lock.

Railway enthusiasts will think of a “single line token”

Be careful to always release the lock.

so every rule is multithreaded, but the lambda is single-threaded for all rules-threads?

where the hell should i write the unlock? the rules are confusing me …

import org.openhab.core.library.types.*
import org.openhab.core.types.*
import org.eclipse.xtext.xbase.lib.*
import org.eclipse.smarthome.core.library.items.*
import java.util.Locale
import java.util.concurrent.locks.ReentrantLock


var java.util.concurrent.locks.ReentrantLock lock_rollo_lambda  = new java.util.concurrent.locks.ReentrantLock()



val Functions$Function4 rollo_lambda = 
[
    org.openhab.core.library.items.RollershutterItem rsiRollershutterItem,
    org.openhab.core.types.Command receivedCommand,
    org.openhab.core.library.items.StringItem rsiStatusItem,
    java.util.concurrent.locks.ReentrantLock lockThatLambda
|
	lockThatLambda.lock()

	// ardu02_out_20_13_P_06_07
	val int		_threadSleepTime	= 250
	var int		_whileExitCounter	= 0
	val int		_whileExitCountMax	= 20

	val _NameArray				= rsiRollershutterItem.name.split("_")
	val String	_rsiNodeName	= _NameArray.get(0)
	val String	_rsiDirecion	= _NameArray.get(1)
	val int		_rsiExpAddress	= Integer::parseInt(_NameArray.get(2))
	val int		_rsiExpBank		= Integer::parseInt(_NameArray.get(3))
	val String	_rsiPinIdent	= _NameArray.get(4) // ignore it
	val int		_rsiRelPower	= Integer::parseInt(_NameArray.get(5))
	val int		_rsiRelDirec	= Integer::parseInt(_NameArray.get(6))

	val String _strRelaisPower_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelPower)
	val String _strRelaisPower_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelPower)

	val String _strRelaisDirec_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)
	val String _strRelaisDirec_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)

	logInfo("rule.info", rsiRollershutterItem.name)
	logInfo("rule.info", rsiStatusItem.name)
	logInfo("rule.info", _strRelaisPower_On)
	logInfo("rule.info", _strRelaisPower_Off)
	logInfo("rule.info", _strRelaisDirec_On)
	logInfo("rule.info", _strRelaisDirec_Off)
	
	publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)

	while (rsiStatusItem.state == "1" && receivedCommand != STOP && _whileExitCounter < _whileExitCountMax)
	{
		logInfo("rule.info", "Warteschleife")
		Thread::sleep(500)
		publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)
		_whileExitCounter++
	}
	
	if (rsiStatusItem.state == "0" && receivedCommand != STOP)
	{
		if (receivedCommand == UP)				//  UP
		{
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_On)
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_On)			
		}
		else if (receivedCommand == DOWN)		//  DOWN
		{
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_Off)
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_On)			
		}
		lockThatLambda.unlock()   // <-- ERROR
	}
	else									// STOP
	{
		publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)
		Thread::sleep(_threadSleepTime)
		publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_Off)			
		lockThatLambda.unlock()   // <-- ERROR
	} 
	lockThatLambda.unlock()   // <-- ERROR
]



// 0x20 - 0x12

rule "rule_ardu02_out_20_12_P_00_01_received_command"
when
    Item ardu02_out_20_12_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_00_01, receivedCommand, ardu02_out_20_12_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_12_P_02_03_received_command"
when
    Item ardu02_out_20_12_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_02_03, receivedCommand, ardu02_out_20_12_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_12_P_04_05_received_command"
when
    Item ardu02_out_20_12_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_04_05, receivedCommand, ardu02_out_20_12_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_12_P_06_07_received_command"
when
    Item ardu02_out_20_12_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_06_07, receivedCommand, ardu02_out_20_12_06_stat, lock_rollo_lambda)
end

// 0x20 - 0x13

rule "rule_ardu02_out_20_13_P_00_01_received_command"
when
    Item ardu02_out_20_13_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_00_01, receivedCommand, ardu02_out_20_13_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_02_03_received_command"
when
    Item ardu02_out_20_13_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_02_03, receivedCommand, ardu02_out_20_13_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_04_05_received_command"
when
    Item ardu02_out_20_13_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_04_05, receivedCommand, ardu02_out_20_13_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_06_07_received_command"
when
    Item ardu02_out_20_13_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_06_07, receivedCommand, ardu02_out_20_13_06_stat, lock_rollo_lambda)
end

// 0x21 - 0x12

rule "rule_ardu02_out_21_12_P_00_01_received_command"
when
    Item ardu02_out_21_12_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_00_01, receivedCommand, ardu02_out_21_12_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_02_03_received_command"
when
    Item ardu02_out_21_12_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_02_03, receivedCommand, ardu02_out_21_12_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_04_05_received_command"
when
    Item ardu02_out_21_12_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_04_05, receivedCommand, ardu02_out_21_12_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_06_07_received_command"
when
    Item ardu02_out_21_12_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_06_07, receivedCommand, ardu02_out_21_12_06_stat, lock_rollo_lambda)
end

// 0x21 - 0x13

rule "rule_ardu02_out_21_13_P_00_01_received_command"
when
    Item ardu02_out_21_13_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_00_01, receivedCommand, ardu02_out_21_13_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_02_03_received_command"
when
    Item ardu02_out_21_13_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_02_03, receivedCommand, ardu02_out_21_13_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_04_05_received_command"
when
    Item ardu02_out_21_13_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_04_05, receivedCommand, ardu02_out_21_13_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_06_07_received_command"
when
    Item ardu02_out_21_13_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_06_07, receivedCommand, ardu02_out_21_13_06_stat, lock_rollo_lambda)
end

Only if you make it that way, using a lock.

Your lambda takes a long time to execute, as there are while and sleep in it. That makes it more likely that it will get fired off again before it has finished the last run. That may or may not be a problem, depending what it does. But your first post suggested that you had found that it was a problem for you.

At its simplest, you lock once at the beginning of your lambda, and unlock it at the end, once, as the last thing you do (just before the true it was recommended that you put as the last line of your lambda).

Rules are multithreaded in that you can have multiple instances of the she rule executing at any given time. Lambdas are multithreaded in the same way. What makes this single threaded is the reentrant lock. The lock ensures only one thread can run at a time and the rest are awaiting their turn to acquire the lock.

You should always use locks with try, catch, finally and unlock in the catch and the finally clause (I’ve had cases where the finally didn’t run). This makes sure that the lock will always be unlocked even if there is an exception.

try{
    lock.lock
    // Your code
}
catch(Throwable t){
    logError("lambda", "error in lambda: " + t)
    lock.unlock
}
finally {
    lock.unlock
}

that was the magic

i put it in

thanks for explanation.

i’ll change the rules and will come back if more error occurs … and i know they will :smile:

Thanks a lot so long

actually, nothing is working anymore :frowning:

Details?

Are you on OH 1 or OH 2? If OH 2 you should not be using anything from org.openhab.core. Don’t import these and don’t include these when referencing any class. org.openhab.core.library.items.RollershutterItem should just be RollerShutterItem.

Version OH 1.8.3

You may have to give a little more info.
If we’re going to have to go with wild guesses, you’ve messed up the try-catch-finally and now the reentrant lock is locked forever ?

[ERROR] [enhab.model.script.rule.lambda] - buhahuha
[ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘rule_ardu02_out_20_12_P_00_01_received_command’: The name ‘.name’ cannot be resolved to an item or type.

import org.openhab.core.library.types.*
import org.openhab.core.types.*
import org.eclipse.xtext.xbase.lib.*
import org.eclipse.smarthome.core.library.items.*
import java.util.Locale
import java.util.concurrent.locks.ReentrantLock


var java.util.concurrent.locks.ReentrantLock lock_rollo_lambda  = new java.util.concurrent.locks.ReentrantLock()



val Functions$Function4 rollo_lambda = 
[
    RollershutterItem rsiRollershutterItem,
    org.openhab.core.types.Command receivedCommand,
    StringItem rsiStatusItem,
    java.util.concurrent.locks.ReentrantLock lockThatLambda
|
	//lockThatLambda.lock

	// ardu02_out_20_13_P_06_07
	val int		_threadSleepTime	= 250
	var int		_whileExitCounter	= 0
	val int		_whileExitCountMax	= 20

	val _NameArray				= rsiRollershutterItem.name.split("_")
	val String	_rsiNodeName	= _NameArray.get(0)
	val String	_rsiDirecion	= _NameArray.get(1)
	val int		_rsiExpAddress	= Integer::parseInt(_NameArray.get(2))
	val int		_rsiExpBank		= Integer::parseInt(_NameArray.get(3))
	val String	_rsiPinIdent	= _NameArray.get(4) // ignore it
	val int		_rsiRelPower	= Integer::parseInt(_NameArray.get(5))
	val int		_rsiRelDirec	= Integer::parseInt(_NameArray.get(6))

	val String _strRelaisPower_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelPower)
	val String _strRelaisPower_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelPower)

	val String _strRelaisDirec_On	= String::format("pinout:%1$d:%2$d:%3$d:1", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)
	val String _strRelaisDirec_Off	= String::format("pinout:%1$d:%2$d:%3$d:0", _rsiExpAddress, _rsiExpBank, _rsiRelDirec)

	logInfo("rule.info", rsiRollershutterItem.name)
	logInfo("rule.info", rsiStatusItem.name)
	logInfo("rule.info", _strRelaisPower_On)
	logInfo("rule.info", _strRelaisPower_Off)
	logInfo("rule.info", _strRelaisDirec_On)
	logInfo("rule.info", _strRelaisDirec_Off)
	
	try
	{
		logError("rule.lambda", "Begin Try")

		publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)

		while (rsiStatusItem.state == "1" && receivedCommand != STOP && _whileExitCounter < _whileExitCountMax)
		{
			logInfo("rule.info", "Warteschleife")
			Thread::sleep(500)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)
			_whileExitCounter++
		}
		
		if (rsiStatusItem.state == "0" && receivedCommand != STOP)
		{
			if (receivedCommand == UP)				//  UP
			{
				Thread::sleep(_threadSleepTime)
				publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_On)
				Thread::sleep(_threadSleepTime)
				publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_On)			
			}
			else if (receivedCommand == DOWN)		//  DOWN
			{
				Thread::sleep(_threadSleepTime)
				publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_Off)
				Thread::sleep(_threadSleepTime)
				publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_On)			
			}
		}
		else										// STOP
		{
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisPower_Off)
			Thread::sleep(_threadSleepTime)
			publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", _strRelaisDirec_Off)			
		} 
	}
	catch(Throwable t)
	{
		logError("rule.lambda", "catch error in lambda: " + t.localizedMessage.toString())
		//lockThatLambda.unlock
	}
	finally 
	{
		logError("rule.lambda", "finally in lambda: ")
		//lockThatLambda.unlock
	}

	true
]



// 0x20 - 0x12

rule "rule_ardu02_out_20_12_P_00_01_received_command"
when
    Item ardu02_out_20_12_P_00_01 received command
then
	logError("rule.lambda", "buhahuha")
	rollo_lambda.apply(ardu02_out_20_12_P_00_01, receivedCommand, ardu02_out_20_12_00_stat, lock_rollo_lambda)
	publish("mosquitto_cubie", "BB55/hctl/v1/ardu02/sub/i2c", "buhu") 
end

rule "rule_ardu02_out_20_12_P_02_03_received_command"
when
    Item ardu02_out_20_12_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_02_03, receivedCommand, ardu02_out_20_12_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_12_P_04_05_received_command"
when
    Item ardu02_out_20_12_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_04_05, receivedCommand, ardu02_out_20_12_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_12_P_06_07_received_command"
when
    Item ardu02_out_20_12_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_20_12_P_06_07, receivedCommand, ardu02_out_20_12_06_stat, lock_rollo_lambda)
end

// 0x20 - 0x13

rule "rule_ardu02_out_20_13_P_00_01_received_command"
when
    Item ardu02_out_20_13_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_00_01, receivedCommand, ardu02_out_20_13_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_02_03_received_command"
when
    Item ardu02_out_20_13_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_02_03, receivedCommand, ardu02_out_20_13_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_04_05_received_command"
when
    Item ardu02_out_20_13_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_04_05, receivedCommand, ardu02_out_20_13_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_20_13_P_06_07_received_command"
when
    Item ardu02_out_20_13_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_20_13_P_06_07, receivedCommand, ardu02_out_20_13_06_stat, lock_rollo_lambda)
end

// 0x21 - 0x12

rule "rule_ardu02_out_21_12_P_00_01_received_command"
when
    Item ardu02_out_21_12_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_00_01, receivedCommand, ardu02_out_21_12_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_02_03_received_command"
when
    Item ardu02_out_21_12_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_02_03, receivedCommand, ardu02_out_21_12_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_04_05_received_command"
when
    Item ardu02_out_21_12_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_04_05, receivedCommand, ardu02_out_21_12_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_12_P_06_07_received_command"
when
    Item ardu02_out_21_12_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_21_12_P_06_07, receivedCommand, ardu02_out_21_12_06_stat, lock_rollo_lambda)
end

// 0x21 - 0x13

rule "rule_ardu02_out_21_13_P_00_01_received_command"
when
    Item ardu02_out_21_13_P_00_01 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_00_01, receivedCommand, ardu02_out_21_13_00_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_02_03_received_command"
when
    Item ardu02_out_21_13_P_02_03 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_02_03, receivedCommand, ardu02_out_21_13_02_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_04_05_received_command"
when
    Item ardu02_out_21_13_P_04_05 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_04_05, receivedCommand, ardu02_out_21_13_04_stat, lock_rollo_lambda)
end

rule "rule_ardu02_out_21_13_P_06_07_received_command"
when
    Item ardu02_out_21_13_P_06_07 received command
then
	rollo_lambda.apply(ardu02_out_21_13_P_06_07, receivedCommand, ardu02_out_21_13_06_stat, lock_rollo_lambda)
end

Okay, let us do a little analysis.
One of your rules logs the text buhahuha just before it calls the lambda, so we know we got that far.
Then the log is complaining about something to do with .name
We don’t see the “Begin Try” message, so it goes wrong before it gets that far.

There’s only a couple of places in the lambda referring to .name before “Begin Try”, so we can look at each of those more carefully.

rsiRollershutterItem.name looks good, you declared that to be an Item type at the beginning of the lambda. And if we check the calling rule as well, you passed in an Item. Items have .name method, so all looks good there.

rsiStatusItem.name gets mentioned next. But you declared rsiStatusItem to be a Command type at the beginning of the lambda. Command types do not have a .name method.

I thought I passed a StringItem on 3rd position.

Definition:

String   ardu02_out_20_12_00_stat  "Status (ardu02-20-12-00) [%s]"

I dont know if it is important, but this is red unterlined

org.openhab.core.types.Command receivedCommand

Don’t know what I saw. The post has been edited since.