Temperature differential rule

I would like to have a rule that will turn on a garage vent fan when garage temperature exceeds outside temperature by a preset temperature (example 4 degrees F). Also, to turn off the garage vent fan when that differential temperature is less than a preset temperature (example 4 degrees F). I will also have an action where vent fan will not run less than a preset garage temperature.
I cannot see any way to make a rule for differential temperature rule. Help out there?

Hi @BK_Lonberger, welcome to SharpTools and the community. This is not currently supported in Rule Engine, but is a good use case for variable feature that is in our list. Iā€™ve noted your use case to make sure this will be covered in the design. Thanks for your feedback.

James
Thanks for the feedback. Adding this variable feature would really boost the uses for SharpTools. Other uses are out there for stuff like whole house vent fans, grow tents, heaters, solar pool pumps etc
How soon until new feature available?
Brian

I agreed this would be a great feature to be added. We donā€™t give an ETA on feature release, and our tasks priority is based on the interests we received from the community, which is exactly what you just did. And variable is indeed pretty high in my list, but can be a pretty complicated one too. :grinning:

1 Like

I used a rule from another source using legacy SmartThings that performed these actions, but SmartThings changed such that it wil no longer work.
I was wondering if you guys ever got around to adding the capability to do these actions

Check out expressions and variables as they likely cover what youā€™re looking for:

You can do this with 2 rules and a variable:

Create a variable, mine is $TemperatureDifferenceAttic

Create a rule that sets the variable:

Then create the rule to turn on the fan:

In my case the temperature must be 100 and the air outside must be at least 5 degrees lower than the attic temperature. You can make it anything you want. You can also have this same rule turn OFF the fan with an ELSE. I do something different with mine.

1 Like

I appreciate the input. But I am 72 years old and donā€™t have the mental capacity anymore to figure out how to accomplish this. So, I will have to give up and find another way to do what I want. Maybe, I will you a stand alone differential temperature controller. Thanks anyway

Hey BK-
Thanks for the reply! Do you already have the devices you are interested in connected to SharpTools?

Iā€™m happy to help walk you through the setupā€¦ and we have awesome community members like @JKB121 who are generously willing to share their experience too!

PS. Iā€™ve also reset your free 14 day trial so you have access to variables so you can try this out.

Gee! That would be great. I do have a SmartThings smart outlet and two SmartThings multipurpose sensors.
But to use variables I would have to get SharpTools Premium which is $30 a year. I was just about to buy a differential temperature controller on line for $50 when I checked back on this topic.

Hereā€™s a brief demo showing one approach. Iā€™m still recovering from bronchitis, so no voiceover on this one, but Iā€™ve included a high level summary below. And since itā€™s a video, donā€™t forget that you can pause it as needed or adjust the playback speed to your preference.

:information_source: Note that in this example, I arbitrarily used the temperature from my Upper Level and Lower Level thermostats as an example.

The upper/lower designation is just which floor each thermostat is on - it doesnā€™t matter which value is the higher or lower value for the variables. More thoughts on that in the Expressions section below. :slight_smile:

  1. [0:00] Starting from the Rule Editor, we open Manage Variables

  2. [0:15] Search the variables for ā€˜temperatureā€™ showing that the variables we want donā€™t exist yet

  3. [0:20] Create three different variables:

    • $temperatureDIFF - this will hold the result of the calculation
    • $temperatureUPPER - holds Upper Thermostat value as input for calculation
    • $temperatureLOWER - holds Lower Thermostat value as input for calculation
  4. [0:50] Make a minor tweak to the Variable search to update the results showing our variables are now created

  5. [1:00] Create a Trigger > Event > Device

  6. Select my two source device that Iā€™ll be comparing temperature on

  7. [1:15] Configure the trigger for anytime the temperature attribute changes (On Transition Only)

  8. [1:30] Under the Flow, create an action for Set Variable for the first source temperature (ā€˜UPPERā€™ in my example)

  9. [2:05] Repeat the same process for the second source temperature (ā€˜LOWERā€™ in my example)

    • I forgot if I was working on Lower or Upper, so had to close out and double check partially through this one. :blush:
  10. [2:40] Create an action for Set Variable which will write to our new $targetDIFF variable, selecting Expression as the source and entering the expression as we see fit.*

  11. [3:15] I show that you can ā€˜Tap to Evaluateā€™ the expression to see the result

    :information_source: Note that in this case, itā€™s using the 0 values that I entered for each variable manually when they were created.

    You will either want to initialize those variables with the current temperatures or make sure one of the temperatures changes so the rule runs at least once.

At this point, you would save the rule and you would have a working temperature temperature differential.

Expressions

Note that in my example, Iā€™m just using a simple temperature1 - temperature2 kind of calculation and I arbitrarily picked which one to use.

If thereā€™s a specific value you prefer as a ā€˜referenceā€™ temperature, you can of course adjust the calculation as you see fit.

Also note that there are other features available in expressions as linked to previously. For example, you might want the absolute value of the difference or something of that nature.

Next Steps

As @JKB121 showed in his reply, your next step would be to use that temperature differential as you see fit.

Youā€™ll have the temperature difference available in the variable $temperatureDIFF to use anywhere you want. For example, you might create a separate rule that anytime the temperatureDIFF variable updates, you check it for certain conditions and run actions as you see fit.

Note that you can nest conditions if needed or run conditions one after another where appropriate.

Thanks to all. I solved it. Not exactly what I wanted originally, but I was over engineering it. A fault I acquired from my career in nuclear power. Thank you @JKB121. I used your setting up for rule and device triggering and variables, etc. I did not need the temperature differential. I just went to a simpler: if outside temperature is greater than garage temperature then turn off garage fan and if outside temperature is less than garage temperature then turn on fan. I only use in summer and do not need to worry about other parameters.
This platform is great!

1 Like

You are most welcome!

If you want to add summer to your automation, you can add Months to turn ON. I use this rule for summer Pool OFF.

1 Like

Again thanks. How and where would I add this and how would it override the temperature commands? Also, if I just want to add an ā€œonā€ and ā€œoffā€ for the process/rule?

1st, create a variable to store the ā€œMONTHā€ (mine is Update, but yours would be ā€œcreateā€)


Call it Month. (you can leave value blank-it will populate)

2nd, make a rule to set the ā€œMONTHā€

3rd, modify the rule you made to turn on the fan by adding another IF which would be before your current IF that lists each Month you want the fan to come on. In my pool example, I turn the pool OFF at 8:00 PM in June, July, and August. Remember to change the AND to OR or it will NEVER turn on because it is impossible to be all 3 at the same time. :wink:
In my pool example, the second IF is where your current IF is. (Mine is a virtual switch and the pool controller)

Followed by your ACTION, I presume TURN ON FAN.

Let me know if I havenā€™t confused you enough!!! :upside_down_face:

To answer your other question about over-riding the temperature, Iā€™m not certain what you mean. This will ONLY turn on the fan during the months you select. By way of example, I have another rule that turns the pool OFF at 7:00 PM, but only in April, May, September, and October. It doesnt do anything in January, February, etc, Get it?

1 Like