Sorry for the offtopic

@rlkoshak

The rules have no logInfos anymore,

sorry for the wrong description of the problem,

but I get many errors on startup because the rule engine is very slow and not all items are initialized.

I have for every room one rule file, the system needs more than 30 mins to work nearly useable.

This is not the first time I have problems with it,

I moved from a pi1 to a pi3 and now it is running on my home server (AMD A4-5300 and 8GB RAM).

On the pi1 and pi3, it was unusable.

The rules don’t use sleeps or something like that.

Here a screenshot of htop after 40 mins uptime:

Here a list of threads --list from karaf

Here is one of the old rule files I’m using currently.

```
import java.util.Random
import java.util.Calendar
rule "Rollershutter Kueche Init"
when
System started
then
if(Rolladen_EG_Kueche_Hoch_Stunde_Montag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Montag.postUpdate(7);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Montag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Montag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Montag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Montag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Montag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Montag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Dienstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Dienstag.postUpdate(7);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Dienstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Dienstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Dienstag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Dienstag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Dienstag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Dienstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Mittwoch.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Mittwoch.postUpdate(7);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Mittwoch.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Mittwoch.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Mittwoch.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Mittwoch.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Mittwoch.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Mittwoch.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Donnerstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Donnerstag.postUpdate(7);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Donnerstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Donnerstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Donnerstag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Donnerstag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Donnerstag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Donnerstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Freitag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Freitag.postUpdate(7);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Freitag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Freitag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Freitag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Freitag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Freitag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Freitag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Samstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Samstag.postUpdate(9);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Samstag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Samstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Samstag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Samstag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Samstag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Samstag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Hoch_Stunde_Sonntag.state == NULL){
Rolladen_EG_Kueche_Hoch_Stunde_Sonntag.postUpdate(9);
}
if(Rolladen_EG_Kueche_Hoch_Minute_Sonntag.state == NULL){
Rolladen_EG_Kueche_Hoch_Minute_Sonntag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Runter_Stunde_Sonntag.state == NULL){
Rolladen_EG_Kueche_Runter_Stunde_Sonntag.postUpdate(22);
}
if(Rolladen_EG_Kueche_Runter_Minute_Sonntag.state == NULL){
Rolladen_EG_Kueche_Runter_Minute_Sonntag.postUpdate(0);
}
if(Rolladen_EG_Kueche_Nighttime_Mode.state == NULL){
Rolladen_EG_Kueche_Nighttime_Mode.postUpdate("GLOBAL");
}
if(Rolladen_EG_Kueche_Sonnenschutz_Modus.state == NULL){
Rolladen_EG_Kueche_Sonnenschutz_Modus.postUpdate(OFF);
}
if(Rolladen_EG_Kueche_Sonnenschutz_Stand.state == NULL){
Rolladen_EG_Kueche_Sonnenschutz_Stand.postUpdate(40);
}
if(Rolladen_EG_Kueche_Sonnenschutz_WinkelLinks.state == NULL){
Rolladen_EG_Kueche_Sonnenschutz_WinkelLinks.postUpdate(210);
}
if(Rolladen_EG_Kueche_Sonnenschutz_WinkelRechts.state == NULL){
Rolladen_EG_Kueche_Sonnenschutz_WinkelRechts.postUpdate(280);
}
if(Rolladen_EG_Kueche_Stand_Nachts.state == NULL){
Rolladen_EG_Kueche_Stand_Nachts.postUpdate(100);
}
if(Rolladen_EG_Kueche_Sonnenschutz_Wolken.state == NULL){
Rolladen_EG_Kueche_Sonnenschutz_Wolken.postUpdate(40);
}
if(Rolladen_EG_Kueche_Stand_Tagsueber.state == NULL){
Rolladen_EG_Kueche_Stand_Tagsueber.postUpdate(0);
}
end
rule "Rollershutter Kueche Update"
when
Item Rolladen_EG_Kueche changed
then
var int upTime = 0
var int downTime = 0
var Nachtmodus = false
if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "ASTRO"){
upTime = (SunriseTime.state as DateTimeType).getCalendar.get(Calendar.HOUR_OF_DAY).intValue * 60 + (SunriseTime.state as DateTimeType).getCalendar.get(Calendar.MINUTE).intValue
downTime = (SunsetTime.state as DateTimeType).getCalendar.get(Calendar.HOUR_OF_DAY).intValue * 60 + (SunsetTime.state as DateTimeType).getCalendar.get(Calendar.MINUTE).intValue
Nachtmodus = true
} else if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "GLOBAL"){
if(0 < now.getDayOfWeek && now.getDayOfWeek < 6){
upTime = (Rolladen_Hoch_Stunde_Werktags.state as Number).intValue * 60 + (Rolladen_Hoch_Minute_Werktags.state as Number).intValue
downTime = (Rolladen_Runter_Stunde_Werktags.state as Number).intValue * 60 + (Rolladen_Runter_Minute_Werktags.state as Number).intValue
} else if(5 < now.getDayOfWeek && now.getDayOfWeek < 8){
upTime = (Rolladen_Hoch_Stunde_Wochenende.state as Number).intValue * 60 + (Rolladen_Hoch_Minute_Wochenende.state as Number).intValue
downTime = (Rolladen_Runter_Stunde_Wochenende.state as Number).intValue * 60 + (Rolladen_Runter_Minute_Wochenende.state as Number).intValue
}
Nachtmodus = true
} else if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "LOCAL"){
if(now.getDayOfWeek == 1){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Montag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Montag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Montag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Montag.state as Number).intValue
} else if(now.getDayOfWeek == 2){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Dienstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Dienstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Dienstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Dienstag.state as Number).intValue
} else if(now.getDayOfWeek == 3){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Mittwoch.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Mittwoch.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Mittwoch.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Mittwoch.state as Number).intValue
} else if(now.getDayOfWeek == 4){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Donnerstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Donnerstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Donnerstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Donnerstag.state as Number).intValue
} else if(now.getDayOfWeek == 5){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Freitag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Freitag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Freitag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Freitag.state as Number).intValue
} else if(now.getDayOfWeek == 6){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Samstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Samstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Samstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Samstag.state as Number).intValue
} else if(now.getDayOfWeek == 7){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Sonntag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Sonntag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Sonntag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Sonntag.state as Number).intValue
}
Nachtmodus = true
}
val int currentTime = now.getHourOfDay * 60 + now.getMinuteOfHour
val int azimuth = (SunAzimuth.state as Number).intValue
val int left = (Rolladen_EG_Kueche_Sonnenschutz_WinkelLinks.state as Number).intValue
val int right = (Rolladen_EG_Kueche_Sonnenschutz_WinkelRechts.state as Number).intValue
val int actual = (Rolladen_EG_Kueche.state as Number).intValue
if(upTime < downTime){
if((currentTime > downTime || currentTime < upTime) && Nachtmodus == true){
Rolladen_EG_Kueche_Stand_Nachts.postUpdate(actual)
} else if((currentTime <= downTime && currentTime >= upTime) || Nachtmodus == false){
if(left < right){
if((azimuth > left && azimuth < right) && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
Rolladen_EG_Kueche_Sonnenschutz_Stand.postUpdate(actual)
} else {
Rolladen_EG_Kueche_Stand_Tagsueber.postUpdate(actual)
}
} else {
if((azimuth > left || azimuth < right) && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
Rolladen_EG_Kueche_Sonnenschutz_Stand.postUpdate(actual)
} else {
Rolladen_EG_Kueche_Stand_Tagsueber.postUpdate(actual)
}
}
}
} else {
if((currentTime > downTime && currentTime < upTime) && Nachtmodus == true){
Rolladen_EG_Kueche_Stand_Nachts.postUpdate(actual)
} else if((currentTime <= downTime || currentTime >= upTime) || Nachtmodus == false){
if(left < right){
if((azimuth > left && azimuth < right) && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
Rolladen_EG_Kueche_Sonnenschutz_Stand.postUpdate(actual)
} else {
Rolladen_EG_Kueche_Stand_Tagsueber.postUpdate(actual)
}
} else {
if((azimuth > left || azimuth < right) && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
Rolladen_EG_Kueche_Sonnenschutz_Stand.postUpdate(actual)
} else {
Rolladen_EG_Kueche_Stand_Tagsueber.postUpdate(actual)
}
}
}
}
end
rule "Rollershutter Kueche Action"
when
//Item SunAzimuth changed or
Time cron "0 0/5 * * * ?" //or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Montag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Montag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Montag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Montag changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Dienstag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Dienstag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Dienstag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Dienstag changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Mittwoch changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Mittwoch changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Mittwoch changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Mittwoch changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Donnerstag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Donnerstag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Donnerstag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Donnerstag changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Freitag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Freitag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Freitag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Freitag changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Samstag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Samstag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Samstag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Samstag changed or
//Item Rolladen_EG_Kueche_Hoch_Stunde_Sonntag changed or
//Item Rolladen_EG_Kueche_Hoch_Minute_Sonntag changed or
//Item Rolladen_EG_Kueche_Runter_Stunde_Sonntag changed or
//Item Rolladen_EG_Kueche_Runter_Minute_Sonntag changed or
//Item Rolladen_EG_Kueche_Nighttime_Mode changed or
//Item Rolladen_EG_Kueche_Sonnenschutz_Modus changed or
//Item Rolladen_EG_Kueche_Sonnenschutz_Stand changed or
//Item Rolladen_EG_Kueche_Sonnenschutz_WinkelLinks changed or
//Item Rolladen_EG_Kueche_Sonnenschutz_WinkelRechts changed or
//Item Rolladen_EG_Kueche_Sonnenschutz_Wolken changed or
//Item OLDClouds changed
then
//logInfo("Rolladen Kueche","start")
if(Rolladen_EG_Kueche.state == NULL){
logInfo("Rolladen Kueche","Homatic not ready")
} else {
var int upTime = 0
var int downTime = 0
var Nachtmodus = false
if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "ASTRO"){
//logInfo("Rolladen Kueche","astro start")
upTime = (SunriseTime.state as DateTimeType).getCalendar.get(Calendar.HOUR_OF_DAY).intValue * 60 + (SunriseTime.state as DateTimeType).getCalendar.get(Calendar.MINUTE).intValue
downTime = (SunsetTime.state as DateTimeType).getCalendar.get(Calendar.HOUR_OF_DAY).intValue * 60 + (SunsetTime.state as DateTimeType).getCalendar.get(Calendar.MINUTE).intValue
Nachtmodus = true
//logInfo("Rolladen Kueche","astro end")
} else if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "GLOBAL"){
//logInfo("Rolladen Kueche","global start")
if(0 < now.getDayOfWeek && now.getDayOfWeek < 6){
upTime = (Rolladen_Hoch_Stunde_Werktags.state as Number).intValue * 60 + (Rolladen_Hoch_Minute_Werktags.state as Number).intValue
downTime = (Rolladen_Runter_Stunde_Werktags.state as Number).intValue * 60 + (Rolladen_Runter_Minute_Werktags.state as Number).intValue
} else if(5 < now.getDayOfWeek && now.getDayOfWeek < 8){
upTime = (Rolladen_Hoch_Stunde_Wochenende.state as Number).intValue * 60 + (Rolladen_Hoch_Minute_Wochenende.state as Number).intValue
downTime = (Rolladen_Runter_Stunde_Wochenende.state as Number).intValue * 60 + (Rolladen_Runter_Minute_Wochenende.state as Number).intValue
}
Nachtmodus = true
//logInfo("Rolladen Kueche","global end")
} else if(Rolladen_EG_Kueche_Nighttime_Mode.state.toString == "LOCAL"){
//logInfo("Rolladen Kueche","local start")
if(now.getDayOfWeek == 1){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Montag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Montag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Montag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Montag.state as Number).intValue
} else if(now.getDayOfWeek == 2){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Dienstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Dienstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Dienstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Dienstag.state as Number).intValue
} else if(now.getDayOfWeek == 3){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Mittwoch.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Mittwoch.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Mittwoch.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Mittwoch.state as Number).intValue
} else if(now.getDayOfWeek == 4){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Donnerstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Donnerstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Donnerstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Donnerstag.state as Number).intValue
} else if(now.getDayOfWeek == 5){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Freitag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Freitag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Freitag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Freitag.state as Number).intValue
} else if(now.getDayOfWeek == 6){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Samstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Samstag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Samstag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Samstag.state as Number).intValue
} else if(now.getDayOfWeek == 7){
upTime = (Rolladen_EG_Kueche_Hoch_Stunde_Sonntag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Hoch_Minute_Sonntag.state as Number).intValue
downTime = (Rolladen_EG_Kueche_Runter_Stunde_Sonntag.state as Number).intValue * 60 + (Rolladen_EG_Kueche_Runter_Minute_Sonntag.state as Number).intValue
}
Nachtmodus = true
//logInfo("Rolladen Kueche","local end")
}
//logInfo("Rolladen Kueche","get value start")
val int currentTime = now.getHourOfDay * 60 + now.getMinuteOfHour
val int azimuth = (SunAzimuth.state as Number).intValue
val int actual = (Rolladen_EG_Kueche.state as Number).intValue
val int max = (Rolladen_EG_Kueche_Sonnenschutz_Stand.state as Number).intValue
val int left = (Rolladen_EG_Kueche_Sonnenschutz_WinkelLinks.state as Number).intValue
val int right = (Rolladen_EG_Kueche_Sonnenschutz_WinkelRechts.state as Number).intValue
val int night = (Rolladen_EG_Kueche_Stand_Nachts.state as Number).intValue
val int old = (Rolladen_EG_Kueche_Stand_Tagsueber.state as Number).intValue
val int cloud = (OLDClouds.state as Number).intValue
val int cloudmax = (Rolladen_EG_Kueche_Sonnenschutz_Wolken.state as Number).intValue
//logInfo("Rolladen Kueche","get value end")
//logInfo("Rolladen Kueche","calc random start")
if((RandomMaxTime.state as Number).intValue != (RandomMinTime.state as Number).intValue){
var int random = (RandomMaxTime.state as Number).intValue - (RandomMinTime.state as Number).intValue
upTime = upTime + (((new Random).nextInt(random)) + (RandomMinTime.state as Number).intValue)
downTime = downTime + (((new Random).nextInt(random)) + (RandomMinTime.state as Number).intValue)
}
//logInfo("Rolladen Kueche","calc random end")
//logInfo("Rolladen Kueche","modus start")
if(upTime < downTime){
//logInfo("Rolladen Kueche","1")
if((currentTime <= downTime && currentTime >= upTime) || Nachtmodus == false){
//logInfo("Rolladen Kueche","2")
if(left < right){
//logInfo("Rolladen Kueche","3")
if((azimuth > left && azimuth < right) && cloudmax > cloud && actual <= max && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
//logInfo("Rolladen Kueche", "4")
if(actual != max){
//logInfo("Rolladen Kueche","5")
Rolladen_EG_Kueche.sendCommand(max)
//logInfo("Rolladen Kueche","6")
}
//logInfo("Rolladen Kueche", "7")
} else if(actual != old){
//logInfo("Rolladen Kueche","8")
Rolladen_EG_Kueche.sendCommand(old)
//logInfo("Rolladen Kueche","9")
}
//logInfo("Rolladen Kueche","10")
} else {
//logInfo("Rolladen Kueche","11")
if((azimuth > left || azimuth < right) && cloudmax > cloud && actual <= max && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
//logInfo("Rolladen Kueche", "12")
if(actual != max){
//logInfo("Rolladen Kueche","13")
Rolladen_EG_Kueche.sendCommand(max)
//logInfo("Rolladen Kueche","14")
}
//logInfo("Rolladen Kueche", "15")
} else if(actual != old){
//logInfo("Rolladen Kueche","16")
Rolladen_EG_Kueche.sendCommand(old)
//logInfo("Rolladen Kueche","17")
}
//logInfo("Rolladen Kueche","18")
}
//logInfo("Rolladen Kueche","19")
} else if(actual < night && Nachtmodus == true){
//logInfo("Rolladen Kueche","20")
Rolladen_EG_Kueche.sendCommand(night)
//logInfo("Rolladen Kueche","21")
}
//logInfo("Rolladen Kueche","22")
} else {
//logInfo("Rolladen Kueche","23")
if((currentTime <= downTime || currentTime >= upTime) || Nachtmodus == false){
//logInfo("Rolladen Kueche","24")
if(left < right){
//logInfo("Rolladen Kueche","25")
if((azimuth > left && azimuth < right) && cloudmax > cloud && actual <= max && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
//logInfo("Rolladen Kueche", "26")
if(actual != max){
//logInfo("Rolladen Kueche","27")
Rolladen_EG_Kueche.sendCommand(max)
//logInfo("Rolladen Kueche","28")
}
//logInfo("Rolladen Kueche", "29")
} else if(actual != old){
//logInfo("Rolladen Kueche","30")
Rolladen_EG_Kueche.sendCommand(old)
//logInfo("Rolladen Kueche","31")
}
//logInfo("Rolladen Kueche","32")
} else {
//logInfo("Rolladen Kueche","33")
if((azimuth > left || azimuth < right) && cloudmax > cloud && actual <= max && Rolladen_EG_Kueche_Sonnenschutz_Modus.state == ON){
//logInfo("Rolladen Kueche", "34")
if(actual != max){
//logInfo("Rolladen Kueche","35")
Rolladen_EG_Kueche.sendCommand(max)
//logInfo("Rolladen Kueche","36")
}
//logInfo("Rolladen Kueche", "37")
} else if(actual != old){
//logInfo("Rolladen Kueche","38")
Rolladen_EG_Kueche.sendCommand(old)
//logInfo("Rolladen Kueche","39")
}
//logInfo("Rolladen Kueche","40")
}
//logInfo("Rolladen Kueche","41")
} else if(actual < night && Nachtmodus == true){
//logInfo("Rolladen Kueche","42")
Rolladen_EG_Kueche.sendCommand(night)
//logInfo("Rolladen Kueche","43")
}
//logInfo("Rolladen Kueche","44")
}
//logInfo("Rolladen Kueche","modus end")
}
end
```