Hallo wer kann mir hierbei helfen?
Ich möchte an einem Bestimmten Tag in der Zeit von z.B. 8 bis 20 Uhr einen Timer haben der ein Item schaltet.
Also 5min pause dann 10 Sekunden an dann wieder 5 min Pause dann 10 Sekunden an....bis 20 Uhr.
Switch Beduftung_An_Aus "Beduftung An" <beduftung>
Number Beduftung_Timer_Anzeit "Beduftung Anzeit "
Number Beduftung_Timer_Ausszeit "Beduftung Auszeit "
rule "beduftungstimer"
//when Time cron "0 0/1 * 1/1 * ? *"
when Time cron "0 0 8 * * MON" or
Time cron "0 0 8 * * DI" or
Time cron "0 0 8 * * MIT" or
Time cron "0 0 8 * * DO" or
Time cron "0 0 8 * * FR" or
Time cron "0 0 8 * * SAT" or
Time cron "0 0 8 * * SONNE"
then
Time cron " 0/5 0 0? * * *" Beduftung_Timer_Anzeit.postUpdate(1)
Time cron " 0/5 0 0? * * *" Beduftung_Timer_Ausszeit.postUpdate(0)
Gruß Dirk
Timer Rule
- PeterA
- Beiträge: 1106
- Registriert: 8. Feb 2019 12:12
Re: Timer Rule
Hi,
zumindest zum Abschalten des Items könnte man das Expire Binding nutzen ?
https://www.openhab.org/addons/bindings/expire1/
zumindest zum Abschalten des Items könnte man das Expire Binding nutzen ?
https://www.openhab.org/addons/bindings/expire1/
- OpenHab 2.4
#PWRUP
#PWRUP
-
- Beiträge: 68
- Registriert: 13. Jan 2018 19:43
Re: Timer Rule
Ich habe mal was anderes probiert.
Ist das der richtige Ansatz?
rule "beduftung"
when Time cron "0 * * ? * *"
then
logInfo("Test", "testduft")
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, ON) ]
if(Beduftung_An_Aus.state == ON )
{
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, OFF) ]
}
else
{
Beduftung_An_Aus.postUpdate(OFF)
}
end
Gruß Dirk
Ist das der richtige Ansatz?
rule "beduftung"
when Time cron "0 * * ? * *"
then
logInfo("Test", "testduft")
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, ON) ]
if(Beduftung_An_Aus.state == ON )
{
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, OFF) ]
}
else
{
Beduftung_An_Aus.postUpdate(OFF)
}
end
Gruß Dirk
- PeterA
- Beiträge: 1106
- Registriert: 8. Feb 2019 12:12
Re: Timer Rule
Hi Dirk, den Code kann man hier besser lesen wenn man die code codefences benutzt:hulda hat geschrieben: ↑10. Jan 2020 10:59 Ich habe mal was anderes probiert.
Ist das der richtige Ansatz?
rule "beduftung"
when Time cron "0 * * ? * *"
then
logInfo("Test", "testduft")
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, ON) ]
if(Beduftung_An_Aus.state == ON )
{
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, OFF) ]
}
else
{
Beduftung_An_Aus.postUpdate(OFF)
}
end
Gruß Dirk
Code: Alles auswählen
rule "beduftung"
when Time cron "0 * * ? * *"
then
logInfo("Test", "testduft")
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, ON) ]
if(Beduftung_An_Aus.state == ON )
{
createTimer(now.plusSeconds(5)) [| sendCommand(Beduftung_An_Aus, OFF) ]
}
else
{
Beduftung_An_Aus.postUpdate(OFF)
}
- OpenHab 2.4
#PWRUP
#PWRUP