Rule Broken After Migration - I suspect RGB/HSB

Hi there, I just migrated from 2.5 to 3.0, and the following rule is thorwing up an error that I don’t understand:

rule "Get Kid's attention"
  Member of Kids_Attention changed to "ON"
  //set triggeringItem variables & get human-friendly names
  val device = triggeringItem
  logInfo(logName, + " identified")
  var charindex1 ="_")
  var itemID =,charindex1)
  logInfo(logName,"itemID = " + itemID)
  val color_current = gLamps.members.findFirst[ s | == itemID+"_Color" ]
  val alert = gLamps.members.findFirst[ s | == itemID+"_Alert" ]
  val color_persist = gLamps.members.findFirst[ s | == itemID+"_Color_Persist" ]
  logInfo(logName,"sending " + color_current.state + " to " +
  Thread::sleep(1000) // sleep half a second
  while(alert.state == "LSELECT"){
Thread::sleep(500) // sleep half a second

  logInfo(logName,"restoring " + color_persist.state + " to " +

And the error (and the lines leading up to it) is:

2020-12-31 00:49:54.536 [INFO ] [enhab.core.model.script.Lights Rules] - UnicornLamp_Attention identified
2020-12-31 00:49:54.537 [INFO ] [enhab.core.model.script.Lights Rules] - itemID = UnicornLamp
2020-12-31 00:49:54.539 [INFO ] [enhab.core.model.script.Lights Rules] - sending 253,76,11 to UnicornLamp_Color_Persist
2020-12-31 00:49:54.540 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘lights-3’ failed: An error occurred during the script execution: Could not invoke method: org.openhab.core.model.script.actions.BusEvent.sendCommand(org.openhab.core.items.Item,java.lang.String) on instance: null in lights

Any thoughts?

Maybe this line, the following line sendCommand, or both?

States are not commands, DSL rules can show unexpected behaviour -
someSwitch.state might be ON
otherSwitch.sendcommand(ON) will work, interpreting ON as a command.
otherSwitch.sendcommand(someSwitch.state) will blow up - state ON might look the same to us but is not command ON as DSL looks at it.

Miracle cure -
Luckily the command interpreter will always try to parse a string into something it recognizes.

Or in your case, try

That did it. Thank you!

Worst part is I could have SWORN I tried this last night, but apparently not.