How to control my Hive thermostat with one routine?

Hi all,

I’m trying to create one routine to turn on/off my central heating if the temperature is within or outside a set temperature range. I’m using a Tapo temperature sensor and the Hive thermostat,

I’ve got an if condition, temp range between A-B then set thermostat to heating or a higher temp so the heating comes on. I assumed that if the temperature fell outside the range the heating would automatically turn off but seems not. Can this be done with one routine? Seems like it needs something like
If {temp in range} A-B {
Thermostat setting to heat
}
Else {
Thermostat setting to off
}

I can see it thinking about it in a scripting/programming sort of way but can’t work it out via the simple app! Thanks for the help. I’ve previously been doing it with two routines one for the lower temp limit and one upper and it does work but would be cleaner with one.

Thanks for the help

There is no else condition in ST Routines. You would need an additional Routine to turn off the heat when it is below the lower threshhold of your range.

If your Hive thermostat isn’t connected locally to a hub and uses the cloud->cloud integration, you might consider using a 3rd party rules engine like sharptools.io since your ST Routines are running in the cloud already. Here is an example:

1 Like

Thank you for the tip, I’ve not come across this before. I have got sharp tools now and trying to figuring out how it works and if I can do this in free version.

You should be able to do this in the free tier since you won’t need variables, for-fee notifications, etc.

A little confused by the requirement. Firstly surely the hive thermostat reads the ambient temperature. And it also, turns the heating on and off based on the set temperature. Why is there a need to introduce another sensor to do this. If it is the temperature from a different room, can you not move the hive thermostat, is it not wireless ?

Secondly, why would you put a lower range on the temperature to start heating? Surely the colder it is the greater the need for heat?

The Hive thermostat is jittery I find when the temperature drops to the set point. Then it will do multiple cycles of on/off for a few mins at a time. I don’t like that it’s short cycling the boiler like this and with the Tapo sensors I can tell it to raise the temp 0.5C or whatever once it comes down to the set temp and it creates more of a hysteris loop? Also I can choose which room I want to use for reference but this is less important to me. If it didn’t do this I would just use the thermostat

Ok,
But it sounds like the Hive thermostat isnt doing the job right then, maybe it’s faulty? Any chance of a warranty swap under guarantee?
If its a hive wireless thermostat I think moving it to a different reference room should be easy?

As an aside…
I currently have to sonoff zigbee switches which control downstairs and upstairs motorised valves which in turn start boiler and pump.

Upstairs i used simple time scheduled routines.
downstairs I have a “virtual thermostat” created as a child device from one of my sonoff zigbee temp sensors.
I can set a set temp on it and the virtual thermostat changes state from heating to pending heat.
I have two time windowed routines that fire on “heating” and “pending heat” to turn boiler off.
Ive been doing this for about a month now and so far not seeing any short cycling, boiler is typically off for periods of 30 mins to 90 mins.

It could be a position issue or that the thermostat uses TPI:

If the temperature slowly comes down but then starts to level off I could imagine the thermostat may switch on for short periods but off again very quickly because its predicting the set temp will be reached very soon rather than waiting until it is physically reached. Ironically they seem to say it’s supposed to stop the boiler cycling but has the opposite effect in my hands and doubt it saves energy as it’s not efficient to keep purging and firing the boiler. Anyway this is probably going a bit off topic. I’ll have a play with sharp tools anyway, looks interesting.

What you get from the above approach with a range is, if it’s too cold it stays cold.
What you actually want is two things (two routines),
(1) If temperature below “cold” threshold, turn heater thing on.
(2) If temperature above “warm enough” threshold, turn heater thing off.

Now if the heater thing has its own thermostat and setpoint, you want that setpoint to be well within your “cold-warm” span.

Then if it gets cold, your routine turns the heater on. The heater will run (on its thermostat settings) until heating is no longer needed, like when the outside temperature has increased, sunshine heats the room, etc.

I’m using this with an electrical heater in my house entrance, for freeze prevention. I have a smart wall plug running two routines - the “Low-On” routine at 4°C, and “High-Off” at 8°C, temperature reading coming from a smart thermometer somewhere else in the room (away from the heater). The electrical heater’s own thermostat is set to minimum which makes it aim for slightly above 7°C.
This has been working very well all winter. In a cold night, the “Low-On” routine turns the heater on, then the heater neatly self-manages around 7°C until the morning sun increases the inside temperature a little further and the “High-Off” routine cuts its power. On freezing days, the heater simply stays on.

Sorry yes, my bad on the logic of the routine. I was actually thinking about the range option for turning the heating on while the temp was not likely to drop below the lower range value but yeah it doesn’t really make sense to use that option.
Its possible to achieve this with one sharp tools rule? Something like below?

Assuming this logic should work with one rule, ideally when the thermostat is idle, i.e. it has reached the desired temperature. I’d prefer it to switch to schedule mode. This should need the command setthermostat mode then argument Shedule? There are a lot of arguments in the list which i assume are not all applicable, but Schedule should be… In the smart things app they call it “scheduled” and on the hive thermostat itself its “schedule”, so i assume the specific text doesn’t matter its the same thing.

Not quite … you want the target temperature for the thermostat to be well inbetween your “if” and “else” threshold temperatures. That way the heating unit will engage in a cold room, keep a steady temperature once on, and turn off when the room gets warmer than it should.
Your code would turn the heater on to a high target and turn it back off before it even gets there.

So, in my own example:
if (temperature below 4) turn heater on w/ target temperature 6.5
else if (temperature above 8) turn heater off

Hi, thanks. It’s actually working ok. The setpoints I’ve set for the thermostat are just to trigger the boiler to come on and I have a Tapo sensor that is being referenced for when the thermostat should come on i.e. 11C and then when to go off, 11.5C. I wasn’t sure how to make the boiler come on other than set it to some elevated temperature hence the 15C setpoint. Maybe there is just an ‘on’ function but I know this is not how a thermostat is supposed to work. So it probably seems like a weird thing to do but the code is working