[Solved] OH3_MS1 Calling ScriptServiceUtil.getItemRegistry.getItem

Hello,

Trying to figure out how I call ScriptServiceUtil.getItemRegistry.getItem from a rule in OH3 MS1. I see my DSL rules are converted to NGRE and then has trouble calling the above. Anyone have any hints on how to do this?

The DSL rule im playing with is;

    import org.eclipse.smarthome.model.script.ScriptServiceUtil

    rule "Record Last Update"

    when

      Member of gRecordLastUpdate received update

    then

        val updateItem = ScriptServiceUtil.getItemRegistry.getItem(triggeringItem.name+"_LastUpdate")

        sendCommand( updateItem , new DateTimeType())

    end

Thanks

James

That path likely changed. ESH paths have been removed from OH3.

Thanks!

Yes after a few hours of messing around I just spotted that on OH3 issue tracker…

import org.openhab.core.model.script.ScriptServiceUtil

Does the Job.

James

1 Like