Da dies mein erster Post hier ist werfe ich gleich mal ein fröhliches "Hallo allerseits" in die Runde
Ich hoffe, ihr könnt mir bei folgendem Problem weiterhelfen:
Hi,
ich habe hier ein Problem bei der Verwendung von Variablen in Regeln:
ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'GF_Living_LightOn_WindowTest': Could not invoke method: org.openhab.model.script.actions.BusEvent.sendComm and(org.openhab.core.items.Item,java.lang.Number) on instance: null
Das komische ist, dass die Regel ab und zu mal zieht, ein anderes mal wiederum nicht.
Regel:
import org.openhab.core.types.*
var string varLight_GF_Living_Lightchain
var string varLight_GF_Living_Star
var string varLight_GF_Living_Lamp
var string varHue_GF_Living_Couch
var string varHue_GF_Living_Table
var string varHue_GF_Living_TV
rule "GF_Living_LightOff_Window"
when
Item Window_GF_Living changed from CLOSED to OPEN
then
if (Insektenschutz_GF_Living.state == ON)
{
varLight_GF_Living_Lightchain = Light_GF_Living_Lightchain.state
sendCommand(Light_GF_Living_Lightchain, OFF)
varLight_GF_Living_Star = Light_GF_Living_Star.state
sendCommand(Light_GF_Living_Star, ON)
varLight_GF_Living_Lamp = Light_GF_Living_Lamp.state
sendCommand(Light_GF_Living_Lamp, OFF)
varHue_GF_Living_Couch = Hue_GF_Living_Couch.state
sendCommand(Hue_GF_Living_Couch, OFF)
varHue_GF_Living_Table = Hue_GF_Living_Table.state
sendCommand(Hue_GF_Living_Table, OFF)
varHue_GF_Living_TV = Hue_GF_Living_TV.state
sendCommand(Hue_GF_Living_TV, OFF)
}
end
rule "GF_Living_LightOn_Window"
when
Item Window_GF_Living changed from OPEN to CLOSED
then
if (Insektenschutz_GF_Living.state == ON)
{
sendCommand(Light_GF_Living_Lightchain, varLight_GF_Living_Lightchain)
sendCommand(Light_GF_Living_Star, varLight_GF_Living_Star)
sendCommand(Light_GF_Living_Lamp, varLight_GF_Living_Lamp)
sendCommand(Hue_GF_Living_Couch, varHue_GF_Living_Couch)
sendCommand(Hue_GF_Living_Table, varHue_GF_Living_Table)
sendCommand(Hue_GF_Living_TV, varHue_GF_Living_TV)
}
end
Log:
Türe auf (wobei ich hier die Türe durch einen Testschalter ersetzt habe, damit ich nicht dauern rennen muss):
12:14:15.391 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Insect_Test' with state 'OFF' in rrd4j database
12:14:15.398 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Insect_Test' with state 'ON' in rrd4j database
12:14:15.440 DEBUG o.o.m.r.i.engine.RuleEngine[:285]- Executing rule 'GF_Living_LightOff_WindowTest'
12:14:16.400 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/lichterkette_off.sh'
12:14:17.271 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Living_Star' with state 'OFF' in rrd4j database
12:14:17.279 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Living_Star' with state 'ON' in rrd4j database
12:14:17.353 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/stern_on.sh'
12:14:17.664 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/licht_stehlampe_off.sh'
12:14:17.979 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_Couch'
12:14:18.016 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/3/state
12:14:18.358 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_Table'
12:14:18.392 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/4/state
12:14:18.668 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_TV'
12:14:18.701 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/1/state
Türe wieder zu:
12:16:13.515 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Insect_Test' with state 'ON' in rrd4j database
12:16:13.539 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Insect_Test' with state 'OFF' in rrd4j database
12:16:13.579 DEBUG o.o.m.r.i.engine.RuleEngine[:285]- Executing rule 'GF_Living_LightOn_WindowTest'
12:16:13.895 ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'GF_Living_LightOn_WindowTest': Could not invoke method: org.openhab.model.script.actions.BusEvent.sendComm and(org.openhab.core.items.Item,java.lang.Number) on instance: null
Was kann das sein? der Fehler tritt wie gesagt nur sporadisch und auch nur bei der "Türe zu, Licht im alten Zustand wieder an" Regel auf

