Thanks Alain,
Rebooting and cleaning the userdata/cache, didnât solve the issue. but removing the .state was the fix.
Test.rules
rule "Test_ON (prepares simulation)"
when
Item Declenche_switch changed to ON
then
EG_wz_switch_3_long_test.postUpdate(ON)
EG_wz_fk_tuer_test.postUpdate(CLOSED)
OG1_sz_fk_tuer_test.postUpdate(OPEN)
OG1_az_fk_tuer_test.postUpdate(CLOSED)
EG_wz_rs_tuer_test.postUpdate(UP)
OG1_sz_rs_tuer_test.postUpdate(UP)
OG1_az_rs_tuer_test.postUpdate(UP)
end
rule "Test_OFF"
when
Item Declenche_switch changed to OFF
then
EG_wz_switch_3_long_test.postUpdate(OFF)
end
rule "Rolladen Wohnzimmer schliessen"
when
Item EG_wz_switch_3_long_test received update OFF
then
gH_Rolladen_wz_switch_test.members.forEach[rs|
var nameParts = rs.name.split("_")
val windowName = nameParts.get(0) + "_" + nameParts.get(1) + "_fk_" + nameParts.get(3) + "_" + nameParts.get(4)
logInfo("DEBUG", "windowname = " + windowName)
//logInfo ("Fensterkontakt der offen is:", windowName)
if (gh_Contact_global_test.members.filter [fk | fk.name == windowName].head != OPEN){
logInfo("DEBUG", "Fensterkontakt " + windowName + " is CLOSED")
postUpdate(rs,DOWN)
}
else {
logInfo("DEBUG", "Fensterkontakt " + windowName + " is OPEN")
}]
end
Logging:
15:07:45.384 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Declenche_switch' received command ON
15:07:45.476 [INFO ] [smarthome.event.ItemStateChangedEvent] - Declenche_switch changed from NULL to ON
15:07:49.296 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_switch_3_long_test changed from NULL to ON
15:07:49.400 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_fk_tuer_test changed from NULL to CLOSED
15:07:49.470 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_sz_fk_tuer_test changed from NULL to OPEN
15:07:49.545 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_rs_tuer_test changed from NULL to 0
15:07:49.617 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_az_fk_tuer_test changed from NULL to CLOSED
15:07:49.686 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_az_rs_tuer_test changed from NULL to 0
15:07:49.757 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_sz_rs_tuer_test changed from NULL to 0
15:08:02.249 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Declenche_switch' received command OFF
15:08:02.282 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - Los geht's
15:08:02.331 [INFO ] [smarthome.event.ItemStateChangedEvent] - Declenche_switch changed from ON to OFF
15:08:02.439 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - windowname = EG_wz_fk_tuer_test
15:08:02.663 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_switch_3_long_test changed from ON to OFF
15:08:02.797 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - Fensterkontakt EG_wz_fk_tuer_test is CLOSED
15:08:02.977 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_rs_tuer_test changed from 0 to 100
15:08:03.001 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - windowname = OG1_sz_fk_tuer_test
15:08:03.173 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - Fensterkontakt OG1_sz_fk_tuer_test is CLOSED
15:08:03.303 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_sz_rs_tuer_test changed from 0 to 100
15:08:03.319 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - windowname = OG1_az_fk_tuer_test
15:08:03.496 [INFO ] [.eclipse.smarthome.model.script.DEBUG] - Fensterkontakt OG1_az_fk_tuer_test is CLOSED
15:08:03.632 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG1_az_rs_tuer_test changed from 0 to 100
If I now adapt the rule to my live roller shutter, still the same error:
Group.items
Group:Rollershutter:OR(UP,DOWN) gH_Rolladen_switch "Alle Rolladen" <rollershutter>
Group:Rollershutter:OR(UP,DOWN) gH_Rolladen_sz_switch "Rolladen Schlafzimmer" <rollershutter>
Group:Rollershutter:OR(UP,DOWN) gH_Rolladen_wz_switch "Rolladen Wohnzimmer" <rollershutter>
Group gH_Contact_global
//Group:Contact:OR(OPEN,CLOSED) gH_Contact_global 'Fenster offen [(%d)]' <contact> -- disabled for testing
Group gH_Rolladen (gH_Rolladen_switch)
Group gEG_Rolladen (gH_Rolladen)
Group gEG_Rolladen_wz (gH_Rolladen,gH_Rolladen_wz_switch)
Group gOG1_Rolladen (gH_Rolladen)
Group gOG1_Rolladen_sz (gH_Rolladen,gH_Rolladen_sz_switch)
Group gOG2_Rolladen (gH_Rolladen)
Rolladen.items
Rollershutter EG_az_rs_fenster "Rollade Spielzimmer" <rollershutter> (gEG_az,gEG_Rolladen_wz) ["Lighting"] {channel="homematic:HG-HM-LC-Bl1PBU-FM::1#LEVEL"}
//--> Wohnzimmer
Rollershutter EG_wz_rs_seite "Rollade Wohnzimmer Seite" <rollershutter> (gEG_wz,gEG_Rolladen_wz) ["Lighting"] {channel="homematic:HG-HM-LC-Bl1PBU-FM:1#LEVEL"}
Rollershutter EG_wz_rs_tuer "Rollade Wohnzimer TĂŒr" <rollershutter> (gEG_wz,gEG_Rolladen_wz) ["Lighting"] {channel="homematic:HG-HM-LC-Bl1PBU-FM:1#LEVEL"}
Contact EG_az_fk_tuer "Fensterkontakt SpielzimmertĂŒr" <window> (gEG_az,gH_Contact_global) {channel="homematic:HG-HM-Sec-SC-2:1#STATE"}
Contact EG_wz_fk_tuer "Fensterkontakt WohnzimmertĂŒr" <window> (gEG_wz,gH_Contact_global) {channel="homematic:HG-HM-Sec-SC:1#STATE"}
and some other window contacts along different rooms with the same setup, belonging to gH_Contact as well.
Rolladen.rules
var String windowName = ""
var String rsString = ""
rule "Rolladen Wohnzimmer schliessen"
when
Item EG_wz_switch_3_long received update OFF
then
gH_Rolladen_wz_switch.members.forEach[rs|
var nameParts = rs.name.split("_")
val windowName = nameParts.get(0) + "_" + nameParts.get(1) + "_fk_" + nameParts.get(3)
logInfo("DEBUG", "windowname = " + windowName)
//logInfo ("Fensterkontakt der offen is:", windowName)
if (gH_Contact_global.members.filter [fk | fk.name == windowName].head != OPEN){
logInfo("DEBUG", "Fensterkontakt " + windowName + " is CLOSED")
sendCommand(rs,DOWN)
}
else {
logInfo("DEBUG", "Fensterkontakt " + windowName + " is OPEN")
}]
end
Logging:
15:09:02.313 [INFO ] [smarthome.event.ChannelTriggeredEvent] - homematic:HG-HM-PB-6-WM55:3#PRESS triggered LONG_RELEASE
15:09:02.408 [INFO ] [smarthome.event.ChannelTriggeredEvent] - homematic:HG-HM-PB-6-WM55:3#PRESS triggered LONG
15:09:02.497 [INFO ] [smarthome.event.ItemStateChangedEvent] - homematic_HG_HM_PB_6_WM55__3_PRESS_LONG changed from OFF to ON
15:09:02.581 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_switch_3_long changed from OFF to ON
15:09:02.656 [INFO ] [smarthome.event.ChannelTriggeredEvent] - homematic:HG-HM-PB-6-WM55::3#PRESS triggered LONG_RELEASE
15:09:04.338 [INFO ] [smarthome.event.ItemStateChangedEvent] - homematic_HG_HM_PB_6_WM55__3_PRESS_LONG changed from ON to OFF
15:09:04.426 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_wz_switch_3_long changed from ON to OFF
15:09:10.458 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Rolladen Wohnzimmer schliessen': 3
Any ideas/suggestions left?
Help is really appreciated.