Help me out here - What am I doing wrong?
I’m writing rules, but all my references to any items are just giving null as a result. For example, this test rule that triggers when I switch the testItem Switch:
rule "testar"
when
Item testItem received update
then
logInfo("testfunktion", "asdfasdfasdf")
logInfo("testfunktion", testItem.state)
end
This gives the error:
19:06:02.231 [INFO ] [marthome.event.ItemStateChangedEvent] - testItem changed from ON to OFF
19:06:02.237 [INFO ] [.smarthome.model.script.testfunktion] - asdfasdfasdf
19:06:02.242 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'testar': An error occured during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null
Of course I’m doing some basic “shit behind the keyboard” - but obviously my eyes miss it