Please login or register.

Login with username, password and session length

Author Topic: How to repeat a command until Status confirms the command was received  (Read 9885 times)

csnet

  • Full Member
  • ***
  • Helpful Post Rating: 10
  • Posts: 26

Looking for suggestions about the best way to do this.

I have a new install of AHP and it has been working flawlessly.  Timers with Smart Macros are turning modules on and off on both AC phases without any couplers or filters.

I would like to purchase a 2 way Rain8 irrigation controller http://www.wgldesigns.com/rain8.html

It is very easy to configure AHP to use a single Macro for all irrigation zones.  Here is an example macro with 1 zone and 3 start times.  Other zones can be inserted in the same macro to irrigate all zones with one or all of these multiple start times:

Irrigate 1 M1 ON
   Turn Valve 1 L1 ON
   Delay 5 Minutes (set watering time for a Zone 1 cycle here)
   Turn Valve 1 L1 OFF
   Delay 55 Minutes
   Turn Valve 1 L1 ON
   Delay 5 Minutes (set watering time for a Zone 1 cycle here)
   Turn Valve 1 L1 OFF
   Delay 55 Minutes
   Turn Valve 1 L1 ON
   Delay 5 Minutes (set watering time for a Zone 1 cycle here)
   Turn Valve 1 L1 OFF

Timers:  (June-August irrigate 4 days a week, May and September 3 days, April and October 2 days)
Macros - Irrigate 1 (M1): at 3:00 AM Sundays, Wednesdays, April 1 to October 31
Macros - Irrigate 1 (M1): at 3:00 AM Fridays, May 1 to September 30
Macros - Irrigate 1 (M1): at 3:00 AM Mondays, June 1 to August 31

While very simple, the above approach depends on 100% X10 signal reliability, tempting Murphy's Law.

I would like to use AHP Smart Macros where checking the Status of a zone will resend the X10 ON and OFF commands to a zone every 2 seconds for about a minute or until the Status confirms the command was received.  Periodically I could check the activity log to see if multiple commands were needed as a heads up that the X10 signal path needs improvement.

Here's what I have come up with conceptually for the 1st of 8 available Rain8 irrigation zones:

"Valve L1" is a 2 way Rain8 irrigation zone (Monitored House Code = 'L')

Flag 2 is used as a "Rain Switch".  Set ON to enable irrigation, OFF to disable irrigation (when it's raining)

Phantom Appliance Modules are shown with the same name of the Macro each triggers

Irrigate 1 3:00 M1 ON
   IF Flag 2 is ON AND Time between 3:00 AM and 3:01 AM AND OFF Valve L1
      Turn Valve 1 L1 ON
      Turn Cycle 1 C1 ON (phantom module)
      Delay 2 Seconds
      Turn Irrigate 1 3:00 M1 ON (phantom module)

Cycle 1 C1 ON
   IF ON Valve L1
      Delay 5 Minutes (set watering time for a Zone 1 cycle here)
      Turn Off 1 M1 OFF (phantom module)

Off 1 M1 OFF
   IF Time between 3:05 AM and 3:08 AM AND ON Valve L1
      Turn Valve 1 L1 OFF
      Delay 2 Seconds
      Turn Off 1 M1 OFF (phantom module)

Timers:  (June-August irrigate 4 days a week, May and September 3 days, April and October 2 days)
Macros - Irrigate 1 (M1): at 3:00 AM Sundays, Wednesdays, April 1 to October 31
Macros - Irrigate 1 (M1): at 3:00 AM Fridays, May 1 to September 30
Macros - Irrigate 1 (M1): at 3:00 AM Mondays, June 1 to August 31

Each irrigation zone would require 3 macros and 3 timers for the 1st start time.
Each irrigation zone would require 2 macros and 3 timers for each additional start time.

Zone 1 Misters - 2 start times = 5 macros and 6 timers
Zone 2 Turf - 3 start times = 7 macros and 9 timers
Zone 3 Turf - 3 start times = 7 macros and 9 timers
Zone 4 Drip - 1 start time = 3 macros and 3 timers

That's a total of 22 macros and 27 timers. 

Will this work?

Is there any Smart Macro equivalent to OR conditions in parenthesis?  For example this would allow one macro to handle 3 start times:

IF Flag 2 is ON AND (Time between 3:00 AM and 3:01 AM OR Time between 4:00 AM and 4:01 AM OR Time between 5:00 AM and 5:01 AM) AND OFF Valve L2

Is there an easier way to do this?

Thank-you for reading all of this  :)

« Last Edit: December 02, 2007, 08:13:58 PM by csnet »
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: How to repeat a command until Status confirms the command was received
« Reply #1 on: December 02, 2007, 09:01:19 PM »

