Ich bin noch immer fleißig dabei meine Klicki Bunti Regeln in .Rules zu packen.
Ob´s immer so sinnvoll ist, lass ich mal dahin gestellt, aber es macht Spass

Da ich viele Regeln redundant habe und aus verschiedenen Richtungen die gleichen Switches setze, habe ich auch dementsprechend viele Regeln.
So habe ich z.B. drei Regeln die, abhängig von der Helligkeit im Garten, meine Lichte, Rollo´s usw. steuern. Da schonmal unbemerkt mein Helligkeitssensor versagt hat (Batterie leer) und dadurch nix geschaltet wurde, habe ich parallel, noch Astro Regeln gebaut. Die Sonne und der Mond gehen ja immer

Das jetzt in eine Rule zu bringen fällt mir schwer. Da ist meine Grenze erreicht und ich brauche Hilfe.
So sehen meine Regeln aus:
Code: Alles auswählen
rule "Sunrise / Sunset"
when
Item Outdoor_Illuminance changed
then
val minuteOfDay = now.toLocalTime.getHour * 60 + now.toLocalTime.getMinute
if ( minuteOfDay >= 15 * 60 && minuteOfDay <= 22 * 60 ) {
if(Outdoor_Illuminance.state <= 2 && isDark.state != ON) {
logInfo("Sonnenuntergang", "isDark -> ON")
isDark.sendCommand (ON)
}
if(Outdoor_Illuminance.state <= 25 && isDusk.state != ON) {
logInfo("Sonnenuntergang", "isDusk -> ON")
isDusk.sendCommand (ON)
}
if(Outdoor_Illuminance.state <= 150 && isNight.state != ON) {
logInfo("Sonnenuntergang", "isNight -> ON")
isNight.sendCommand (ON)
}
}
if(Outdoor_Illuminance.state > 10 && isDark.state != OFF) {
logInfo("Sonnenaufgang", "isDark -> OFF")
isDark.sendCommand (OFF)
}
if(Outdoor_Illuminance.state > 35 && isDusk.state != OFF) {
logInfo("Sonnenaufgang", "isDusk -> OFF")
isDusk.sendCommand (OFF)
}
if(Outdoor_Illuminance.state > 170 && isNight.state != OFF) {
logInfo("Sonnenaufgang", "isNight -> OFF")
isNight.sendCommand (OFF)
}
end
Code: Alles auswählen
configuration: {}
triggers:
- id: "1"
configuration:
thingUID: astro:sun:local
event: START
channelUID: astro:sun:local:set#event
type: core.ChannelEventTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
itemName: isNight
command: ON
type: core.ItemCommandAction
Code: Alles auswählen
configuration: {}
triggers:
- id: "1"
configuration:
thingUID: astro:sun:local
event: START
channelUID: astro:sun:later:set#event
type: core.ChannelEventTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
itemName: isDark
command: ON
type: core.ItemCommandAction
Code: Alles auswählen
configuration: {}
triggers:
- id: "1"
configuration:
thingUID: astro:sun:local
event: START
channelUID: astro:sun:earlier:set#event
type: core.ChannelEventTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
itemName: isDusk
command: ON
type: core.ItemCommandAction
