Back in the good old days I could do this with manual programming in webCORE.
Is there any way to do this in the new SmartThings architecture?
I want a window fan (outlet) to only come on if one sensor’s temperature is higher than another sensor’s temperature. All I can see now is comparing one sensor’s temp to a specific value.
Hmm, so that could be promising… eventually? But I wonder is there anything I can do that would work today. Even if it makes use of a legacy system that will be going away eventually. webCORE is no more, right?
As far as I know webCore still works, but it days are numbered. They have not said when it will be shut down. I would guess before the end of 2022, but I could be wrong.
From what I can see about the “Rules API”, it is a far lower-level language that what we’ve been accustomed to with webCoRE. Something that used to take a few lines of Groovy code now take pages of Rules API code. It’s not a practical replacement for the same niche. I’m not looking to be a commercial ST app developer… I just want a bit more flexibility than the incredible over-simplified options in the Android Automations UI.
Is there anything in-between? Groovy even made sense for non-programmers (although I have a programming background, I have no interest in maintaining 3 pages of code to toggle a fan on/off). I don’t mind changing gears, but there’s a difference between “sorry your old cell phone doesn’t work, here’s the new phone you need to buy” and “sorry your old cell phone doesn’t work, here’s a slab of silicon and a book on how to make ICs.”
As a Rule you could compare the temperature from two devices and switch another device on as the result in one line of text if you really want to. I’d probably use twenty-six because I like it that way. A fairer comparison with webCoRE would be twenty. It is logically at the same level, and the webCoRE piston language is just a front end presentation like Routines are. We haven’t seen the rules creator yet.
I am not proficient at lower level programming. BTW Webcore is a “code generator” that’s why we like it.
Most times my questions get an answer that tells me what to do not how to do it. How would I approach this with a rules generator.
My
if (TEMP1 > TEMP2) then: turn on FAN1;
if (TEMP1 < TEMP2) then: turn off FAN1;
would bring cool air in to my root cellar to cool it off.
I got distracted with another meeting before I could finish posting this reply, but it looks like @h0ckeysk8er has you taken care of. I’m posting it anyway as there’s some other tidbits in there that might be helpful to you…
You would need to copy the sensor values into a variable. You can do this one of two ways.
Create a separate rule with a trigger for the value changing and in your flow use the Set Variable block along with the Context Variable for the event value (eg. $context.event.value)
Note that depending on what your trigger(s) are, you might be able to use Context Variables in the second approach too, but if the rule is triggered based on either of the variables changing, sometimes it’s easier to just snapshot a device’s value to a variable anyway.
Also note that in the IF Condition the left side of the comparison can contain a device value directly so you may only need to snapshot one of the values into a variable as shown in the screenshot.