I doubt you'll be able to do that with AHP.  There's no model for the Rain8 and (as far as I know) no option for sending a Status_Request command in a macro.  When AHP sends a signal, the status shown in the icon assumes that the sent signal was correctly received and acted upon by the module.  Exceptions are the LM14A and AM14A 2-way Lamp and Appliance modules respectively - these are configured to automatically return an Extended_Status_Ack message, which is different than the standard Status_Ack returned by the Rain8 in response to a standard Status_Request.

Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

csnet

  • Full Member
  • ***
  • Helpful Post Rating: 10
  • Posts: 26
Re: How to repeat a command until Status confirms the command was received
« Reply #2 on: December 02, 2007, 10:31:42 PM »

Thanks for the reply.  That's a big help.

I did not realize that the Status condition reported only what is assumed based on the last command sent so the "Cycle" macro would only fire once regardless.  I suppose the Status condition is still useful in a 100% reliable X10 environment.  :)

Is this then a limitation of the CM15A as well as AHP? 

I would like the irrigation schedule to happen with the PC off.  Rain8's software requires a running PC.  I noticed that the .ahx file is an early version of an XML file, so I could read that information for non-irrigation commands to a home-built irrigation application and then supplement those with the irrigation schedule and upload it to the CM15A if there any way to program the CM15A directly.  I would be sure that AHP would only "see" the non irrigation version of the .ahx file to load. 

Is it possible to have the CM15A do more than what AHP allows when all PCs are off?

Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: How to repeat a command until Status confirms the command was received
« Reply #3 on: December 03, 2007, 12:09:43 AM »

Thanks for the reply.  That's a big help.

I did not realize that the Status condition reported only what is assumed based on the last command sent so the "Cycle" macro would only fire once regardless.  I suppose the Status condition is still useful in a 100% reliable X10 environment.  :)

Is this then a limitation of the CM15A as well as AHP? 

I would like the irrigation schedule to happen with the PC off.  Rain8's software requires a running PC.  I noticed that the .ahx file is an early version of an XML file, so I could read that information for non-irrigation commands to a home-built irrigation application and then supplement those with the irrigation schedule and upload it to the CM15A if there any way to program the CM15A directly.  I would be sure that AHP would only "see" the non irrigation version of the .ahx file to load. 

Is it possible to have the CM15A do more than what AHP allows when all PCs are off?



Several years ago I hacked  a downloaded macro to see which of the 16 standard X10 functions were supported  in the CM15A.   Status_Request was not one of them although Status_On and Status_Off were, as I recall.  I reported this to the X-10 CM15A project engineer at the time but have no idea whether any applicable changes were made in the CM15A firmware since then.

Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

csnet

  • Full Member
  • ***
  • Helpful Post Rating: 10
  • Posts: 26
Re: How to repeat a command until Status confirms the command was received
« Reply #4 on: December 03, 2007, 03:03:10 AM »

Thanks again.  I have written to Rain8 to see if they have tested any other device that would run with the PC turned off that allows PC programming of multiple start time and date sensitive irrigation schedules like Active Home Professional AND would allow polling the Rain8 for it's true status on any zone
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to repeat a command until Status confirms the command was received
« Reply #5 on: December 03, 2007, 10:12:47 AM »

A Rube Goldberg approach would be to set up sensors to detect "rain". I don't know how practical this would be but if implemented, it could serve to provide input to prevent watering in the rain, also.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

csnet

  • Full Member
  • ***
  • Helpful Post Rating: 10
  • Posts: 26
Re: How to repeat a command until Status confirms the command was received
« Reply #6 on: December 03, 2007, 12:44:38 PM »

Thanks for the suggestion, I may not need to go that route as I heard back from Rain8 this morning:

"The Rain8II has two modes for status response.  The first one is an automatic sending of the status each time a command is received.  This mode may be disabled if not desired.  The second mode is when the Rain8II receives a status request.  Here the same response is sent back.  The format of the status response is the approved X10 protocol so it should be what the CM15A AHP supports, but to be sure you might post your question on the X10 AHP forum"

It's the 2nd mode that CS said is not supported by AHP/CMA15A, but the 1st mode is interesting.

I will be setting the AHP "Monitor House Code" to the Rain 8 house code.  If I used Raid8's automatic sending of the status, would those automatic responses appear in the activity log?

If all ON status signals automatically generated by Rain8 are recorded in the log I could live with that.  While the ability to repeat commands until a valve turns on would be nice, my main concern is being able to track whenever a zone does not turn on so I will know if the signal path needs improvement.

