Hallo zusammen,
ich habe 3 Bewässerungsventile, die ich getrennt und nacheinander aktivieren muss. Um die einzelne Dauer beinflussen zu können, habe ich 3 items erstellt.
Diese sind in meiner Sitemap, so das ich die Werte verändern kann
Nun wollte ich mit einer Regel die Ventile nacheinander starten, finde aber nicht die richtige Methode
Ich hatte es mit Timern probiert, aber da hapert es an der Reihenfolge und ich bekomme die Werte aus meinen Items nicht übergeben und habe für den Test zunöchst mit festen Sekunden gearbeitet (daher unterscheiden sich die auskommentierten Watering Timer Werte)
Die Werte der Timer würden dann quasi aufeinander aufbauen, die Watering_Timer würden dann den Wert aus den IrrigationTimer erhalten und laufen automatisch gegen 0
Somit müsste das zweite Ventil t-10 Sekunden von IrrigationTimer 1 den Einschaltbefehl erhalten, damit diese 10 Sekunden überlappend laufen um die Pumpe nicht abzuschalten.
Habt ihr hier einen Tip wie ich diese Regel angehen sollte?
Viele Grüße,
Jörg
ich habe 3 Bewässerungsventile, die ich getrennt und nacheinander aktivieren muss. Um die einzelne Dauer beinflussen zu können, habe ich 3 items erstellt.
NumberIrrigationTimer_1"Timer 1"<faucet>
NumberIrrigationTimer_2"Timer 2"<faucet>
NumberIrrigationTimer_3"Timer 3"<faucet>
NumberIrrigationTimer_2"Timer 2"<faucet>
NumberIrrigationTimer_3"Timer 3"<faucet>
Nun wollte ich mit einer Regel die Ventile nacheinander starten, finde aber nicht die richtige Methode

