jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
329 stars 34 forks source link

Floor temp: max and min #232

Closed dankarization closed 8 months ago

dankarization commented 11 months ago

In heated floor systems (nevermind water or electrical based) there's a maximum floor temperature, that should not be exceeded, no matter the room temperature, because it's dangerous, and minimum floor temperature, below which floor would be uncomfortable to touch. Good physical thermostats measure both of these temps to use.

This floor temperature is measured by another sensor entity in our smart case. Regarding maximum one it's very simple- even if room temperature is lower than needed, but floor temperature is higher that entered treshhold, heater needs to be turned off and wait for the floor one to drop. Regarding minimum floor temperature it's a bit trickier, but that's my idea: there's a need to still turn on heating just to warm up the floor a bit, even if it will overshoot room temperature. I guess there's at least 3 values needed for this logic to work properly: min_floor_temp, timeout and max_room_temp If floor temperature is lower than min_floor_temp for timeout or longer, then we turn on heating ignoring the fact that it's already warm enough, but if our floor is still cold and room temperature is greater than max_room_temp, then we turn it off.

Dual thermostat integration and a few others have implementation of the maximum floor temperature, but none that I've seen have minumum one.

dankarization commented 11 months ago

image

This can be solved by using sensor like this instead of the real temperature sensor, but this is a) ugly b) needs a lot of time if you have enough thermostats c) noone will get new cool feature with the next Versatile Thermostat update <3

jmcollin78 commented 11 months ago

I understand your point. It is the first time, someone claims this feature. I will keep it open if others need the same feature. For now, it seems not very complex to implements but need more and more configuration and complexity.

Not sure I will implement this.

CipherLab commented 11 months ago

I second this feature

maia commented 11 months ago

Aren't the two options "minimal temperature allowed" and "maximal temperature allowed" (should read "maximum") in the first config panel exactly what is needed and the issue is that the regulated target temperature goes over/under these values? That would be a bug, at least with the wording "allowed".

dankarization commented 11 months ago

Aren't the two options "minimal temperature allowed" and "maximal temperature allowed" (should read "maximum") in the first config panel exactly what is needed and the issue is that the regulated target temperature goes over/under these values? That would be a bug, at least with the wording "allowed".

Not exactly. This problem is specific to floor heating, and here we need 2 sensors. Ambient temp we're trying to achieve and floor one that's creating us problems

maia commented 11 months ago

Not exactly. This problem is specific to floor heating, and here we need 2 sensors. Ambient temp we're trying to achieve and floor one that's creating us problems

From my interpretation the "maximum temperature allowed" config option defines the maximum the heating device tolerates. It does not define how warm the room may be. But that's only my understanding of this option.

EDIT: I assume TRVs only tolerate a certain range of target temperatures too. That is why I think "maximum allowed" is the range the device can handle. No matter if TRV or floor heating.

dankarization commented 11 months ago

temp_max and temp_min are the same as in generic thermostat component in HA, as I understand it. Just how low or high you can set the desired temperature on your created thermostat. This can be used a) as you said,

the range the device can handle

