Rule with Cron doesn´t work correctly

Hi, I made this rules for my blinds. Rules DAYLIGHT and CIVIL_DUSK work perfect, but the cron rules does not work correct. The last one with timer 7sec. also runs 30 seconds. Have I to define the variables? How could I do this. Thanx for any help.

//Rollo - Steuerung laut Tageszeit
rule "Rollo Steuerung auf"
    when
        Item Tagesphase changed to DAYLIGHT 
        then  
            sendTelegram("bot1", "Es ist Morgen. Rollos werden geöffnet")
            sendTelegram("bot2", "Es ist Morgen. Rollos werden geöffnet")
            R1auf.sendCommand(ON)
            R2auf.sendCommand(ON)
            createTimer(now.plusSeconds(30))   
            [| 
                R1auf.sendCommand(OFF)
                R2auf.sendCommand(OFF)
            ]
end

//Rollo - Steuerung laut Tageszeit
rule "Rollo - Steuerung ab"
    when
        Item Tagesphase changed to CIVIL_DUSK
        then  
            sendTelegram("bot1", "Es ist Abend. Rollos werden geschloßen")
            sendTelegram("bot2", "Es ist Abend. Rollos werden geschloßen")
            R1zu.sendCommand(ON)
            R2zu.sendCommand(ON)   
            createTimer(now.plusSeconds(30))   
            [| 
                R1zu.sendCommand(OFF)
                R2zu.sendCommand(OFF) 
            ]
end

//Rollo - Steuerung Mittags schließen
rule "Rollo - Steuerung ab"
    when
        Time cron "0 35 12 * * ? *"
        then
            sendTelegram("bot1", "Es ist Mittag. Rollos werden geschloßen")
            sendTelegram("bot2", "Es ist Mittag. Rollos werden geschloßen")
            R1zu.sendCommand(ON)
            R2zu.sendCommand(ON)   
            createTimer(now.plusSeconds(30))   
            [| 
                R1zu.sendCommand(OFF)
                R2zu.sendCommand(OFF) 
            ]
end

rule "Rollo Steuerung auf"
    when
        Time cron "0 00 14 * * ? *" 
        then  
            sendTelegram("bot1", "Es ist Nachmittag. Rollos werden geöffnet")
            sendTelegram("bot2", "Es ist Nachmittag. Rollos werden geöffnet")
            R1auf.sendCommand(ON)
            R2auf.sendCommand(ON)
            createTimer(now.plusSeconds(7))   
            [| 
                R1auf.sendCommand(OFF)
                R2auf.sendCommand(OFF)
            ]
end

You must give every rule a unique name
rule “unique text”
Otherwise when the system interprets the second occurence, it thinks it is an edit/replacement.

2 Likes

I would expect it just rejects the rule file. That should show up in the logs when trying to save, though.

Well, it doesn’t. See the part about thinks you are editing.