Why do this?
- Fun, and interest, as always
- Comfort - air-con controls are annoying, they allow temperature to be out by well over 1℃ and I notice that.
- They are also crap at an "auto" mode and don't change from heat to cool sensibly (e.g. can be 2 or 3℃ out before they do it), hence I have to change manually in spring/autumn during the day.
- Saving money by better controlling when they are on and off as part of home automation.
±0.2℃ of target. (Red line is measured temperature) Mostly ±0.1℃. Measured using a device with only 0.1℃ precision.
Basic logic is checking the settings and info from the air-con every minute using http, and collecting temperature from a separate thermometer via SNMP. This is place by the bed (i.e. where I want the temperature set).
The basic algorithm involves having an offset from the target temperature, and sending that to the air-con as its target.
Initially, and after any change of mode or fan rate control or my target temperature I allow 15 minutes for that to settle and then start collecting measured temperature. Once I have 10 minutes of data I consider changes to the offset. I collect up to an hour to track a moving average.
If the data shows a minimum above the target or a maximum below it, i.e. "way out" I make a step change in the offset to bring that in line, and flush the data and wait 15 minutes to settle again.
If the min/max cover the target, then I adjust the offset by a small amount (0.01℃) based on the average being higher/lower than target.
This all keeps the temperature averaged at the target and allows for any temperature difference from air-con unit to where I am measuring. Normally this is very low (with windows closed), e.g. well under 1℃. However, with a window ajar to allow fresh air this an be several degrees (I now have a nice heat exchange fan in the room instead, so windows closed).
HysteresisUnfortunately the air-con is not quite as good as I would like. It does lower power as it gets closer to the target, which is good, but ultimately when the temperature drops passed the target it will engage the fan and compressor and push the temperature 2℃ beyond the target and then allow it to settle. This cycle can mean a compressor on for maybe 5 to 10 minutes and repeat every hour.
What I have done now is recognise when it is doing this and kill the compressor. Once the compressor is on and the temperature crosses back past the target I turn it off by setting a target 3℃ before the target. This means we "overshoot" by only 0.1℃ to 0.2℃ if at all.
The result is the compressor on for up to a minute maybe every few minutes (depending on how har it is having to work to maintain temperature). I don't know if this change in duty cycle is detrimental or not. It probably means less usage overall as we are not overshooting the target temperature by 2℃.
NoiseOne concern was noise, but even in night mode I can hear a ticking clock over the fan - the compressor and fan going on/off happens anyway, just more often now. Works well.
Other bitsIf the offset to be applied is getting too high and not working, we switch from quiet mode to normal auto fan mode as clearly it needs more oomph.
If the offset to be applied is getting too low and not working, we switch between heating and cooling.