openHAB 4.1.3 Release Build
I’m trying to learn DSL rules. I wrote a simpliest one (aka hello world) but the logs tell me that I miss something obvious.
The rule:
configuration: {}
triggers:
- id: "1"
configuration:
cronExpression: 0/15 * * * * ? *
type: timer.GenericCronTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: |-
rule "AC_Available_Power_W changed"
when
Item AC_Available_Power_W changed
then
logInfo("KOSTAL","AC_Available_Power_W changed")
end
type: script.ScriptAction
the log
11:22:01.039 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID '78f9850186' failed: ___ rule ___ "AC_Available_Power_W changed"
when
Item AC_Available_Power_W changed
then
logInfo("KOSTAL","AC_Available_Power_W changed")
end
1. The method or field rule is undefined; line 1, column 0, length 4
2. The method or field when is undefined; line 2, column 38, length 4
3. The method or field changed is undefined; line 3, column 77, length 7
4. The method or field then is undefined; line 4, column 87, length 4
5. The method or field end is undefined; line 6, column 151, length 3
6. This expression is not allowed in this context, since it doesn't cause any side effects.; line 1, column 5, length 30
7. This expression is not allowed in this context, since it doesn't cause any side effects.; line 3, column 51, length 4
8. This expression is not allowed in this context, since it doesn't cause any side effects.; line 3, column 56, length 20
The error seems to tell that OH doesn’t even get the “when” line… What I am missing?

