OH3 Rules reload - Type cannot be derived

In Openhab 3, when rules are reloaded I’m getting:

2021-01-06 14:24:57.612 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘default.rules’
2021-01-06 14:25:10.630 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model ‘default.rules’, using it anyway:
Type cannot be derived

Can I verify somehow, what cause it?

This is a warning not an error so the rule probably is working as it should.

The warning is telling you that you have a variable somewhere that is defined in such a way that it cannot determine what type of Object it represents. For example

var myTimer = null

There is nothing there to tell the parser what type myTimer is. The correct way to define it would be

var Timer myTimer = null

That tells the parser that myTimer is of type Timer.

So start by looking for something like that.

Is it connected with strict null assignment or just general variable definition?
It’s outside rules or can be anywhere?

Any variable that is defined without assigning to it something with a type will cause this problem. So

var myVariable

would also cause the problem.

anywhere in the .rules file.

Can I change logging and verify where is it?
There are so many… :slight_smile:

No, but if you have any variables created without a type and without an assignment to something other than null you need to change them all.

Thanks !! It seems it was a problem when variable doesn’t have an assignment or value. Similar as in example above:

var myVariable