Browse Source

added heating rules

master
Martin Sebald 7 years ago
parent
commit
6a45ee34e7
  1. 3
      README.md
  2. 10
      heating/README.md
  3. 54
      heating/heizungen.rules

3
README.md

@ -5,6 +5,9 @@ If you find problems or errors, please [let me know](https://www.sebald.com/kont
The stuff I provide is based on [openHABian](http://docs.openhab.org/installation/openhabian.html) on a Raspberry Pi 3 using openHAB 2.1 and sometimes might reflect on my own (sometimes special) hardware and environment in and around my house. The stuff I provide is based on [openHABian](http://docs.openhab.org/installation/openhabian.html) on a Raspberry Pi 3 using openHAB 2.1 and sometimes might reflect on my own (sometimes special) hardware and environment in and around my house.
## heating
Some heating rules, based on a time schedule, presence and TV status.
## presence ## presence
Wifi Presence - Detect a person with his/her smartphone entering or leaving the wireless home network (based on a Fritzbox and two DD-WRT based access points). Wifi Presence - Detect a person with his/her smartphone entering or leaving the wireless home network (based on a Fritzbox and two DD-WRT based access points).

10
heating/README.md

@ -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

@ -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
Loading…
Cancel
Save