or just to limit this window to even smaller corridor just because you like it that way. Thermostat will still operate by 1 temperature value, not 2 (well, 3, because there's also an external temperature, but you get the point)

Coffee0297 commented 11 months ago

i go arround this by setting a target floor temp, and then i dont care what so ever of the room temp as it will just follow the floor, have been working for me the last 2 years with HA. Much better regulation as in floor is very slow, and all the floors are the same temp for your feet. the floor temp needs to be adjusted for the room temp sure, but thats a one time thing, mine is at 22c floor temp and even when it snows or is -10c and windy the room temp is comftable.

Stratagm commented 11 months ago

I have use of a similar feature to this.

In my case the system is water based. I don't have actual floor sensors, but I can get very close by measuring the return water temperature.

This is important because not only will it allow me to glance the floor temperature, but also keep my return temperature low, which will increase efficiency of my heart source, no matter if its gas, oil, wood pellets, geothermal, district heating, or a heatpump.

Rather than a direct min/max temperature, I envision a feedback loop based on return temperature, or floor temperature, that will alter the TPI output.

This will allow for a faster responding and more efficient system, by initially heating the floors thermal mass, and slowing down once temperatures rise, letting the mass radiate heat.

jmcollin78 commented 11 months ago

Hello @Stratagm ,

Rather than a direct min/max temperature, I envision a feedback loop based on return temperature, or floor temperature, that will alter the TPI output.

I love this way of thinking the problem. But what could be the PI algorithm with this improvement ? (and don't have any TPI yet).

I wonder, as said by @Coffee0297, setting the VTherm target temp as the target floor temp and room temp as the floor temp is not an easy and out-of-the box solution. So may be a simple over_switch VTherm than turn on if floor temp is < target floor temp and turn_of if floor temp if > target floor (with modulation of course) can make the trick out of the box without needed to add more and more configuration parameters (which is the main issue of this request).

Stratagm commented 11 months ago

Hello @jmcollin78 :)

So maybe a simple over_switch VTherm than turn on if floor temp is < target floor temp and turn_of if floor temp if > target floor.

I would advise against setting hard limits, in any control loop, or even allowing them to be set unless strictly necessary. They can easily set the control loop into a state from which it cannot recover, or cause undesirable effects.

For instance, envision you are living in a poorly insulated house, and its -10°C outside. You will require your heating system to be running full blast to maintain a comfortable temperature, but if you have a max floor temperature specified the system will be prevented from doing this, and the end result is it will never achieve the target temperature, or even a comfortable temperature.

In the opposite scenario, if its +30°C outside, you will have no desire for heating, you want your floors cold, to absorb some of the heat during the day to stay cool. If you have a minimum temperature set, the system might be running the heat, in the middle of summer, to maintain a minimum floor temperature.

I love this way of thinking the problem. But what could be the PI algorithm with this improvement ? (and don't have any TPI yet).

The easiest, and probably most effective method, would be to have two control loops fighting each other.... You already have one half of the setup.

Control loop 1 regulates the air temperature via a PI algorithm Control loop 2 regulates the floor/returnwater temperature via a P or PI algorithm

Both control loops need to have their own dedicated temperature sensor, and dedicated setpoints. Their output range will also have to be identical, i.e. -100 to +100.

Then their outputs should be multiplied by a weighting factor, and added together to form the final valve output. Importantly the weighting factors range from 0 to 1 and their combined value needs to equate to 1 when added together, otherwise the entire system will be either dampened or overtuned.

Out1 Weight1 + Out2 Weight2 = Final output

It should be noted that this approach will individually dampen each control loop, but their combined output possibility remains the same. To combat this dampening I would recommend setting their default coef_int a little higher than 0.6.

This approach leaves us with a lot of flexibility and functionality. If Weight1 is set to 1, we get a pure air temperature regulation. If Weight2 is set to 1, we get a pure floor/returnwater temperature regulation. Any other combination will result in a mixture of the two.

Let's assume a scenario, with weightings Weight1 = 0.7 and Weight2 = 0.3, in which the both the air and floor/returnwater is colder than desired. In this scenario both control loops will request heat, resulting in an expected output of close or equal to 100%.

Out1 Weight1 + Out2 Weight2 = Final output 100 0.7 + 100 0.3 = 100%

As the heating runs, the floor will start to heat up before the air, and eventually reach the desired floor temperature, but the air is still cold. At this point the control loops will have a different outputs, loop 1 will still want maximum heating, but loop 2 will want no heating at all, so the final output will be:

Out1 Weight1 + Out2 Weight2 = Final output 100 0.7 + 0 0.3 = 70%

This is desirable because at this point our floors are hot, they cannot absorb or radiate heat any faster than they already are, so it makes sense to reduce the applied heating.

As time progresses the air temperature will rise and heating will again be turned down, eventually to a point where the floors start cooling down, without the air temperature dropping. If we at this point don't start applying heating again to maintain the floor temperature, the air temperature will start to drop as well, but by then the floors will be cold. Before we can alter the air temperature, we need to reheat the floor, leading to a very long thermal inertia. If we instead have the heating be applied again, by control loop 2, as the floor starts cooling, we can maintain the floor in a ready to heat state.

Out1 Weight1 + Out2 Weight2 = Final output 0 0.7 + 50 0.3 = 15%

Now, you might have wondered why I recommended an output range of -100 to +100, instead of 0 to 100, which doesn't make much sense at all. We can't have negative heating (cooling) in a heating only system after all. That is because I left an unaddressed issue in the previous explanation. If we have a target floor temperature, the thermostat is likely to want heating, even in summer when we don't want it. If we allow each thermostat to output a negative number, we can get better control. I.E. in summer when the interior air is much warmer than the thermostat setpoint, the output of control loop 1 should be allowed to go negative, this will then subtract from control loop 2 that might otherwise want heating to keep the floors up to temperature.

Out1 Weight1 + Out2 Weight2 = Final output -50 0.7 + 100 0.3 = -5% (0%)

This also applies during high heating scenarios. If the floor goes above its target temperature we not only get an uncomfortably hot and heat saturated floor, that cannot radiate heat away any faster than it is, but also loose a lot of efficiency in our heat source. It is therefore logical that control loop 2 should be able to deduct from the final output, if the floors exceed "maximum" desired temperature.

Out1 Weight1 + Out2 Weight2 = Final output 100 0.7 + -50 0.3 = 55%

Finally, in a steady state the control loops can correct some of error that might otherwise arise from an improperly balanced weighting or setpoint. The floor might be demanding more heat because its setpoint is set too high, but the air is already hot, so they will mostly cancel out.

Out1 Weight1 + Out2 Weight2 = Final output -30 0.7 + 60 0.3 = 1%

I hope this becomes useful, It certainly took me quite a while to write :)

dankarization commented 11 months ago

but if you have a max floor temperature specified the system will be prevented from doing

And if you don't have it, your electrical heated floor cable will just burn itself and break, and you will have no heaters at all.

jmcollin78 commented 11 months ago

Thank you @Stratagm, I appreciate your effort to build an integrated algorithm. I will have a look at this in the details. You are describing a new kind of VTherm. After over_switch, over_climate, over_valve, here comes the over_floor with a new algo and new parameters, .... This is a hard work to be done.

And if you don't have it, your electrical heated floor cable will just burn itself and break, and you will have no heaters at all.

@dankarization Is this a real risk or are you exaggerating? If it is a real risk, there is always a possibility to exceeds to floor high limit which such an algorithm because of the 2 part of the calculation. So maybe a hard limit is also needed cause we always need to favor the safety vs the target temperature. That is what is done with the "safety mode" if temperature sensors are out of order.

dankarization commented 11 months ago

This is a real technical limitation, for both the heated cable/mat itself and some floor surfaces over it. a) you can destroy your cable/mat b) you can lead to drying out and deformation of the laminate, parquet or some other wood surface c) still comfort issue, you can get a light burn on your feet

