Jump to content

Comparing temperature from two different devices


Go to solution Solved by paulbates,

Recommended Posts

Posted

Happy New Year!

I want to turn on my wine cellar's air circulation based on the difference in temperature. Outside temp comes from my WestherLink station (Bob's plug-in) and the cellar temp from a Tasmota device

If outsideT < cellarT:

   Turn ON fan...

Seemingly simple, I haven't figured out how to do that comparison inside IoX...

Any ideas on how to accomplish this?

Thanks!

  • Solution
Posted (edited)

You can do it by storing one of the devices temperature's in a state variable in a program:

If

  Device_Node_Temp not equal State_Var_Temp

Then

  State_Var_Temp = Device_Node_Temp

 

The you can create the program to control the wine cellar by comparing the other device node temperature reading with the variable with the temp variable. There's a tiny arrow head at the end of the line when building the if statement next to the device node you've picked... click it and a list of variables will come up. 

It has to be a state variable for the if statement to function

Edited by paulbates
  • Thanks 1
Posted

It's been a while since I did this... one more important thing:

Because the temperatures could change rapidly and randomly, the wine cellar control program will cancel execution the moment that happens.

Unless the wine cellar control program has only a couple statement and no "waits", you'll want it to only call another program with no "if" statement and put the wine cellar action statements there... a program with no "if" won't cancel. 

Maybe it will be ok using only 2 programs, but if you get unexpected results because it looks like the wine cellar control program didn't finish, that's why

Posted
44 minutes ago, paulbates said:

It's been a while since I did this... one more important thing:

Because the temperatures could change rapidly and randomly, the wine cellar control program will cancel execution the moment that happens.

Unless the wine cellar control program has only a couple statement and no "waits", you'll want it to only call another program with no "if" statement and put the wine cellar action statements there... a program with no "if" won't cancel. 

Maybe it will be ok using only 2 programs, but if you get unexpected results because it looks like the wine cellar control program didn't finish, that's why

Thanks Paul,

I was planning on updating State_Var_Temp every 30mins or so in order to take out small fluctuations. Not too worried about micro-controlling the climate. We drink that wine waaaaay to fast for that :-)

And it really has only one command in there which is to turn on the recirc fan, if the outside temp is lower than the cellar temp...

  • Like 2
  • Haha 1
Posted
3 hours ago, TriLife said:

We drink that wine waaaaay to fast for that :-)

I guess it's time to write the chuchaqui program, eh? 🤪😂

Happy new year to you

  • Haha 2
Posted

I always ended up with same technique for these sensing feedback type controls.

First program does a continuous timer cycle with insurances to make sure it always triggers starting on startup and several times per day. Only calls second program.


Second program is disabled and only determines if a long run cycle or short or no cycle is required
For my humidifier the cycle was always 5 minutes shorter than programs 1's cycle time and also checked if it was heating season. ie. 55 minutes run every 1 hour to allow wick to soften more and absorb to the top of wick.

Sent from my SM-G781W using Tapatalk

Guest
This topic is now closed to further replies.

×
×
  • Create New...