Issues with implicit variables newState and triggeringItem in 3.0.0

Ok I looked at that example. ScriptServiceUtil has moved to org.openhab.core.model.script which is fine. Are the OH 3 JavaDocs somewhere on the Web?

However, I still have another issue, that the event variable isn’t an implicit variable in DSL rules in OH3 apparently (probably because if it were, ir etc. would also be). So it looks like I’m stuck duplicating rules for now until triggeringItem is available in OH3, and it would indeed be awesome to see the other variables too. Or maybe I’ll try Jython as the scripting solution du jour (I see lots of Jython around, and not really any JavaScript for example).

I don’t know. I usually just search the github repo directly. I’m sure it is somewhere though, but can’t say whether it’s OH 2 or OH 3. Any time you see org.eclipse.smarthome anywhere, that has moved in OH 3. Usually is as easy as replacing that with org.openhab.

Hmmmm. I’m certain I saw Kai mention that it was there in the issue where the missing triggeringItem variable problem is being worked. I guess maybe I’m wrong or it’s only there if you are running a snapshot?

DSL has a receivedEvent, which is conditional and not the general event.

I am running 3.0.0-SNAPSHOT build #1989. Not sure if that matches your definition of “running a snapshot though.”

receivedEvent is only available for channel-based triggers, which I don’t think my state changed to OFF trigger is, correct?

It’s got snapshot in the name :wink:

receivedEvent is different from event. In the other languages all rules triggered by an Item or Channel Trigger have an event variable. Inside that you will find command, newState, etc.

It’s got snapshot in the name :wink:

I know. But since event isn’t there I wanted to double check :smiley: (like maybe you meant a build of the current checkin, which this is behind by some delta). So I guess event isn’t available in published snapshots either. At least not up to #1989.