I am using a SynchroLinc to detect when my sump pump comes on in the basement. Ideally I would like to have one notification when it is triggered and then an additional if it is running for more than 2 minutes, which would indicate that it isn't keeping up and may need some additional attention.
I am having trouble with the following program sending 2 notifications for every time that it is triggered. When we are getting heavy rainfall this can fill up my inbox quickly.
I only get the 'Sump Pump Running' emails currently. I believe the logic in the Monitor program isn't working as I understand it, and the THEN condition is evaluated even if the original condition isn't true after 2 minutes.
Details below and please offer any suggestions as well. I would like to build upon this in the future once I get the kinks worked out.
Variable:
iSumpRunningDuration: init 0
======================================================
Sump Monitor Program:
If
$iSumpRunningDuration > 0
Then
Repeat Every 2 minutes
$iSumpRunningDuration += 2
Send Notification to 'Family' content 'Sump Pump Running'
Else
Send Notification to 'Family' content 'Sump Pump Status Change'
========================================================
Sump On Program:
If
Status 'Power' is 100%
Then
$iSumpRunningDuration = 1
Send Notification to 'Family' content 'Sump Pump Running'
Else
$iSumpRunningDuration = 0
========================================================
Sump Reset Program
If
Status 'Power' is Off
Then
$iSumpRunningDuration = 0
Else
- No Actions - (To add one, press 'Action')