How to write a reliable thermostat function ?

Moderator: Telldus

Post Reply
torgrimg
Posts: 6
Joined: Fri Mar 17, 2023 9:45 am

How to write a reliable thermostat function ?

Post by torgrimg »

I have been studying the guides for temperature control.

To make a thermostat I need one virtual device to turn the function on/off, and at least 4 events:
- Turn heater on when temp falls
- Turn heater off when temp rises
- Turn heater on when function is activated and temp *is* below
- Turn heater off when function is deactivated

But as the event system only triggers on the temp *passing* the threshold, this can't be trusted.
If the server is not online when the event occurs, the heater will not be activated or stay activated - I have seen both.

For increased safety I have added another event to turn the heater on if the temperature falls even lower.
And as I saw this morning, I also should have added another event to turn the heater off when the temp rises too high.
Taking this even further, I could end up adding a lot of events just to make sure.

I am quite surprised that a reliable thermostat function is not a basic element...
arneolav
Posts: 281
Joined: Fri Mar 17, 2023 9:45 am

Re: How to write a reliable thermostat function ?

Post by arneolav »

To solve this problem I have created an 10 minute event, an event that fire evry ten minute.
Testing on this event and if temp is under/over works great.
kfenech
Posts: 2
Joined: Fri Mar 17, 2023 9:45 am

Re: How to write a reliable thermostat function ?

Post by kfenech »

Hi
arneolav wrote:To solve this problem I have created an 10 minute event, an event that fire evry ten minute.
Testing on this event and if temp is under/over works great.
Hi aneolav,
Can you please explain in more detail how you achieved this? Trigger events doesnt have option to fire every 10mins as i believe that is achieved by Scheduler which however doesnt have conditions such as temperature?
Zeta_R
Posts: 104
Joined: Fri Mar 17, 2023 9:45 am

Re: How to write a reliable thermostat function ?

Post by Zeta_R »

I am also curious about how you set this up. I have tried to make something similar and I have figured out if I use a dummy device with delayed "on" (or "off"),
I only need 2 profiles to make it work. I use temp over/under as trigger + status on dummy device and also several time triggers (if I have power loss or my internett connection fails, the loop gets started again quickly). Haven't fully tested yet, but I think this will work..
arneolav
Posts: 281
Joined: Fri Mar 17, 2023 9:45 am

Re: How to write a reliable thermostat function ?

Post by arneolav »

TelldusLive:
Select Devices.
Create a "DummyDevice", Give it a name, I call mine "000-MainTrigger". "000" is just to it get it first in devicelist.
Select a devicetype, I use a Nexa On/Off, but this is not important.


Go to Trigger events:
Create a trigger, give it a name, I call mine "MainTrigger".
Under "Trigger", select from ToolBox, 6 clock's.
Set time like "Any" and minutes like this:
"Any" and 00
"Any" and 10
"Any" and 20
"Any" and 30
"Any" and 40
"Any" and 50

In "Action" select the dummy device (MainTrigger)

Triggers you want to fire every 10' minuten test on Maintrigger.

Thats all.
kfenech
Posts: 2
Joined: Fri Mar 17, 2023 9:45 am

Re: How to write a reliable thermostat function ?

Post by kfenech »

Thanks both for the reply. From my experience I see that if there is a powercut or internet connection is down, one would need to switch on/off again the devices for them to "re-sync" with the server, so my inclination would be to do a perform a on/off schedule every-now and then. I performed the dummy device workaround and see how it goes and test it thoroughly.


thanks alot :D
Post Reply