Code: Alles auswählen
// import org.openhab.core.library.types.*
import java.util.Calendar
// import java.util.Date
import java.util.TimeZone
rule "PIR - Bewegung im Haus wurde erkannt"
when
Item PIR received update
then
var local_time = java::util::Calendar::getInstance(TimeZone::getTimeZone("Europe/Berlin"))
postUpdate(PRAESENZ_PIR, new DateTimeType(local_time))
end
rule "anwesend"
when
Item anwesend changed to ON
then
Wohnzimmer_Target.postUpdate(20)
Wohnzimmer_Target.sendCommand(20)
sendCommand(Steckdose, ON)
sendCommand(Steckdose2, ON)
sendCommand(fboxWifi24, ON)
sendCommand(fboxWifi50, ON)
// sendCommand(anwesend, OFF)
end
rule "abwesend"
when
Item anwesend changed to OFF
then
Wohnzimmer_Target.postUpdate(10)
Wohnzimmer_Target.sendCommand(10)
sendCommand(Steckdose, OFF)
sendCommand(fboxWifi24, OFF)
sendCommand(fboxWifi50, OFF)
end
rule "WLAN"
when
Item fboxWifi24 changed to ON
then
sendCommand(fboxWifi50, ON)
end
// rule "Wakeup"
// when
// Time cron "0 00 07 ? * MON-FRI "
// then
// callScript("dimmlight")
// end
rule "Runterregeln"
when Item Balkontuer1 changed to OPEN
then
Temp_Buero_set_TEMP.postUpdate(Wohnzimmer_Target.state) // Wohnzimmer_Target.state
sendCommand(Wohnzimmer_Target, 6)
end
rule "Anheizen"
when
Item Balkontuer1 changed to CLOSED
then
// sendCommand(Wohnzimmer_Target, (Temp_Buero_set_TEMP.state as DecimalType))
Wohnzimmer_Target.sendCommand(Temp_Buero_set_TEMP.state as Number)
end
rule "IR"
when
Item IR7 received update
then
switch IR7.state {
case "0x5EA138C7":
TV.sendCommand(transform("MAP","IR.map",0))
}
end
rule "Test"
when
Item TV1 received update
then
TV.sendCommand(transform("MAP","IR.map",0))
end