Stratagm commented 11 months ago

@dankarization Is this a real risk or are you exaggerating? If it is a real risk, there is always a possibility to exceeds to floor high limit which such an algorithm because of the 2 part of the calculation.

The risk is real, although I think exaggerated. With my approach the risk can still be mitigated greatly, simply by adjusting the weighting of each control loop, i.e. Reducing Weight1 and increasing Weight2.

Edit: I googled electric underfloor heating, and this came up, it has a maximum safe continous operating temperature of 75°C, and max allowed temperature of 90°C, at those temperatures you get instantly burned... I cannot envision a situation in which these temperatures will be reached, unless improperly installed, ie directly in insulation.

https://store.danfoss.com/fi/en/Climate-Solutions-for-heating/Electric-heating/DEVI-electric-heating/Heating-cables/Serial-resistive-heating-cables/Heating-Cables%2C-DEVIflex%E2%84%A2-10T%2C-10-W-m%2C-80-00-m%2C-Supply-voltage-%5BV%5D-AC%3A-230/p/140F1226

gunmalmg commented 11 months ago

I'm a little late to this topic, but I can start by saying that the need for max-limit for electric heated floors is a common need in our nordic countries, and is handled by all electric floor heating thermostats that are sold here. So this is a function that VT definitely should have for this purpose. The need for a max floor temp in this setup is related to situations where wood flooring is placed on top of the electric heated floor. If the floor temp gets to hi, the wood flooring will be dried out and crack. This is a common setup in our country and needs to be addressed by VT. Several of my friends have asked my for this feature in VT - and I was on my way to post this issue my selfe.

