Jump to content

Programming in response to communication errors


porscheguy

Recommended Posts

Posted

Not sure how to do this, but I started this topic some time ago and Michel promised something would be done about it. I've just upgraded to 3.1.17 and wonder if anyone can tell me if it is now possible to respond to an error such as -2 as I had requested?

 

Briefly - this means a command was sent to a device and no confirmation was received (or something along those lines). For me that means something I wanted to happen didn't. So I would like - in program mode - to sense such an error and launch a routine to try to remedy it. For example if a pump is supposed to turn off and a -2 error is received, a routine would be called which could wait 10 seconds and try to turn the pump off again. If the error occurred again, the process could be continued in a loop for a fixed number of times (e.g. 5 times) after which an email notice could be sent alerting me to the failure.

 

Thanks for any update on this -

Posted

Porscheguy,

 

This isn't exactly what you were looking for, but it may suffice in the interim.

 

The following appears to work when I tested with a disconnected KPL. It's an example of how we are not supposed to program - a "then" section that modifies the "If" conditions.

 

Note that you must use a device direct command in the then section. A scene will not work since the ISY will not request an acknowledge for a scene.

 

I used a short wait for test purposes. I would suggest using something a bit longer (30 seconds?) to allow any spurious noise (that may be affecting communication) to subside.

 

If

From 10:02:00PM

To 11:59:00PM (same day)

And Status '2nd Floor / Master Table KPL A - Light' is Off

And $iCount < 3

 

Then

Set '2nd Floor / Master Table KPL A - Light' On

Wait 10 seconds (if the on command succeeds, the program will re-evaluate during the wait and exit)

$iCount += 1 (if the on command fails, the program will increment the counter and call itself )

Run Program 'Test' (If)

 

Else

$iCount = 0

 

Edit (additional notes): The variable is an integer type - it will not cause a trigger or event when it changes. Do not use a state variable as it will re-trigger the program each time it is incremented.

 

Questions:

1) What devices are you having communication errors with (PLM Model/version, Insteon Model/version)?

2) Does the device controlling the pump actually turn off/on when commanded? Said differently, does the device respond to the command, but fail to communicate back to the ISY?

 

Why do I ask the above - If you understand why the remote device is failing to communicate back to the ISY (spurious noise, etc) retries may be valid. If the problem is due to longer noise periods (TV's, refrigerators, well pumps, etc) a different approach is required. By changing the retry wait period in the above, you may be able to "bracket" the duration of the problem communication period.

 

If the remote device is responding (on/off) but failing to communicate back to the ISY, there may be other workarounds.

Posted

Thanks for your reply, and I will try out your suggestion when I get a chance. But here is a response to your questions:

 

1) PLM 2412S, V2.9 Rev 3.1; As far as controlled devices having occasional problems, EZIO40V00, and 2476S SwitchLinc Relay V00, 2476D SwitchLinc Dimmer V00 (all version numbers except the PLM are what my admin window tells me).

2) In the cases of interest, the device actually does not do what it is supposed to do, e.g. a light is supposed to go off and doesn't.

 

Why the commands fail I do not know of course. The signal strength seems to be good; repeated comands from the admin window almost always work, the device responds properly to scheduled program commands on a daily basis for weeks or even months without error, but occasionally fails, and that is why I want to be notified. Sometimes the command fails at a time of extreme "quietness," e.g. early in the morning when no TVs, CFLs or other RF or unusual activity should be possibly interfering with the signals. If it happened a lot it would drive me crazy and I would trash the system. Maybe it is one of those rare neutrino collisions, maybe a cosmic ray, whatever.

 

I just want the system to be reliable and I don't spend my free time studying the idiosyncracies of this system (and there are lots of them!). Now that I have installed 3.1.17 and have variables to play with, I will slowly try your idea and get back with you on this.

 

I will mention that I did, on my own (or maybe as a result of perusing the forum), find a solution of sorts that has been a work around for some time, but I raised this issue again just to see if there is a new, better way. What I did is as follows in pseudocode (I don't know how to copy my code like you did):

 

Program TurnOffValve:

 

If Status Valve Is On

 

Then Set Valve Off;

Wait 5 Seconds;

Run Program CheckValveIsOff (If)

Wait 5 Seconds;

Run CheckValveIsOffOrAlert (If)

 

Else

(Nothing)

 

Program CheckValveIsOff:

 

If Status Valve Is On

 

Then

Set Valve Off;

 

Else

Stop Program TurnOffValve

 

 

Program CheckValveIsOffOrAlert:

 

If Status Valve Is On

 

Then

Send Notification To 'Me' content 'Valve is not off'

 

Else

(Nothing)

 

 

The key here is the ability to terminate a program mid-stream by use of the Stop Program command. This has worked pretty well, and since the event happens rarely, I'm not bothered too much (only once in maybe six months on a critical valve, I haven't used this on lights yet). Obviously I can repeat the Wait X seconds and Check many times before sending an alert and hopefully the valve will eventually be shut off without bothering me. But if I am in some remote location when it happens, I can log in remotely and take some kind of remedial action.

 

Thanks again -

Posted

Hello porscheguy,

 

Your 2476 devices are showing V00 because you added them manually. At some point you should check them to make sure they are not V35 devices (know to cause problems). You could delete/re-enroll them using the "auto discover" option which will read the version from the device memory - that's just painful.

 

The easy method is to read the device memory directly using the "Show device Links" command and address 0x0000 to 0x0000 as shown below.

 

This is my 2476D - it's showing a firmware revision of 27 ( the 27.00.00 entry) and agrees with what the ISY is listing for the device.

 

 

Aside from the above, I don't have much in the way of suggestions that you probably haven't heard already. Since your devices aren't responding, I'd try to determine if they were on the opposite phase from the PLM- it might indicate a noise or phase bridging problem.

 

As far as your program is concerned, I'm a firm believer in the "don't fix what isn't broken" theory. Your program is time tested - mine is not.

 

After seeing your program, it occurred to me that I was forcing the use of a variable where one wasn't needed. Your program could actually be made simpler than what I offered. Just in case you're curious - remembering that your program is already working (although it may not be working the way you thought it was).

 

Your program

Program TurnOffValve:

 

If Status Valve Is On

 

Then Set Valve Off; (note: If this command is successful, the program will re-evaluate and exit)

Wait 5 Seconds; (commands are only executed if the "valve off" command is unsuccessful)

 

Run Program CheckValveIsOff (If) (if the CheckValveIsOff program succeeds in turning the valve on, this program will re-evaluate and exit)

Wait 5 Seconds; (I believe this wait command is running in parallel with the "CheckValveIsOff" program - If you make this too short, you will call the CheckValveIsOffOrAlert prior to the CheckValveIsOff program completing)

Run CheckValveIsOffOrAlert (If)

 

Else

(Nothing)

 

Your program condensed

If

From 10:02:00AM

To 11:59:00PM (same day)

And Status 'Valve' is On

Then

Repeat 3 times

Set 'Valve' Off (if this command is successful, the program re-evaluates and exits)

Wait 5 seconds (if the ON command is unsuccessful, the program continues looping)

Repeat 1 times

Send Notification To 'Me' content 'Valve is not off'

Else

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

 

Last - to copy a program, right click on the program name (in the program tree) and select "copy to clipboard" from the popup menu.

post-202-140474155608_thumb.jpg

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.


×
×
  • Create New...