

Code: Alles auswählen
rule "AutoBeleuchtung"
when
Time cron "0 0/15 * * * ?"
then
val CurrentHour = ZonedDateTime.now.getHour
if ((CurrentHour >=6 && CurrentHour <23) && (LokaleSonnendaten_Hohenwinkel.state as Number).floatValue <=0|°) TreppenhausEGShelly25_Betrieb2.sendCommand(ON)
else TreppenhausEGShelly25_Betrieb2.sendCommand(OFF)
end
Code: Alles auswählen
if ((CurrentHour >=6 && CurrentHour <23) && (LokaleSonnendaten_Hohenwinkel.state <=0|°)
Code: Alles auswählen
rule "AutoBeleuchtung"
when
Time cron "0 0/15 * * * ?"
then
val CurrentHour = ZonedDateTime.now.getHour
if ((CurrentHour >=6 && CurrentHour <23) && LokaleSonnendaten_Hohenwinkel.state <=-2|°) {
if (TreppenhausEGShelly25_Betrieb2.state == OFF) TreppenhausEGShelly25_Betrieb2.sendCommand(ON) }
else { if (TreppenhausEGShelly25_Betrieb2.state == ON) TreppenhausEGShelly25_Betrieb2.sendCommand(OFF)
}
end
Code: Alles auswählen
rule "AutoBeleuchtung"
when
Time cron "0 0/15 * * * ?"
then
val CurrentHour = ZonedDateTime.now.getHour
var soll = OFF
if(CurrentHour >= 6 && CurrentHour < 23 && LokaleSonnendaten_Hohenwinkel.state <= -2|°)
soll = ON
if(TreppenhausEGShelly25_Betrieb2.state != soll)
TreppenhausEGShelly25_Betrieb2.sendCommand(soll.toString)
end