Hey Guys, I’ve been making the move to OH3 and I’m almost there.
I have a rule that doesn’t work anymore, I use this rule to switch inputs on an HDMI matrix that is connected via a usb to serial adapter.
I have the serial adapter working and I can send commands to the matrix so I can rule out issues with the serial binding, I only have issues when I try to send the command from this rule. I get the following error whenever I try to change sources:
2021-08-18 13:12:09.658 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Media-1' failed: cannot invoke method public abstract java.lang.String org.openhab.core.items.Item.getName() on null in Media
My Items:
String GofancoMatrix "HDMI Matrix" { channel="serial:serialBridge:interface:string" }
Number LivingSource_1 "Living Room Source"
Number FamilySource_2 "Family Room Source"
Number FPRSource_3 "Fireplace Room Source"
Number GarageSource_4 "Garage Source"
My Rules:
rule "Switch Inputs"
when
Item LivingSource_1 received update or
Item FamilySource_2 received update or
Item FPRSource_3 received update or
Item GarageSource_4 received update
then
val num = triggeringItem.name.split("_").get(1)
val transmitMsg = if(triggeringItem.state as Number == 0) num+"$." else triggeringItem.state.toString+"V"+num+"."
GofancoMatrix.sendCommand(transmitMsg)
end
I’m unclear as to why I’m having this issue, I expected this to work after copying from my older OH2 setup. Any help is very much appreciated.