Jump to content

Two way Network module


mitch236

Recommended Posts

  • 3 weeks later...
Posted

I have a negative feature request. If two-way Network Module is implemented, I would prefer if the Network Module conditions for programs were only evaluated in the IF statement of a program if some other condition, such as schedule or an Insteon command, kicked-off the program. In other words, I would not want to have the ISY frequently polling a connection setup in the Network Module to check the status of the returned information in order to trigger programs based on the result. Instead, let a schedule or some other condition trigger the program, and simply have the Network Module call the connection and retrive the value for evaluation of the IF statement at that time.

 

This will be a difference from the regular operation of programs that will have to be explained, in that currently all conditions in the IF statement can trigger a program.

Posted

Hi kingwr,

 

I think I agree but I just want to make sure I understood your request. In short, I do not envision program evaluation would cause the network resource to poll the status of the connection. I am thinking that there would be two types of resources:

1. Synchronous ... in which case, a polling interval is used for ISY to keep polling the resource for the status and then evaluate programs for which the status is a condition

2. Asynchronous/realtime ... in the case, ISY will act as an endpoint for other network appliances to publish events to. In this case, the programs are evaluated as soon as events arrive

 

With kind regards,

Michel

Posted

Actually, that is not exactly what I was thinking.

 

Number 1 sounds good in that it is an option in setting up the resource, therefore for those that didn't want periodic polling, you could turn it off.

 

Number 2 also sounds redundant of some other interfaces, such as REST.

 

IMHO, another option would be to have the network resource accessed only when a program containing the network resource in the IF statement was triggered. For example, if I had a program such as:

 

If
       On Sat, Mon, Wed
       Time is  5:00:00AM   
   And Resource 'Rain Monitor" < 1.0

Then

 

then the Resource 'Rain monitor' would be accessed and checked only when the program was triggered by the other conditions, i.e. On Time is in this case. That way, the ISY wouldn't have to poll or synchronize with the network resource until the value was actually needed. This would also allow programmers to basically schedule the "polling" of the resource through program conditions, if they wanted.

 

In order to implement your option 2 above with this solution, the module providing the network resource could trigger a program on the ISY via REST, for example, whenever an external value changes. The program would then evaluate the external values through an associated network resource and take action accordingly.

Posted

How about this?

 

If
       On Sat, Mon, Wed
       Time is  5:00:00AM   

Then

      Poll Resource 'Rain Monitor

 

Then you could write another program to use the info obtained in the previous program:

 

If
       On Sat, Mon, Wed
       Time is  5:01:00AM   
 AND  "Resource 'Rain Monitor" < 1.0

Then

Posted

But if the polling (or accessing) of the network resource is only done when a program specifies that it be done, then why implement it such that it needs two programs? Why not just have the polling performed when the ISY encounters the network resource in an IF statement for a program that has been triggered by other conditions?

 

Each network resource could be synchronous or asynchronous. Synchronous would be Michel's #1 example, and the polling would be performed based on a schedule defined with the network resource. Everytime the value supplied by the network resource changed, programs with the network resource in the IF statement would be triggered.

 

Asynchronous network resources would never be polled by the ISY, but would be accessed when a program is triggered that contains the network resource in the IF statement.

 

Mitch's suggestion does alleviate the problem of having to exaplain two different types of network resources and how they affect and effect the triggering of programs. However, it is just another example of how having trigger conditions for programs and IF evaluation conditions being specified together makes the programming model convoluted, requiring multiple programs to do simple tasks, making ELSE statements useless, and confusing users to how the whole thing works.

Posted

Hi kingwr,

 

The reason we have a module (with polling interval) is that sometimes resources do not respond. This will have adverse effect on the performance of the programs being evaluated. i.e. if a program has to call an HTTPS resource, wait for response, parse the response and then evaluate the program then that would not be very efficient.

 

I would like to continue having program execution as event driven as possible without any lags.

 

With kind regards,

Michel

Archived

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

×
×
  • Create New...