Hallo,
ich möchte einige Aktionen zu einer bestimmten Zeit ausführen lassen. Hierzu gibt es ein Beispiel:
"
var boolean temphigh = false
rule "rollershutterdown-if-hot-and-between-9-and-3"
when
Item Netatmo_Aussen_Temperatur received update
then
if(Netatmo_Aussen_Temperatur.state <= 21)
{
temphigh = false
}
else
{
if (temphigh == false)
{
// create timer - for a timecheck - 15.30 today.
var DateTime heiss_bis = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 15, 30, 0)
// create timer - today 8.30pm
var DateTime heiss_von = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 8, 30, 0)
// check if allready marked as hightemperature and in the time between
if(now.isBefore(heiss_bis) && (now.isAfter(heiss_von)) && (temphigh == false))
{
// Shutdown all rollershutter in the Group Jalousien_SONNE
Jalousien_Sonne?.members.forEach(item,i|createTime r(now.plusSeconds(i)) [|sendCommand(item, DOWN)])
// set global variable
temphigh = true
}
}
}
end
"
Nur funktioniert das unter OH2 nicht. Hätte jemand ein funktionierendes Beispiel ?
Gruß
Frank
ich möchte einige Aktionen zu einer bestimmten Zeit ausführen lassen. Hierzu gibt es ein Beispiel:
"
var boolean temphigh = false
rule "rollershutterdown-if-hot-and-between-9-and-3"
when
Item Netatmo_Aussen_Temperatur received update
then
if(Netatmo_Aussen_Temperatur.state <= 21)
{
temphigh = false
}
else
{
if (temphigh == false)
{
// create timer - for a timecheck - 15.30 today.
var DateTime heiss_bis = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 15, 30, 0)
// create timer - today 8.30pm
var DateTime heiss_von = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 8, 30, 0)
// check if allready marked as hightemperature and in the time between
if(now.isBefore(heiss_bis) && (now.isAfter(heiss_von)) && (temphigh == false))
{
// Shutdown all rollershutter in the Group Jalousien_SONNE
Jalousien_Sonne?.members.forEach(item,i|createTime r(now.plusSeconds(i)) [|sendCommand(item, DOWN)])
// set global variable
temphigh = true
}
}
}
end
"
Nur funktioniert das unter OH2 nicht. Hätte jemand ein funktionierendes Beispiel ?
Gruß
Frank
Kommentar