Does the SDK have functions for accessing the Activity log in the CM15A?  If so I could write a scheduled task exe that each morning would look for missing ON events from Rain8 and if found would pop up an exception report to let me know what did not work overnight.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: How to repeat a command until Status confirms the command was received
« Reply #7 on: December 03, 2007, 04:00:25 PM »

While I don't have a Rain8, I can understand the frustration of a module that will not always turn on or off.
In my case, it is a smarthome relay wall switch controlling an outside light. The switch is the first and only active item on that breaker. (There are a few outlets and a light after it, but that light is never on). The breaker is on the other phase from the CM15A (and I DO have a capacitor bridging my phases), and I know that it is a signal issue. I've installed a few filters, and they helped some, but not enough. Since this is the only switch with intermittent signal issues, I decided to fix it the "cheap" way. It ALWAYS responds to RF commands, even those sent from the CM15A (using a macro or the SDK). I decided to create a macro to send that RF command, with the same timer settings as the light itself. That way, I have a backup in case it doesn't hear the PLC command.
The interesting thing is, the CM15A is only one outlet over, on the same circuit, from the RR501 that is grabbing the RF signal, and pumping it down the line. Does anyone know if the RR501 puts out a stronger signal on the powerline than the CM15A? I can't see the 6 foot distance between the two outlets being enough of a factor. I do have two other switches installed that have boosterlincs built in. I may try to activate one, and see if that helps at all.
I know that a boosterlinc and/or active coupler (clothes dryer plug) might work, but I'm trying to avoid buying anything else. As I've said, my capacitor has worked great for several years, and filtering noisy things (two UPSes and two laptop Ac adapters) seems to have fixed most of my other issues.
Any further ideas?
--Noam
Logged

csnet

  • Full Member
  • ***
  • Helpful Post Rating: 10
  • Posts: 26
Re: How to repeat a command until Status confirms the command was received
« Reply #8 on: December 03, 2007, 04:36:55 PM »

Betwen the time I ordered the AHP/CM15A and when it arrived, I read about the troubles that some have cured by not plugging the CM15A in the same outlet as the computer connected to it, so I found an old 15' 16 ga power cord and used that to an outlet on the same breaker only 8' away from the computer wall outlet that serves a UPS, 2 surge protectors, a ton a brick power supplies, for a total of 22 120AC plugs.

With all that stuff connected I was expecting nothing X10 to work when I received everything and plugged it all in.  I was pleasantly shocked to see everything work all over the house on both phases of the 240vac service. 

I have not even tried to plug the CM15A into the same outlet as the computer/etc so I cannot say using the other outlet helps, but the idea that it works with all that stuff plugged in says something.  I did not want to extend the USB cable to the CM15A so it is located with the computer equipment, just not plugged in there.  I am curious if you would get better results by running an extension cord from the outlet the RR501 uses to the CM15A?
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: How to repeat a command until Status confirms the command was received
« Reply #9 on: December 03, 2007, 05:41:07 PM »

While I don't have a Rain8, I can understand the frustration of a module that will not always turn on or off.
In my case, it is a smarthome relay wall switch controlling an outside light. The switch is the first and only active item on that breaker. (There are a few outlets and a light after it, but that light is never on). The breaker is on the other phase from the CM15A (and I DO have a capacitor bridging my phases), and I know that it is a signal issue. I've installed a few filters, and they helped some, but not enough. Since this is the only switch with intermittent signal issues, I decided to fix it the "cheap" way. It ALWAYS responds to RF commands, even those sent from the CM15A (using a macro or the SDK). I decided to create a macro to send that RF command, with the same timer settings as the light itself. That way, I have a backup in case it doesn't hear the PLC command.
The interesting thing is, the CM15A is only one outlet over, on the same circuit, from the RR501 that is grabbing the RF signal, and pumping it down the line. Does anyone know if the RR501 puts out a stronger signal on the powerline than the CM15A? I can't see the 6 foot distance between the two outlets being enough of a factor. I do have two other switches installed that have boosterlincs built in. I may try to activate one, and see if that helps at all.
I know that a boosterlinc and/or active coupler (clothes dryer plug) might work, but I'm trying to avoid buying anything else. As I've said, my capacitor has worked great for several years, and filtering noisy things (two UPSes and two laptop Ac adapters) seems to have fixed most of my other issues.
Any further ideas?
--Noam

Most of the earlier X-10 transmitters like the RR501 and the plug-in controllers put out about twice the signal voltage as a CM11A or CM15A.  If a stronger signal is required, a pure X10 amplifier like Jeff Volp's XTB at the CM15A will usually be more problem-free than a repeater.

Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.