SBlight Posted August 7, 2020 Share Posted August 7, 2020 I not sure how to code the above "if", I have not problem with the action Link to comment
larryllix Posted August 7, 2020 Share Posted August 7, 2020 1 hour ago, SBlight said: I not sure how to code the above "if", I have not problem with the action Two programs using a State variable. State variables can cause programs to trigger when they change value. First program to sync your state variable with one of the device values. If weather temperature < 99999 Then $sVariable = weather temperature Else ----- Second program compares the two values If furnace temperature > $sVariable Then do whatever you want here Else ------ Link to comment
jec6613 Posted August 7, 2020 Share Posted August 7, 2020 3 minutes ago, larryllix said: Two programs using a State variable. State variables can cause programs to trigger when they change value. First program to sync your state variable with one of the device values. If weather temperature < 99999 Then $sVariable = weather temperature Else ----- Second program compares the two values If furnace temperature > $sVariable Then do whatever you want here Else ------ I perfer a temperature != $variable to a less than, but it gets to the same place. It means the variable isn't constantly stored to the same value if the temperature didn't change, so last updated time becomes meaningful for other uses. Link to comment
larryllix Posted August 7, 2020 Share Posted August 7, 2020 1 minute ago, jec6613 said: I perfer a temperature != $variable to a less than, but it gets to the same place. It means the variable isn't constantly stored to the same value if the temperature didn't change, so last updated time becomes meaningful for other uses. Values of device fields and variables do not trigger programs unless they change. The variable will never be written to (program will not run) unless the value changes anyway. However that method may work better for a power up situation. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.