Hi,
I am trying to set up a rollershutter rule. I am a true beginner at openhab, so it is really difficult for me and there are a few questions.
For example, this is the rule i am using to close the shutters:
rule "Rollläden schließen 1h nach Sonnenuntergang"
when
Channel "astro:sun:home:set#event" triggered START
then if ((zeit_rolladen.state == ON) && (Level_Kueche.state > 1)) {
var Timer rolladen_nacht = null
rolladen_nacht = createTimer(now.plusMinutes(60), [|
if (Level_Kueche.state > 1) {
Besch_ZU.sendCommand(ON)
sendTelegram("marco" , "Rollläden werden automatisch geschlossen") } ])
}
end
The rule to close all shutters:
rule "komplettes Haus schliessen"
when Item Besch_ZU received command ON
then { Rolladen_Wohnzimmer.sendCommand("100")
Thread::sleep(500)
Rolladen_Buero.sendCommand("100")
Thread::sleep(500)
Rolladen_Schlafzimmer.sendCommand("100")
Thread::sleep(500)
Rolladen_Spielzimmer.sendCommand("100")
Thread::sleep(500)
Rolladen_Max.sendCommand("100")
Thread::sleep(500)
Rolladen_Bad.sendCommand("100")
Thread::sleep(7000)
Lamelle_Kueche.sendCommand("0")
Thread::sleep(100)
Jalousie_Kueche.sendCommand("0")
Thread::sleep(1000)
Lamelle_Esszimmer.sendCommand("0")
Thread::sleep(100)
Jalousie_Esszimmer.sendCommand("0")
Thread::sleep(4000)
Lamelle_Treppe.sendCommand("0")
Thread::sleep(100)
Jalousie_Treppe.sendCommand("0")
Thread::sleep(1000)
Lamelle_Wohnzimmer.sendCommand("0")
Thread::sleep(100)
Jalousie_Wohnzimmer.sendCommand("0")
Thread::sleep(5000)
Besch_ZU.sendCommand("OFF")
Thread::sleep(70000)
check_lamelle.sendCommand(ON)
}
end
These Thread::sleeps i need because i am using homematic. Without them, the CCUs duty cycle is overloaded.
Only for explanation:
zeit_rolladen is a proxy switch to change manually or automatically if i am not home
Level_Kueche should be clear (kitchens shutter)
Besch_ZU is also a proxy item with a rule in itself to close all shutters
There are normal rollershutters and blinds with slats
I know, that there is a possibility to offset sunrise and sunset, but with the createTimer it is easier (in my opinion) to change the time if i need it. OK, with my solution I have to check a second time if the shutter is still open after expiring the timer.
And now my problem:
I only check one shutter if it is open or closed. Is there a possibility to check each member of the rollershutter group and close/open the shutter with the wrong state?
I read a lot in the design pattern tutorials, the problem still existing for me is how to create a rollershutter group?
Group:Rollershutter:OR(DOWN,UP) works fine to close or open, but i am not able to check the state
Tried a lot with state open/close, average,… in the group definition, but nothing gave me the solution.
I am still a beginner, so please be patient