How do you set Homekit to hold a temperature

I have Aqara sensors and plugs, and their app allow me to make incredibly crude rules of the style “If this sensor OR this sensor notices that the temperature is below X between the hours of Y and Z, turn ON these plugs”

This seemed a bit stupid to me, so I went to the Home app to find the incredible solution Apple must have created instead, but it’s the exact same - except with fewer options!
This isn’t smart home, this is shell scripting!

How can I just set a target temperature in a room and let the system figure it out on its own?
Double point for lowering it to a lower temperature at nighttime.
Triple points for finding out when I’m not likely to be awake or at home in advance and adjusting the temparature… smartly…

I may be revealing my ignorance here, but in most homes I’ve seen this would seem to be the job of a smart thermostat rather than the centralized management tool - mostly because the fluid nature of air makes it super-tricky to control rooms individually with any sort of precision.

Are you talking about using space heaters or zone heating or something instead to try to manage the temperature of individual rooms?

Controlling temperature is a little tricker than that. Let’s assume your heat source is on and currently heating a room. When the room reaches the desired temperature, the heat is turned off. However, the source of the heat is still hot and continues to release heat into the room for some time afterward resulting in the target temperature being overshot by multiple degrees. Same thing happens on the other half of the cycle. When the room hits the minimum temperature, the heat source is turned on. However, it takes time for the heater to warm up and during that time the temperature of the room continues to fall below an acceptable level by multiple degrees.

To avoid that, the temperature controller needs to turn off the heat early and turn it back on early. However, the rate of temperature change is not constant. On cooler days the rate of change when the temperate is dropping will be faster, but it will be slower when warming up. The inverse is true for warmer days. So timing the on/off just right is a very complicated calculation.

Something like a proportional–integral–derivative controller could be used to calculate the correct on/off time for that specific cycle given the various variables. However, as I understand it, most commercially available thermostats use some variation on that which is more purpose built. And we haven’t even gotten to the “learning thermostats” yet.

“But I watched my house thermostat and I don’t see that behavior” you say. Probably not. The issue of overshooting is less likely with the more common forced air systems as there is no heat source in the room (compared to hydronic baseboard and/or radiators for example). Also, most electronic thermostats actually fudge the numbers they display to hide what’s going on. In fact, the commercial models installed by HVAC installers (not the models you can buy at the home center) can even be tweaked by the installer to custom fit the room/customer. For example, if Gramma’s old mechanical thermostat had wandered off by 10 degrees, they will adjust the new one to display the temperature 10 degrees off and then Gramma will think the system is working correctly. If they don’t, she will be convinced they ripped her off.

Given the above, HomeKit will only pass a target temperature on to a thermostat, and then let the thermostat concern itself with turning the heat on/off. That is out-of-scope for HomeKit to manage itself.


We don’t really have centralised heating here. It’s all individual heaters.

I have solved this problem with Home Assistant’s Generic Thermostat which allowed me to pair a temperature sensor and a smart plug and expose this as a thermostat to HomeKit.


Too bad there’s no simpler way, but that’ll work. I’ll have to set up Home Assistant, but I should have done that a long time ago anyway :slight_smile:

1 Like

It sounds complex, but I did originally do this with Home Assistant Supervised, as I didn’t want to dedicate a whole device to what was essentially linking two temperature sensors with smart plugs. Now I’ve got a dedicated device and a large chunk of my home automations are run through Home Assistant, so it’s a good rabbit hole if you want to try it and/or find HomeKit limiting!