Hi,
ich habe hier ein Problem bei der Verwendung von Variablen in Regeln:
ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'GF_Living_LightOn_WindowTest': Could not invoke method: org.openhab.model.script.actions.BusEvent.sendComm and(org.openhab.core.items.Item,java.lang.Number) on instance: null
Das komische ist, dass die Regel ab und zu mal zieht, ein anderes mal wiederum nicht.
Regel:
import org.openhab.core.types.*
var string varLight_GF_Living_Lightchain
var string varLight_GF_Living_Star
var string varLight_GF_Living_Lamp
var string varHue_GF_Living_Couch
var string varHue_GF_Living_Table
var string varHue_GF_Living_TV
rule "GF_Living_LightOff_Window"
when
Item Window_GF_Living changed from CLOSED to OPEN
then
if (Insektenschutz_GF_Living.state == ON)
{
varLight_GF_Living_Lightchain = Light_GF_Living_Lightchain.state
sendCommand(Light_GF_Living_Lightchain, OFF)
varLight_GF_Living_Star = Light_GF_Living_Star.state
sendCommand(Light_GF_Living_Star, ON)
varLight_GF_Living_Lamp = Light_GF_Living_Lamp.state
sendCommand(Light_GF_Living_Lamp, OFF)
varHue_GF_Living_Couch = Hue_GF_Living_Couch.state
sendCommand(Hue_GF_Living_Couch, OFF)
varHue_GF_Living_Table = Hue_GF_Living_Table.state
sendCommand(Hue_GF_Living_Table, OFF)
varHue_GF_Living_TV = Hue_GF_Living_TV.state
sendCommand(Hue_GF_Living_TV, OFF)
}
end
rule "GF_Living_LightOn_Window"
when
Item Window_GF_Living changed from OPEN to CLOSED
then
if (Insektenschutz_GF_Living.state == ON)
{
sendCommand(Light_GF_Living_Lightchain, varLight_GF_Living_Lightchain)
sendCommand(Light_GF_Living_Star, varLight_GF_Living_Star)
sendCommand(Light_GF_Living_Lamp, varLight_GF_Living_Lamp)
sendCommand(Hue_GF_Living_Couch, varHue_GF_Living_Couch)
sendCommand(Hue_GF_Living_Table, varHue_GF_Living_Table)
sendCommand(Hue_GF_Living_TV, varHue_GF_Living_TV)
}
end
Log:
Türe auf (wobei ich hier die Türe durch einen Testschalter ersetzt habe, damit ich nicht dauern rennen muss):
12:14:15.391 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Insect_Test' with state 'OFF' in rrd4j database
12:14:15.398 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Insect_Test' with state 'ON' in rrd4j database
12:14:15.440 DEBUG o.o.m.r.i.engine.RuleEngine[:285]- Executing rule 'GF_Living_LightOff_WindowTest'
12:14:16.400 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/lichterkette_off.sh'
12:14:17.271 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Living_Star' with state 'OFF' in rrd4j database
12:14:17.279 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Living_Star' with state 'ON' in rrd4j database
12:14:17.353 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/stern_on.sh'
12:14:17.664 INFO o.o.b.e.internal.ExecBinding[:313]- executed commandLine '/opt/brematic/licht_stehlampe_off.sh'
12:14:17.979 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_Couch'
12:14:18.016 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/3/state
12:14:18.358 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_Table'
12:14:18.392 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/4/state
12:14:18.668 DEBUG o.o.b.hue.internal.HueBinding[:68]- Hue binding received command 'OFF' for item 'Hue_GF_Living_TV'
12:14:18.701 DEBUG o.o.b.h.i.hardware.HueBulb[:237]- Sent message: '{"on":false}' to http://192.168.178.50/api/openHABRuntime/lights/1/state
Türe wieder zu:
12:16:13.515 DEBUG o.o.p.r.internal.RRD4jService[:105]- Stored 'Light_GF_Insect_Test' with state 'ON' in rrd4j database
12:16:13.539 DEBUG o.o.p.r.internal.RRD4jService[:121]- Stored 'Light_GF_Insect_Test' with state 'OFF' in rrd4j database
12:16:13.579 DEBUG o.o.m.r.i.engine.RuleEngine[:285]- Executing rule 'GF_Living_LightOn_WindowTest'
12:16:13.895 ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'GF_Living_LightOn_WindowTest': Could not invoke method: org.openhab.model.script.actions.BusEvent.sendComm and(org.openhab.core.items.Item,java.lang.Number) on instance: null
Was kann das sein? der Fehler tritt wie gesagt nur sporadisch und auch nur bei der "Türe zu, Licht im alten Zustand wieder an" Regel auf