Jump to content

Preserve state variable value after power failure


SHM

Recommended Posts

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?

Posted (edited)

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
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37.5k
    • Total Posts
      375.1k
×
×
  • Create New...