Hi everyone,
I believe everyone that has OH also have some kind of heating(unless u live in hawaii or some other exotic place) and hence I will like to discuss a tutorial I trying to put together.
So question number 1:
What is recomennded room temperatures?
I assume this is dependent of age(old/infant??)
What kind of activity(sleeping,working,relaxing)
So if we somehow can answer question 1 we can move on to number two
The rooms will have different modes(away, sleeping etc…) so we need to figure out how long it takes to change from one mode to another mode. This can be found by using thermodynamics: Q=k*deltaT-Heatsource
So lets say we are at work and know that we will be home 4, so question is when do we start heating? This is a bit tricky, but in most practical cases we can do experiments and achieve more than good enough results.
We could make a lambda function which takes in outside temperature,inside temperature,wind speed,power consumption,desired temperature and returns a time, but I would assume that inside temperature and desired temperature would be enough or?
So there are several types of heating but in general a simple On/off regulator is enough for most heating and my lambda fuction for this is given below:
val Functions.Function3 heatings = [ GenericItem setPoint,GenericItem temperature,GenericItem relay |
// Turn on the heater if the temp gets more than 2 degrees below the Heating_LivingRoom_Setpoint to prevent rapid cycling
if((temperature.state as DecimalType)-1.0< (setPoint.state as DecimalType)) {
//Items connected to NC, i.e sendcommand off is ON!!
if(relay.state != OFF) relay.sendCommand(OFF)
}
else {
//Items connected to NC, i.e sendcommand off is ON!!
if(relay.state != ON) relay.sendCommand(ON)
}
]
So this basic lambda function takes 3 arguments which then user need to specify:
- The set point, the temperature that the user feels comfortable with(See Q1),
- The measured temperature, if you have a large room you could take the average or similiar for several temperature measurement and use this.
- A switch item, this is a generic item, so here you could have mqtt, gpio, http and many other bindings as long as it compatible with a switch item(@ThomDietrich can lambda function take optinal argument in case you want to invert the item, i.e On=OFF or set delta temperature ?)
The rule to use this generic function is then simple as this
// Rule to drive the Heater
rule "Heater in living room"
when
Item Netatmo_Indoor_Temperature received update or
Item Heating_LivingRoom_Setpoint received update
then
heatings.apply(Heating_LivingRoom_Setpoint,Netatmo_Indoor_Temperature,Heating_LivingRoom)
end
@ThomDietrich Maybe the simple rule could use group instead to make it more versatile, that you simply tag your control temp measure with [Temperature_control_LivingRoom] and than the witch item with [Heating_output_LivingRoom] and finally [SetPoint_Control_LivingRoom] and then a generic rule somehow loop throug all with tags Setpoint_Control* instead of having to define one rule for each room…
GREAT now we can control our heat! So lets move on… We want our heating to be smart right?
So we dont have to have our heating on standard temperature while we are away, or at night while we are sleeping?
So then the idea is to alter the set temperature, todo this my solution is to have a seperate sitemap called admin where i can configure the set temperatures:
So my solution is to have 3 different temperature set points,
- When you are away, you want it just above freezing basically
- Normal, when you are home(I does not have different temp for activity level yet…)
- When sleeping, at night(You want not to set this to low because you do not want to rapid tempertaure changes every night)
So now @ThomDietrich or @Kai or someone else might have some clever ideas how to do this:)
- So typically we would enable presence, (WIFI,bluetooth,motion sensors) to detect if away mode should be activated or not
- Then we would like to sync the alarm clock /calender to find out when the night is over
- Use IFTTT gps bounding box or similiar to detect that you will be home in XX minutes, calender,cron job
- To enable night mode use some motion sensors(like under the bed), cron combined with the trigger that bedroom light most likely go on first then off, and other lights are off/other motion sensor off and its after 10 pm or so.
- Finally what most smart thermostat has, is that if you open a door or window and there is a rapid temperature gradiant then lower the set temperature by 4 degreece untill the door is closed again
This is the most tricky part in my opinion, thats why i just run a simple cron job so far…
So lets recap, does this actually make sense? I am not quite sure with kwh prices around 0.1$. But we can figure out:
Heating cable has pretty constant current draw, so what we can do is just to measure on time:)
Then we could generate a string item which looks like something like this:
Living Room (ON) Last 24H: 0.300kWh/20% Last Week 2.300kWh/20% Last Month 23.00kWh/20% Total Last Week 3300kWh/20%
@ThomDietrich Didnt u write something like that, could we make it generic?
To be updated is alarms, temperature to low, to high, battery changes etc…