Jump to content

Program Assistance


Go to solution Solved by EWhite,

Recommended Posts

I use the following program to send me NOAA Weather alerts. It works as intended. However, the program repeats the Then commands every time the NOAA Plug-in Polls NOAA if the alert hasn't changed.

Is there something I can change in my program to eliminate repeating the 'The" commands?

Thank you!

 

If
        'Plug-Ins / NOAA Weather' Alert is Blizzard Warning
 
Then
        Set 'Plug-Ins / Notification Controller / UD Mobile' Send Message Sound 'Small Resonant Alarm' Content 96 Notification ID (ID=96)
        $Blizzard_Warning  = 1
 
Else
        $Blizzard_Warning  = 0
 

Link to comment

Edit.. Forgot about the else, I think my suggestion will also toggle back and forth

 

I would try adding/testing to the if:

And
        $Blizzard_warning not equal 1

I'm assuming that it stays 1 during the blizzard and doesn't toggle back and forth

 

Edited by paulbates
forgot about the else
Link to comment
2 minutes ago, paulbates said:

I would try adding/testing to the if:

And
        $Blizzard_warning not equal 1

I'm assuming that it stays 1 during the blizzard and doesn't toggle back and forth

 

The variable does stay at 1 as long as NOAA has a Blizzard Warning alert. It does not toggle back and forth. 

If I add  $Blizzard_warning not equal 1 as you suggest, how does that stop the program from running the "Then" portion of the program?

To add more information. We went from a Winter Storm Warning to a Blizzard Warning and my Winter Storm notification is triggering. It appears that even though the alert changed the old alert is still there.

Link to comment
  • Solution

just have the "then" set the variable.. then add another program triggered by that variable...easiest fix...

 

If
        'Plug-Ins / NOAA Weather' Alert is Blizzard Warning
 
Then
        $Blizzard_Warning  = 1
 
Else
        $Blizzard_Warning  = 0



If
        $Blizzard_Warning  = 1
 
Then
        Set 'Plug-Ins / Notification Controller / UD Mobile' Send Message Sound 'Small Resonant Alarm' Content 96 Notification ID (ID=96)
        
 

        

 

Link to comment
17 hours ago, EWhite said:

just have the "then" set the variable.. then add another program triggered by that variable...easiest fix...

 

If
        'Plug-Ins / NOAA Weather' Alert is Blizzard Warning
 
Then
        $Blizzard_Warning  = 1
 
Else
        $Blizzard_Warning  = 0



If
        $Blizzard_Warning  = 1
 
Then
        Set 'Plug-Ins / Notification Controller / UD Mobile' Send Message Sound 'Small Resonant Alarm' Content 96 Notification ID (ID=96)
        
 

        

 

Thank you, @EWhite! This solved my issue.

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...