I’m trying to do some automatic positionning with my rollershutters. This is an example script to make it dark (I have two shutters, each a different direction, therefore I have to turn one of them over at the end to have it closed for the sun):
rule "sonnenschutz"
when
Item SONNENSCHUTZ received command ON
then
logInfo("test", JALOUSIE_LINKS.state)
sendCommand(JALOUSIE_LINKS, "DOWN")
sendCommand(JALOUSIE_RECHTS, "DOWN")
Thread::sleep(80000)
sendCommand(JALOUSIE_LINKS, "UP")
Thread::sleep(2000)
sendCommand(JALOUSIE_LINKS, "STOP")
end
Currently I’m just waiting the maximum possible time to close completely (80 seconds) and then turn the one over. I would like to obtain to current position at the start and then only wait for the necessary amount of time to finish the procedure as quickly as possible.
Unfortunately (I already introduced the logInfo statement in my rule) I’m always getting NULL when trying to acquire the current state:
2017-07-14 22:46:57.494 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'sonnenschutz': 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
Any idea why this could happen?
I’m currently running on OpenHAB 2.0 and the rollershutters are Homematic shutters - reporting their current state. If necessary here my items configuration:
Rollershutter JALOUSIE_LINKS "Jalousie Links [%d %%]" {channel="homematic:HM-LC-Bl1PBU-FM:ccu:NEQ0056156:1#LEVEL"}
Rollershutter JALOUSIE_RECHTS "Jalousie Rechts [%d %%]" {channel="homematic:HM-LC-Bl1PBU-FM:ccu:NEQ0055733:1#LEVEL"}