Jump to content

passing a node # to another program?


Recommended Posts

Posted

Hi all,

I'm still new here and very much enjoying my time learning how to use my new isy994i.

I'm trying to write a program that will alert me if the back door is open, and continue to alert me every 5 minutes until it's closed.

 

Here's the Door Open Alert:

Quote

Door Open Alert - [ID 001F][Parent 0024]

If
        Status  'Home / Sensors / Back Door / Back Door' is On
     Or Status  'Home / Sensors / Freezer Door / Freezer Door' is On
 
Then
        Send Notification to 'Me' content 'Door Alert Open'
        $Back_Door_Open  = 1
        Run Program 'Repeat Door Open Notification' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 
Comment
 

the program that gets called (Repeat Door Open Notification (If)) is like this:

 

Quote

Repeat Door Open Notification - [ID 0025][Parent 0024]

If
        $Back_Door_Open is 1
 
Then
        Repeat Every  5 minutes 
           Send Notification to 'Me' content 'Door Alert Open'
 
Else
   - No Actions - (To add one, press 'Action')
 

But when the second program runs, the email alert can't decode (?) / interpret (?) the variable.

Quote

Email Template:

${sys.node.#.name} is open
Date: ${sys.date}
Time: ${sys.time12}

Extra Info:
ST: ${sys.node.#.ST}
Raw: ${sys.node.#.ST.raw}
 

the sys.node.#.name just comes in as "node[#]".

so, all this to say... is there a way to catch the node # into a variable so I can use it elsewhere?

Tips welcome!

Posted

so, all this to say... is there a way to catch the node # into a variable so I can use it elsewhere?
Tips welcome!


I don’t believe so. But it’s a GREAT idea! I suspect the ISY would need to support string variables though - and it does not have the ram for that.
Posted

The "${sys.node.#.name} is open" only references the program that called it. In this case "Email Template"

Create a new custom email that specifically references the node, i.e. BACK DOOR OPEN., then call that custom email rather than the node.

Posted

I can do that.  I was hoping to be able to use a single email template for all the alerts (adding a new sensor would just be a matter of adding it to the If clause), but it seems ISY doesn't work that way -- which is fine, just not what i was hoping for.

29 minutes ago, Techman said:

The "${sys.node.#.name} is open" only references the program that called it. In this case "Email Template"

Create a new custom email that specifically references the node, i.e. BACK DOOR OPEN., then call that custom email rather than the node.

 

Posted
5 hours ago, jbrooks said:

I can do that.  I was hoping to be able to use a single email template for all the alerts (adding a new sensor would just be a matter of adding it to the If clause), but it seems ISY doesn't work that way -- which is fine, just not what i was hoping for.

 

Your other option is to place all your code into one program. When the IF statement is FALSE the ELSE statement will run.

If
        Status  'Home / Sensors / Back Door / Back Door' is On
        Or Status  'Home / Sensors / Freezer Door / Freezer Door' is On
 
Then
     Repeat 50 times

    Send Notification to 'Me' content 'Email templete'

     Wait 5 minutes

        
 
Else
   - No Actions - (To add one, press 'Action')

Posted

If I'm understanding the request correctly, I use a single email template for alarm violations and have a separate program for each with a descriptive name.  My email template contains "${sys.program.#.name}", and I call it from programs named something like "Dining Room Door Violated".  I have one of these programs for each zone that I want to monitor independently.

Posted
1 hour ago, rccoleman said:

If I'm understanding the request correctly, I use a single email template for alarm violations and have a separate program for each with a descriptive name.  My email template contains "${sys.program.#.name}", and I call it from programs named something like "Dining Room Door Violated".  I have one of these programs for each zone that I want to monitor independently.

You only need one program for your freezer and back door.  See the attached image to set up your email. The email you receive will show the node that triggered it as well as the node status and  date and time it was triggered.

The <br> is a carriage return

 

Email.thumb.JPG.d4b32bced1d43c8cbf3e6647ec7a2985.JPG 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...