Ich hatte es mit Timern probiert, aber da hapert es an der Reihenfolge und ich bekomme die Werte aus meinen Items nicht übergeben und habe für den Test zunöchst mit festen Sekunden gearbeitet (daher unterscheiden sich die auskommentierten Watering Timer Werte)
Code:
[COLOR=#c586c0]rule[/COLOR][COLOR=#4ec9b0]TestIrrigation[/COLOR] [COLOR=#c586c0]when[/COLOR] [COLOR=#569cd6]Item[/COLOR][COLOR=#4ec9b0]Sw_Irrigation[/COLOR][COLOR=#d4d4d4] received command[/COLOR] [COLOR=#c586c0]then[/COLOR] [COLOR=#c586c0]if[/COLOR][COLOR=#d4d4d4] (receivedCommand [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]ON[/COLOR][COLOR=#d4d4d4]&&[/COLOR][COLOR=#4ec9b0]Sw_Bewaesserung[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]ON[/COLOR][COLOR=#d4d4d4]&&[/COLOR][COLOR=#4ec9b0]Holiday[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]OFF[/COLOR][COLOR=#d4d4d4]&&[/COLOR][COLOR=#4ec9b0]Sensor_humidity[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state [/COLOR][COLOR=#d4d4d4]<[/COLOR][COLOR=#b5cea8]60[/COLOR][COLOR=#d4d4d4]) {[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Bewässerung EIN"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#c586c0]if[/COLOR][COLOR=#d4d4d4] (t_green [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#569cd6]null[/COLOR][COLOR=#d4d4d4]){[/COLOR] [COLOR=#d4d4d4] pushNotification([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 1 - "[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 1"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#6a9955]// Watering_Timer_1.sendCommand(15)[/COLOR] [COLOR=#d4d4d4] t_green [/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#d4d4d4] createTimer(now[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]plusSeconds([/COLOR][COLOR=#b5cea8]55[/COLOR][COLOR=#d4d4d4]))[|[/COLOR] [COLOR=#d4d4d4] pushNotification([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 2"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 2"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#6a9955]// Watering_Timer_2.sendCommand(15)[/COLOR] [COLOR=#d4d4d4] t_green[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]cancel[/COLOR] [COLOR=#d4d4d4] t_green [/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#569cd6]null[/COLOR] [COLOR=#d4d4d4] ][/COLOR] [COLOR=#d4d4d4] t_green [/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#d4d4d4] createTimer(now[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]plusSeconds([/COLOR][COLOR=#b5cea8]35[/COLOR][COLOR=#d4d4d4]))[|[/COLOR] [COLOR=#d4d4d4] pushNotification([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 3"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Starte Ventil 1"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#6a9955]// Watering_Timer_2.sendCommand(15)[/COLOR] [COLOR=#d4d4d4] t_green[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]cancel[/COLOR] [COLOR=#d4d4d4] t_green [/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#569cd6]null[/COLOR] [COLOR=#d4d4d4] ][/COLOR] [COLOR=#d4d4d4] }[/COLOR] [COLOR=#d4d4d4] } [/COLOR][COLOR=#c586c0]else[/COLOR][COLOR=#c586c0]if[/COLOR][COLOR=#d4d4d4] (receivedCommand [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]ON[/COLOR][COLOR=#d4d4d4]&&[/COLOR][COLOR=#4ec9b0]Sw_Bewaesserung[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]OFF[/COLOR][COLOR=#d4d4d4]&&[/COLOR][COLOR=#4ec9b0]Holiday[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]OFF[/COLOR][COLOR=#d4d4d4]) {[/COLOR] [COLOR=#d4d4d4] pushNotification([/COLOR][COLOR=#ce9178]"TEST - Auto. Bewässerung"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#4ec9b0]Sw_Bewaesserung[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]toString)[/COLOR] [COLOR=#4ec9b0]Sw_Irrigation[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]sendCommand([/COLOR][COLOR=#b5cea8]OFF[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#d4d4d4] } [/COLOR][COLOR=#c586c0]else[/COLOR][COLOR=#c586c0]if[/COLOR][COLOR=#d4d4d4] (receivedCommand [/COLOR][COLOR=#d4d4d4]==[/COLOR][COLOR=#b5cea8]OFF[/COLOR][COLOR=#d4d4d4]) {[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST Irrigation"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#ce9178]"Irrigation stopped"[/COLOR][COLOR=#d4d4d4])[/COLOR] [COLOR=#c586c0]if[/COLOR][COLOR=#d4d4d4] (t_green [/COLOR][COLOR=#d4d4d4]!=[/COLOR][COLOR=#569cd6]null[/COLOR][COLOR=#d4d4d4]){[/COLOR] [COLOR=#d4d4d4] t_green[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]cancel[/COLOR] [COLOR=#d4d4d4] t_green [/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#569cd6]null[/COLOR] [COLOR=#d4d4d4] }[/COLOR] [COLOR=#6a9955] Watering_Timer_1sendCommand(0)[/COLOR] [COLOR=#6a9955] Watering_Timer_2.sendCommand(0)[/COLOR] [COLOR=#6a9955] Watering_Timer_3.sendCommand(0)[/COLOR] [COLOR=#d4d4d4] logInfo([/COLOR][COLOR=#ce9178]"TEST Irrigation"[/COLOR][COLOR=#d4d4d4], [/COLOR][COLOR=#4ec9b0]Valves[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]state[/COLOR][COLOR=#d4d4d4].[/COLOR][COLOR=#d4d4d4]toString)[/COLOR] [COLOR=#d4d4d4] }[/COLOR] [COLOR=#c586c0]end[/COLOR]
Somit müsste das zweite Ventil t-10 Sekunden von IrrigationTimer 1 den Einschaltbefehl erhalten, damit diese 10 Sekunden überlappend laufen um die Pumpe nicht abzuschalten.
Habt ihr hier einen Tip wie ich diese Regel angehen sollte?
Viele Grüße,
Jörg
Kommentar