Hallo zusammen,
ein Arbeitskollege und ich haben nun einige Zeit in die Steuerung unserer Rollladen gesteckt und ich möchte meine Version des Aufbaus gerne einmal zur Verfügung stellen und freue mich auf Anregungen und Verbesserungsvorschläge.
Meine Anforderungen waren
- Steuerung über Sonnenstand
- Unterschiedliche Höhen bei verschiedenen Temperaturen
- Option zur Deaktivierung
- Automatisches starten am Morgen
- Abhängigkeit zur Präsenzsteuerung
Notwendige Items
Regel für Präsenz
Regel für Rollladen
Viele Grüße,
Jörg
ein Arbeitskollege und ich haben nun einige Zeit in die Steuerung unserer Rollladen gesteckt und ich möchte meine Version des Aufbaus gerne einmal zur Verfügung stellen und freue mich auf Anregungen und Verbesserungsvorschläge.
Meine Anforderungen waren
- Steuerung über Sonnenstand
- Unterschiedliche Höhen bei verschiedenen Temperaturen
- Option zur Deaktivierung
- Automatisches starten am Morgen
- Abhängigkeit zur Präsenzsteuerung
Notwendige Items
Code:
Switch Night { knx="1/2/3" } //Wird über Helligkeitssensor geschaltet Switch Holiday "Feiertag" //Wird über Holiday.script gesetzt String SpecialDay "Heute ist: [MAP(de.map):%s]" /* Sun Protection */ Switch ManSunProtection "manuelle Beschattung" (Status) Switch SunProtection Switch mySunProtectionVis Group:Contact:OR(OPEN, CLOSED) Praesenz "Anwesend [(%d)]" <present> (All) Contact cFboxiPhone1Online "iPhone 1[MAP(presence.map):%s]" <present> (Praesenz, Network) {fritzboxtr064="maconline:xx-xx-xx-xx-xx-xx" } Contact cFboxiPhone2Online "iPhone 2[MAP(presence.map):%s]" <present> (Praesenz, Network) {fritzboxtr064="maconline:yy-yy-yy-yy-yy-yy" } Number Temp_Max_0 {weather="locationId=ABC123, forecast=0, type=temperature, property=max, scale=0"} // azimuth and elevation Number azimuth "Azimuth" { channel="astro:sun:local:position#azimuth" } Number elevation "Elevation" { channel="astro:sun:local:position#elevation" }
Code:
rule Presence_Mode when Item Praesenz changed then if (Praesenz.state == OPEN) { pushNotification("Note", "Jemand ist zu Hause!!") SunProtection.postUpdate(OFF) } else if (Praesenz.state == CLOSED) { pushNotification("Note", "Sturmfrei !!") SunProtection.postUpdate(ON) } end
Code:
var Number sonneost = 0 var Number sonnesued = 0 var Number sonnewest = 0 var Number SonneS_aus = 1 var int hoehe1 = 0 //wird für die Höhe der Rollos benötigt var int hoehe2 = 0 //wird für die Höhe der Rollos benötigt var int hoehe3 = 0 //wird für die Höhe der Rollos benötigt var int hoehe4 = 0 //wird für die Höhe der Rollos benötigt var int hoehe5 = 0 //wird für die Höhe der Rollos benötigt var int tempmax = 0 var Timer t_night = null //Timer, falls um 08:30 noch zu dunkel rule "Reset um Mitternacht" when Time is midnight then sonneost = 0 sonnesued = 0 sonnewest = 0 end rule "Sonnenschutzautomatik" when Item SunProtection changed then if (SunProtection.state == ON) { ManSunProtection.postUpdate(OFF) mySunProtectionVis.postUpdate(ON) pushNotification(tempmax + " Grad erwartet.", "Sonnenschutzautomatik EIN: " + now) SonneS_aus = 0 } else if (SunProtection.state == OFF) { mySunProtectionVis.postUpdate(OFF) pushNotification("Info", "Sonnenschutzautomatik AUS: " + now) SonneS_aus = 1 } end rule "Manueller-Sonnenschutz" when Item ManSunProtection changed then if (ManSunProtection.state == ON) { 1_Rollo.sendCommand(85) 2_Rollo.sendCommand(85) 3_Rollo.sendCommand(85) pushNotification(tempmax + " Grad erwartet.", "Manueller Sonnenschutz aktiv: " + now) } else if (ManSunProtection.state == OFF) { pushNotification("Info", "Manueller Sonnenschutz deaktiviert: " + now) } end rule Rollladen_Task when Time cron "0 30 08 ? * MON-SAT" or Time cron "0 00 09 ? * SUN" then if (Holiday.state == OFF && Night.state == OFF && tempmax < 20) { pushNotification(tempmax + " Grad", "Rollladen fahren auf: " + now) //fahre alle Rollladen 1_Rollo.sendCommand(UP) 2_Rollo.sendCommand(UP) } else if (Holiday.state == OFF && Night.state == OFF && tempmax >= 20) { SunProtection.postUpdate(ON) } else if (Holiday.state == ON) { pushNotification("" + SpecialDay + "", "Rollladen bleiben unten.") } else if (Holiday.state == OFF && Night.state == ON) { pushNotification("Information", "Es ist noch Nacht, Rollladen bleiben unten.") if (t_night != null){ t_night = createTimer(now.plusMinutes(10))[| if (Night.state == ON) { pushNotification("Information", "Es ist immer noch Nacht, Rollladen bleiben unten.") t_night.reschedule(now.plusMinutes(10)) } else { pushNotification("Information", "Rollladen fahren auf: " + now) //fahre alle Rollladen 1_Rollo.sendCommand(UP) 2_Rollo.sendCommand(UP) t_night.cancel t_night = null } ] } } end rule "SunProtection" when Item azimuth received update then /* Fuellen der Variablen */ var int azimuth = (azimuth.state as DecimalType).intValue var int elevation = (elevation.state as DecimalType).intValue var int min = now.getMinuteOfDay // es werden die Minuten das Tages gezählt z.b 9:00 Uhr > 540 Min tempmax = (Weather_Temp_Max_0.state as DecimalType).intValue switch (tempmax) { case (tempmax >= 20 && tempmax <=26): {hoehe1 = 85 hoehe2 = 75 hoehe3 = 55 hoehe4 = 55 hoehe5 = 0} // Höhe des Rollos je nach Temperatur case (tempmax >= 27 && tempmax <=31): {hoehe1 = 100 hoehe2 = 90 hoehe3 = 60 hoehe4 = 40 hoehe5 = 0} case (tempmax >= 32 && tempmax <=45): {hoehe1 = 100 hoehe2 = 90 hoehe3 = 80 hoehe4 = 70 hoehe5 = 0} default: {hoehe1 = 0 hoehe2 = 0 hoehe3 = 0 hoehe4 = 0 hoehe5 = 0} } /* Sonnenschutz OST */ if (SonneS_aus == 0 && sonneost == 0 && tempmax >= 20 && azimuth >= 90 && azimuth <= 219 && elevation >=30) { Thread::sleep((1000 + Math::random * 1000.0).intValue) pushNotification("Information", "Sonnenschutz Ost - Stufe 1") /* Rollladen Nord */ Nord_Rollos.sendCommand(hoehe3) /* Rollladen Ost */ Ost_Rollos.sendCommand(hoehe2) /* Rollladen Sued */ Sued_Rollos.sendCommand(hoehe5) /* Rollladen West */ West_Rollos.sendCommand(hoehe5) sonneost = 1 } else if (SonneS_aus == 1 && sonneost == 0 && azimuth >= 220 && elevation >= 10) { //Nachführung, falls Automatik aus sonneost = 1 } else if (SonneS_aus == 0 && sonneost == 1 && azimuth >= 220 && elevation >= 10) { // Sonne scheint jetzt von Süden. pushNotification("Information", "Sonnenschutz Ost - Stufe 2") /* Rollladen Nord */ Nord_Rollos.sendCommand(hoehe5) /* Rollladen Ost */ Ost_Rollos.sendCommand(hoehe4) sonneost = 2 } else if (SonneS_aus == 0 && sonneost == 1 && elevation <= 40) { //Nachführung, falls Automatik aus sonneost = 0 } else if (sonneost == 2 && elevation <= 40) { // Rollos auf, ohne wenn und aber pushNotification("Information", "Sonnenschutz Ost - Stufe 3") /* Rollladen Ost */ Ost_Rollos.sendCommand(hoehe5) sonneost = 0 } /* Sonnenschutz SÜD */ if (SonneS_aus == 0 && sonnesued == 0 && tempmax >= 20 && azimuth >= 120 && azimuth <= 290 && elevation >= 35) { pushNotification("Information", "Sonnenschutz Süd - Stufe 1") /* Rollladen Sued */ Sued_Rollos.sendCommand(hoehe2) sonnesued = 1 } else if (SonneS_aus == 1 && sonnesued == 0 && azimuth >= 285) { //Nachführung, falls Automatik aus sonnesued = 1 } else if (SonneS_aus == 0 && sonnesued == 1 && azimuth >= 285) { pushNotification("Information", "Sonnenschutz Süd - Stufe 2") /* Rollladen Sued */ Sued_Rollos.sendCommand(hoehe2) sonnesued = 2 } else if (SonneS_aus == 1 && sonnesued == 1 && elevation <= 10) { //Nachführung, falls Automatik aus sonnesued = 0 } else if (SonneS_aus == 0 && sonnesued == 2 && elevation <= 10) { pushNotification("Information", "Sonnenschutz Süd - Stufe 3") /* Rollladen Sued */ Sued_Rollos.sendCommand(hoehe5) sonnesued = 0 } /* Sonnenschutz WEST */ if (SonneS_aus == 0 && sonnewest == 0 && tempmax >= 20 && azimuth >= 210 && elevation >=30) { pushNotification("Information", "Sonnenschutz West - Stufe 1") /* Rollladen West */ West_Rollos.sendCommand(hoehe2) sonnewest = 1 } else if (SonneS_aus == 1 && sonnewest == 0 && elevation <= 30) { //Nachführung, falls Automatik aus sonnewest = 1 } else if (SonneS_aus == 0 && sonnewest == 1 && elevation <= 30) { pushNotification("Information", "Sonnenschutz West - Stufe 2") /* Rollladen West */ West_Rollos.sendCommand(hoehe5) sonnewest = 0 } end
Jörg
Kommentar