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.

Preserve state variable value after power failure

Featured Replies

Posted

I have a motion sensor that detects the presence of my car in the garage.  The presence or absence (1 or 0) is saves in a state variable, $caringarage.  When there is a power failure or any event that causes the Polisy to re-initialize, $caringarage is reset to 0.  The ISY manual shows a way to preserve the state variable value, but the syntax is confusing.  Any suggestions/examples?

There is a way. Right after you set the variable, put an 'init to' as the next program statement with the same value. It will survive the  reboot.

Here's an example I use to keep data for my sump pump. You' ll always need two variable statements, one to assign the value, and one to tell the isy to remember it even if it reboots.

If
        'TimeData' Day of Month is 1 days
    And Time is 11:59:55PM
 
Then
        $Sump_Pump_Maximum_daily_Gallons  = $Sump_Pump_Gallons_Daily
        $Sump_Pump_Maximum_daily_Gallons Init To $Sump_Pump_Maximum_daily_Gallons

Edited by paulbates

  • Author

Thank you!

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.