Hi
I have a similar heating rule that works nice:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.util.*
rule "Heat on weekdays"
when
Time cron "0 45 5 ? * MON-FRI"
then
sendCommand(Heating_All,ON)
end
rule "Heat off weekdays"
when
Time cron "0 15 0 ? * MON-FRI"
then
sendCommand(Heating_All,OFF)
end
rule "Heat on weekends"
when
Time cron "0 45 7 ? * SAT,SUN"
then
sendCommand(Heating_All,OFF)
end
rule "Heat off weekends"
when
Time cron "0 15 1 ? * SAT,SUN"
then
sendCommand(Heating_All,OFF)
end
However I would also like to switch the heat off between 8 -16 on weekdays, but only if i am not at home: Do i need to add it another cron rule or can i somehow do it with a: if time>8 and <16 rule in my presence rule?
rule "Someone is at home"
when
Item MOB188 changed to ON or
Item MOB137 changed to ON
then
postUpdate(PRAESENZ, ON)
sendCommand(Light_All,ON)
if time>8 and <24 then
sendCommand(Heating_All,ON)
end if
end
rule "No one is at home"
when
Item MOB188 changed to OFF or
Item MOB137 changed to OFF
then
if(MOB188.state == OFF && MOB137.state == OFF) {
postUpdate(PRAESENZ, OFF)
sendCommand(Light_All,OFF)
if time>8 and <16 then
sendCommand(Heating_All,OFF)
end if
}
end
Or how does people normally heat their homes? Ideally i think it should look like this:
If you are there then heating is on:
If it is at night lower temperature to 16
If you are home then temperature is 19 in living rooms,hallways,bedrooms,21 in bathroom and offices
If google now tells openhab its on its way home(lets say 30min) then boost heat
Keeps all rooms above 4 degree when you are away
Any input feedback on this?
And I hope Joe can use my simple cron heating rule…