So this is not a matter of voting in favour or against - this feature must be implemented for the nordic countries where this is a common solution in electric heated floors today.

The solution : We need to define one more temp sensor in VT(that we have in the floor) and set a max temp for that sensor to ensure that VT not regulates the room temp in a way that exceeds that max floor temp.

jmcollin78 commented 11 months ago

Hello @gunmalmg ,

The solution : We need to define one more temp sensor in VT(that we have in the floor) and set a max temp for that sensor to ensure that VT not regulates the room temp in a way that exceeds that max floor temp.

The need of this feature is not the question: it seems important/mandatory for many for us. The only question is how to do that. Your proposal is simple but adds more complexity in configuration which is already complex for the user. Many question / issue are due to this complexity. So I really want to avoid adding new parameters (3 here) for each new use case. Not only for usability but also for maintainability, this began to be a nightmare.

So we are looking now at the best compromise. @Stratagm propose an option without any configuration parameter but more complex and without any guarantee of proper working.

gunmalmg commented 11 months ago

I see your point. Your VT is complicated enaught already. And I am amazed by what you have achieved with VT.

For this max temp / electric floor heating need - it may be more realistic to make a new integration for this scenario. Because the electric floor heating regulation - I think - is much simpler to regulate than many of the regulation issues you have managed to handle.

jmcollin78 commented 11 months ago

Not really a new intégration but a new kind of VTherm certainly (like over_switch, over_climate, over_valve). May be an over_floor or something like that. This makes the specifics parameters not visible for others users (like over_climate regulation parameters are visible only to over_climate).

Suppose I do a new type of VTherm (over_floor), does this type need self-regulation like for over_climate ?

gunmalmg commented 11 months ago

This is just like over_switch. Witch work fine for electric floor heating that don’t need the max limit (I currently use VT over_switch for my electric floor heating. But I haven't had the need for max limit the floor heat since I have tiles on top of the floor that can handle the heat)

In a perfect solution we wish for both max-limit and a low-comfort-limit. The low-comfort-limit is for floors with tiles upon. The tiles can be experienced as uncomfortable could in the spring/autumn when the floor doesn’t need heat for the room temp. But we would like the floor to keep a minimum temperature. This is spesial relevant in the bathroom on bare foot. And this low-comfort-limit should ideally follow(have different values) for the presets Comfort and Eco. (Don’t need a low-comfort-limit for preset Frost)

HACS-bank commented 10 months ago

Safety critical aspects should be handled directly by the heating plant - if HA or VTherm instructs the floor to destroy itself or overheat, it should not do so.

If a safety device is required, it should surely be part of the physical cabling of the electric floor, not rely on software which is not subject to rigorous assurance! I include HA in this - it is not assured for safety critical applications.

VTherm already has a complex task, let's not ask it to do things which should be handled outside HA.

( In a gas heating system, the gas boiler gets requested for heat. It will not destroy itself even if requested to do so. )

gunmalmg commented 10 months ago

I agree in the principle that critical aspects should be handled by the hardware. So this is not more of a safety function than the existing Safe-Mode handling when loosing the readings from the ordinary temp-sensor. That Safe-Mode is to protect the heating/floor when the temp reading gets uncertain. The wish for a Max-limit is just the same, and could probably use the same existing functionality as the Safe-Mode.

The low-comfort-limit is a comfort request - it is not critical in any way - but would be nice to have. If possible.

"The low-comfort-limit is for floors with tiles upon. The tiles can be experienced as uncomfortable could in the spring/autumn/summer when the floor doesn’t need heat for the room temp. But we would like the floor to keep a minimum temperature. This is spesial relevant in the bathroom on bare foot. And this low-comfort-limit should ideally follow(have different values) the presets Comfort and Eco. (Don’t need a low-comfort-limit for preset Frost)"

jmcollin78 commented 8 months ago

Because it seems there is no consensus on this improvement, I will close it now. It always be possible to re-open it if you have some news.