I am using following item config within a group (my plan is to use in future more String and Rollershutter Items):
Group gName "group name" { .....
String test_stop "name1" (gName) {....
Rollershutter test "name2" (gName) {....
String test2_stop "name10" (gName) {....
Rollershutter test2 "name20" (gName) {....
....
My rule should be implemented like this, if a member of the string item receives STOP, the item name should be modified (remove “_stop”) to get the item name of the Rollershutter.
I am able to do the modification of the string via REGEX but openhab does not like to use this modified string in combination with sendCommand():
rule "test"
when
Member of gName received command STOP
then
val itemName = transform("REGEX","(.*)_stop",triggeringItem.name) //remove _stop string
itemName.sendCommand(STOP)
end
I assume I need something like a string cast to rollershutter?
Someone a good advice?
One of my error messages was like:
[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'test': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(java.lang.String,java.lang.String) on instance: null