Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How would you program if 'weather' Temperature < 'furnace' temperature then do something

Featured Replies

Posted

I not sure how to code the above "if", I have not problem with the action

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
    ------

Edited by larryllix

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.

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.

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.