i got a problem with the following rule: Not even the IF part of the rule gets executed, also the ELSE part gets executed. My plan was that the ELSE part just gets executed, if one of the item states is null for excample.
Can you tell me, what i am doing wrong?
Thanks, Alex
rule "Lueften-Wohnzimmer-Ende"
when
Item Group_Wohnzimmer_Fenster changed to OFF
then
sendNotification("xxx@me.com","Alle Fenster geschlossen, Timer WZ gestartet.")
createTimer(now.plusSeconds(900)) [
sendNotification("xxx@me.com","Timer WZ abgelaufen.")
if ((Anwesenheitserkennung.state == ON) && (Group_Wohnzimmer_Fenster.state == OFF)) {
HM_WZ_Heizung_ActProfile.sendCommand(1)
sendNotification("xxx@me.com","Heizung WZ auf Anwesenheit stellen")
}
if ((Anwesenheitserkennung.state == OFF) && (Group_Wohnzimmer_Fenster.state == OFF)) {
HM_WZ_Heizung_ActProfile.sendCommand(2)
sendNotification("xxx@me.com","Heizung WZ auf Abwesenheit stellen")
}
else
HM_WZ_Heizung_ActProfile.sendCommand(HM_WZ_Heizung_ActProfile.previousState.state)
sendNotification("xxx@me.com","Heizung WZ auf vorheriges Profil stellen")
]
end
The first If has no following Else, so the True will either be run or nothing.
The second if has a following, so either the True part will be run or the False (Else) part will be run.
In your example the first If was True and the second False!
thanks to all for your help, again! i really love this great community that never hasitates to help someone! its really fun to learn with your help how to deal with the funtions of openhab!