added heating rules

This commit is contained in:
2017-11-14 17:59:36 +01:00
parent 1a34a5d4e7
commit 6a45ee34e7
3 changed files with 67 additions and 0 deletions

10
heating/README.md Normal file
View File

@@ -0,0 +1,10 @@
# Heating rules
Some heating rules, based on a time schedule, presence and TV status.
I use HomeMatic controls for our heating devices. These example rule only covers one of six HomeMatic controls. Also the time schedule is just an example. You can add as many on and off timers as you like.
The rules also check if someone is at home (I use presence detection by wifi, setup see here in the repository) and if the TV in the living room is (still) on or already turned off. If nobody is at home when the heating time period starts, it will not adjust the temperature setting and wait until someone returns home during the heating time period. Also if everybody leaves home during the heating time period the temperature is lowered to the off-temperature.
Btw: With HomeMatic devices it does not make much sense in my eyes to turn off the heaters, so I just lower the temperature to a basic temperature which I want inside all the time, even if there is nobody at home or in the room.
* **heizungen.items**: Put this file into your */etc/openhab2/rules* directory and modify it for your specific setup.

54
heating/heizungen.rules Normal file
View File

@@ -0,0 +1,54 @@
// Turn on heating if someone is at home
rule "Heizung Wohnzimmer ein"
when
Time cron "0 30 6 ? * MON" or
Time cron "0 30 6 ? * TUE" or
Time cron "0 30 6 ? * WED" or
Time cron "0 30 6 ? * THU" or
Time cron "0 30 6 ? * FRI" or
Time cron "0 0 8 ? * SAT" or
Time cron "0 0 8 ? * SUN"
then
ThermostatEGWohnzimmer_Status.sendCommand(ON)
if (Presence_Overall.state==ON) {
sendCommand(ThermostatEGWohnzimmer_4_SetTemperature, 19)
}
end
// Turn on heating if someone returns home during heating time period
rule "Heizung Wohnzimmer ein 2"
when
Item Presence_Overall received command ON
then
if (ThermostatEGWohnzimmer_Status.state==ON) {
sendCommand(ThermostatEGWohnzimmer_4_SetTemperature, 19)
}
end
// Turn off (turn to a lower temperature) heating if everybody has left home or heating time period is over
rule "Heizung Wohnzimmer aus"
when
Item Presence_Overall received command OFF or
Time cron "0 0 22 ? * MON" or
Time cron "0 0 22 ? * TUE" or
Time cron "0 0 22 ? * WED" or
Time cron "0 0 22 ? * THU" or
Time cron "0 0 22 ? * FRI" or
Time cron "0 0 22 ? * SAT" or
Time cron "0 0 22 ? * SUN"
then
ThermostatEGWohnzimmer_Status.sendCommand(OFF)
if (TV_Power.state==OFF) {
sendCommand(ThermostatEGWohnzimmer_4_SetTemperature, 16)
}
end
// Turn off (turn to a lower temperature) heating after TV has turned off
rule "Heizung Wohnzimmer aus TV aus"
when
Item TV_Power changed from ON to OFF
then
if (ThermostatEGWohnzimmer_Status.state==OFF) {
sendCommand(ThermostatEGWohnzimmer_4_SetTemperature, 16)
}
end