Rule DSL - lastStateChange on an item wont work

I’m usind OpenHAB 4.3. In a DSL rule this can be used to get an item state:

myItem.state

or the item name:

myItem.name

Considering the JavaDocs (Item (openHAB Core 5.0.0-SNAPSHOT API)) I assumed this to work:

myItem.lastStateChange

But unfortunately it doesn’t work.

What are the functions that can be used in Rule DSL? Is there any documentation?

thanks for any help

Notice the difference in versions. The JavaDocs are for OH 5. These are new to OH 5 and not available in 4.3. And these will be added to the docs for OH 5.

I don’t think JavaDocs for any but the latest snapshot are posted anywhere. All of the standard stuff is available at Items | openHAB and the persistence stuff is covered at Persistence | openHAB.

Note these have nothing really to do with Rules DSL. The same properties and methods are available in all the rules languages.

Thank you for the reply, Rich.

I found it difficult to program rules in DSL due to missing docs and tooling. Autocomplete like a modern IDE offers would be a great help.

The openHAB extension for VSCode dooes autocompletion. But the other rules languages are “standard” so IDE tooling is relateively straight forward using the standard tools.

I do not recommend Rules DSL for new development of rules in OH. It has a number of limitations which makes it the least good choice for rules.