Author |
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 29 2009 at 11:13 | IP Logged
|
|
|
This is a general control macro that I use for my EZRAIN:
Code:
insert into macroheader values ('EZRAIN','EZRain Control',0,0,1);
insert into macrodetail values ('EZRAIN',1,27,'',NULL,'"[LOCAL1]"',0,'');
insert into macrodetail values ('EZRAIN',2,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',3,26,'',NULL,'INIT',0,'');
insert into macrodetail values ('EZRAIN',4,38,'',0,'ph_insteon("EZRAIN",68,4)',0,'');
insert into macrodetail values ('EZRAIN',5,38,'',0,'ph_insteon("EZRAIN",68,8)',0,'');
insert into macrodetail values ('EZRAIN',6,38,'',0,'ph_insteon("EZRAIN",68,9)',0,'');
insert into macrodetail values ('EZRAIN',7,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',8,26,'',NULL,'VALVECTL',0,'');
insert into macrodetail values ('EZRAIN',9,27,'',NULL,'"[LOCAL2]"',0,'');
insert into macrodetail values ('EZRAIN',10,38,'',0,'ph_insteon("EZRAIN",64,[LOCAL2] - 1)',0,'');
insert into macrodetail values ('EZRAIN',11,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',12,26,'',NULL,'0',0,'');
insert into macrodetail values ('EZRAIN',13,38,'',0,'ph_insteon("EZRAIN",65,ph_and(ph_inste onwithret("EZRAIN",68,2),7))',0,'');
insert into macrodetail values ('EZRAIN',14,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',15,26,'',NULL,'PGM1',0,'');
insert into macrodetail values ('EZRAIN',16,15,'[LOCAL3]',NULL,'7',0,'');
insert into macrodetail values ('EZRAIN',17,26,'',NULL,'PGM1L1',0,'');
insert into macrodetail values ('EZRAIN',18,38,'',0,'ph_macroparm("EZRAIN","VALVECTL",[LOCAL3],0,0,0)',0,'');
insert into macrodetail values ('EZRAIN',19,16,'',NULL,'if([LOCAL3] = 0,999,1)',0,'');
insert into macrodetail values ('EZRAIN',20,31,'',NULL,'[LOCAL2] * 60',0,'');
insert into macrodetail values ('EZRAIN',21,38,'',0,'ph_addtovar(1,3, - 1)',0,'');
insert into macrodetail values ('EZRAIN',22,27,'',NULL,'"PGM1L1"',0,'');
insert into macrodetail values ('EZRAIN',23,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',24,26,'',NULL,'PGM2',0,'');
insert into macrodetail values ('EZRAIN',25,38,'',0,'ph_macroparm("EZRAIN","VALVECTL",6,0,0 ,0)',0,'');
insert into macrodetail values ('EZRAIN',26,31,'',NULL,'[LOCAL2] * 60',0,'');
insert into macrodetail values ('EZRAIN',27,38,'',0,'ph_macroparm("EZRAIN","VALVECTL",1,0,0 ,0)',0,'');
insert into macrodetail values ('EZRAIN',28,31,'',NULL,'[LOCAL2] * 60',0,'');
insert into macrodetail values ('EZRAIN',29,38,'',0,'ph_macroparm("EZRAIN","VALVECTL",0,0,0 ,0)',0,'');
insert into macrodetail values ('EZRAIN',30,39,'',NULL,'',0,'');
insert into macrodetail values ('EZRAIN',31,26,'',NULL,'STOPPGM',0,'');
insert into macrodetail values ('EZRAIN',32,38,'',0,'ph_whileloop(''0'',''ph_killmacrowait( "EZRAIN")'')',0,'');
insert into macrodetail values ('EZRAIN',33,39,'',NULL,'',0,'');
|
|
|
It expects to be called with the ph_macroparm function. It contains general control commands as well as two programs. PGM1 runs all the values sequentially (valve 7 thru valve 1...I dont have a valve 8..change line 160 appropriately), and PGM2 runs just valve 6 and valve 1. Additional programs can be easily added for customized control. This macro also assumes that your EZRAIN Insteon device has an ID of EZRAIN.
Calling this function with ph_macroparm("EZRAIN","INIT",0,0,0,0) will prep the EZRAIN device's options. Calling with ph_macroparm("EZRAIN","PGM1",20,0,0,0) will trigger Program 1 with each valve running for 20 minutes. Individual valve control can be achieved with ph_macroparm("EZRAIN","VALVECTL",5,0,0,0) to turn on valve 5 and ph_macroparm("EZRAIN","VALVECTL",0,0,0,0) to turn off the valves.
I then have a trigger on a KPL button to launch the macro and have PGM1 run for 20 minutes per valve.
HTH,
Dave.
|
Back to Top |
|
|
gosgirl Newbie
Joined: June 29 2009
Online Status: Offline Posts: 2
|
Posted: June 30 2009 at 02:14 | IP Logged
|
|
|
I am running one EZRain program started by a Powerhome timed event and two valve zones directly with insteon commands due the inability to program a longer deadtime between valve openings in the EZRain.
Walt-Disneys-100-Years-Of-Magic-DVD-Boxset-DVDSNCIS dvd
House m.d dvd
24 Hours seasons1-7 dvd
|
Back to Top |
|
|
judetf Senior Member
Joined: January 23 2008
Online Status: Offline Posts: 234
|
Posted: September 28 2009 at 15:32 | IP Logged
|
|
|
Now that irrigation season is over I figured I'd start getting an EZFLORA ready for next year. :)
PH sees the EZFLORA and I followed RichardL's approach to create groups to control each zone, and it's working with one issue: how to I catch zone 1?
My link to "button 1" appears, as far as I can tell, to control Zone 2 on the EZFLORA; button 2 controls zone 3; etc.
How do I link/group the EZFLORA so that I can control Zone 1?
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: September 28 2009 at 16:07 | IP Logged
|
|
|
Unlike a KPL where the responder Group numbers for the KPL buttons run from 1-8, the EZFlora and other EZIOxx devices run responder (output) group numbers from 0-7 for valves 1-8. As far as I know Dave has not fixed PH so that you can specify a Button (Group) number 0 for a multi output device. This was discussed on the forum many months ago and perhaps it will be addressed in the next release. I've not tried this on my EZFlora but it did work for my EZIOxx device. I changed the device type to something like a SwitchLinc or an ICON switch where the responder button number of 0 is valid. I set up the link for button 0 (output group 0 which is valve 1) and then changed the device type back for button numbers 1-7 to cover the remaining output devices.
Another option is to use Direct commands to turn On/Off individual valves rather than using links and a Group (button) number.
Edited by grif091 - September 28 2009 at 17:42
__________________ Lee G
|
Back to Top |
|
|
judetf Senior Member
Joined: January 23 2008
Online Status: Offline Posts: 234
|
Posted: September 28 2009 at 18:16 | IP Logged
|
|
|
The cheat worked perfectly, thanks!
I had tried to figure out the direct commands first but couldn't, so the KPL-style approach, with this cheat, seems to be sufficient. Now I'll just make a macro to handle a program for running it all, and come next spring my lawn better watch out!
|
Back to Top |
|
|
judetf Senior Member
Joined: January 23 2008
Online Status: Offline Posts: 234
|
Posted: March 29 2010 at 12:58 | IP Logged
|
|
|
I'm digging this thread out b/c I am trying a. to setup sprinklers for the year, and b. educate myself a bit.
I have Dave's macro in place and, I think, it works perfectly well. But I'm trying to understand a few things about _how_ it works, so that I can tweak it.
Dave (or someone else), can you explain what is going on in the VALVECTL macro? I don't understand what happens when the Goto Label command has "[LOCAL 2]" as the the formula. I believe that will evaluate to the zone number that we are trying to control, but there are no labels in the overall macro that have zone numbers as their names.
I also can't figure out how the macro gets to line 130 where, I believe, the ph_and(ph_insteonwithret...) line will turn off whatever zone is currently on.
Finally, more out of curiosity than anything, what if anything ever causes the macro to hit the last STOPPGM label?
Thanks... I feel like an idiot that I can't even understand what this macro is doing, but try as I might...
jtf
|
Back to Top |
|
|
judetf Senior Member
Joined: January 23 2008
Online Status: Offline Posts: 234
|
Posted: March 29 2010 at 13:26 | IP Logged
|
|
|
Never, mind, I think you can ignore me. What I was failing to grasp was that turning a zone on will automatically turn off any other zone that might have been on, so it's a single step rather than two steps to turn the next one on.
My plan is to build in a 60-second delay between zones, just, uh, because. But now I think I understand what's going on, so I should be set.
jtf
|
Back to Top |
|
|
smogman Newbie
Joined: April 20 2010
Online Status: Offline Posts: 14
|
Posted: April 25 2010 at 23:27 | IP Logged
|
|
|
I have read these post about the ezrain/flora and a few about the ez i/o's but I still can not figure out a few things. From what i can tell, I have not discovered a way to control valve's 1-8 with anything other than a kpl or other device. I'm trying to have control over valves 1-8 through Control Center and Web Center. I don't want to run an irrigation program from a button on a kpl. These are the problems I can not figure out.
1.If the ezrain is not linked to another device, I can not get it to show up in C.C. or W.C.. I want to control it through P/H, not hardware.
2.In insteon explorer, I can not get control of all the valves. just the standard on/off a though its a switchlinc. same for all my ez I/O stuff.
3. MACRO's : I have no idea how to input a macro into P/H. I read the ezrain thread but because I know nothing about macro's I can not even figure out how to make the macro run.
I'm looking for simple control (for now). no timer's, rain sensor's, and no hardware control. I have that part down. I know this is something easy but I'm just missing something.
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 07 2010 at 23:19 | IP Logged
|
|
|
Well the dust did accumulated again on the EZFloras.
I am now trying to get them going, and I have the opossite problem of Judetf - Valve 1 via PH.Insteon works OK.
Valve 2 - via PH.InsteonGroupCU crashes the program, and sometimes PH. The code all looks OK.
I am suspecting something other than the code.
What is everyone setting their EZFlora devices as? I only have a choice of "31270 - EZRain irrigaton controller", which I am using.
Thanks in advance,
Richard
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 07 2010 at 23:44 | IP Logged
|
|
|
PS: I have EZFlora v1 devices...
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: June 08 2010 at 00:45 | IP Logged
|
|
|
You have a separate PLC/PLM Group for each valve you are trying to control? Does the link to valve 2 show Verified Verified? Does the Insteon Raw Log show any Insteon traffic when the ph.insteongroupcu to valve 2 is executed?
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 08 2010 at 01:13 | IP Logged
|
|
|
Hey Lee long time no speak, hope all is well.
Yes I have PLM group 142 for valve 2 (EZF-Valve-2), 143 for 3, thru 148 for valve 8. Only one of the two EZFloras I have are linked to the group. I am waiting to finish troubleshooting before adding the second. The address of the active one is 05.92.39.
Yes everything is verified.
I attached some snapshots, including the 3 raw log entries that resulted from the run.
I am also getting a script error, but I see no syntax problems.
I am testing in the code a section that will simply turn off all valves via a for/next loop. If the counter is 1 then I do a PH.Insteon - which seems to be OK, when the counter goes to 2 and I do a PH.InsteonGroupCU then the code stops. Sometimes it kills PH.
Thank you!
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: June 08 2010 at 01:56 | IP Logged
|
|
|
The RUN ERROR looks like a problem with the VB script. That message does not say much. I don't do much VB script but what I remember it was hard to debug because so little was provided when there was a problem.
You did not detail the ph.insteon command but it sounds like you are using an Insteon Direct command to control valve 1 and Insteon Group commands to control valves 2-8. The responder link record data for LD1/LD2/LD3 is different for an EZFlora. For an Insteon Group command to control a valve, the responder link record LDx data looks like....
LD1(bright level)=0 LD2(ramp rate)=0 LD3(unit number)=x
where x is the valve number (relative to zero) to be controlled by the Group. That is, x would be a 3 to control valve 4. The LD3 unit numbers range from 0-7 to control valves 1-8.
You might find it easier to control all the valves with Insteon Direct commands. That way you don’t have to manage links at all. Can you post the ph.insteon command you are using to control valve 1.
__________________ Lee G
|
Back to Top |
|
|
sjvonstein Groupie
Joined: February 05 2010 Location: United States
Online Status: Offline Posts: 75
|
Posted: June 08 2010 at 07:40 | IP Logged
|
|
|
I've seen that script error when "Start Script Server" is not checked in the "Preferences" section of the explorer.
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 08 2010 at 09:37 | IP Logged
|
|
|
sjvonstein - thank you for the input, I have many routines that run each day/night, and all is OK. I am at work but will double check the Start Script Server tonight. I did get hit with that when I first started coding for PH!
Below is an extract that contains the subroutine that turns off all valves.
I put an "Errors here" comment on the suspect line of code (valve 2).
When you mention "direct commands", from my beginning knowledge of the EZF, it is like a KPL, so I do PH.Insteon for button/valve 1, and PH.InsteonGroupCU for vales 2-8.
Is a direct command the PH.Insteon?
Can you also let me know and/or give me an example of how I could code direct commands and not have links.
Thank you.
Code start +++++
'   ;Turn off all valves unconditionally.
Sub subTurnOffAllValves()
'   ;Initialize Variables.
Const iOn = 17
Const iOff = 19
intDelayTime = 1000
strLogLead = "--- TE_Irrigation: "
rv = PH.UserMessage(strLogLead & "Turn off all valves. ---")
'   ;Loop thru the 2 devices, 8 valves each.
For intEZFDeviceNumber = 1 to 2
For intEZFValveNumber = 1 to 8
'   ;Set current device and valve names.
strEZF DeviceName = "Irr-EZFlora-" & Trim(intEZFDeviceNumber)
strEZF ValveName = "EZF-Valve-" & Trim(intEZFValveNumber)
'   ;Turn off valve.
rv = PH.UserMessage(strLogLead & strEZFDeviceName & _
", Valve: " & strEZFValveName & ": Off ---")
If intEZFValveNumber = 1 Then
rv = PH.Insteon(strEZFDeviceName, iOff, 0)
rv = PH.Delay(intDelayTime)
Else
' Errors here--->
rv = PH.InsteonGroupCU(strEZFValveName, strEZFDeviceName, iOff)
rv = PH.Delay(intDelayTime)
End If
Next
Next
End Sub
Code end -----
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: June 08 2010 at 11:13 | IP Logged
|
|
|
Because there can only be 1 valve on at a time you do not need to cycle through all the valves to insure all valves are off. You can issue this one Direct command, which is turning Off valve 1, will turn Off any valve that is on. This was verified on my V1 EZFlora. Valve 4 was On, the command to turn Off valve 1 turned Off valve 4. Of course you can turn Off a specific valve with this command. The cmd2 values range from 0-7 for valves 1-8.
ph_insteon("EZFLORA",65,0) valve Off
There is a Direct command to turn On a valve. When using Direct commands there is no need for links.
ph_insteon("EZFLORA",64,0) valve On
Edited by grif091 - June 08 2010 at 11:20
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 08 2010 at 12:37 | IP Logged
|
|
|
Looks great.
So to be sure please confirm that I understand the direct commands.
The following 8 commands would turn on valves 0-7 on device named EZFlora-1:
PH_Insteon("EZFlora-1",64,0)
PH_Insteon("EZFlora-1",64,1)
PH_Insteon("EZFlora-1",64,2)
PH_Insteon("EZFlora-1",64,3)
PH_Insteon("EZFlora-1",64,4)
PH_Insteon("EZFlora-1",64,5)
PH_Insteon("EZFlora-1",64,6)
PH_Insteon("EZFlora-1",64,7)
The following 8 commands turn would off valves 0-7 on device named EZFlora-1:
PH_Insteon("EZFlora-1",65,0)
PH_Insteon("EZFlora-1",65,1)
PH_Insteon("EZFlora-1",65,2)
PH_Insteon("EZFlora-1",65,3)
PH_Insteon("EZFlora-1",65,4)
PH_Insteon("EZFlora-1",65,5)
PH_Insteon("EZFlora-1",65,6)
PH_Insteon("EZFlora-1",65,7)
As you said, if I execute a turn on (Cmd2=64), then any other valve will turn off.
...and I do not need any PLM Groups or links?
Thank you!
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: June 08 2010 at 12:46 | IP Logged
|
|
|
Correct on all points. Turning on Zone 1, then turning on Zone 2 automatically turns Off Zone 1. No need to explicitly turn Off a Zone when moving to another Zone. The Off is needed only when that is the last action. No harm in issuing an Off command for the current Zone that is On, just no need to do so when turning on the next Zone. No PLM links needed or used for Insteon Direct commands. No means of specifying a Group number with a Direct command. .
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: June 08 2010 at 13:01 | IP Logged
|
|
|
You did it again, I'll update the code and test it tonight. I'll post a follow up.
My trees, shrubs, grass and of course myself thank you!
|
Back to Top |
|
|
kemporama Senior Member
Joined: November 21 2008
Online Status: Offline Posts: 102
|
Posted: April 09 2011 at 18:10 | IP Logged
|
|
|
I just received 2 EZFlora devices for my new sprinkler system being installed next week. I have a macro all set up and working based on the "64" and "65" variables above. It's definitely working because I borrowed a valve to test with and it is clicking on and off as the macro runs.
My question is what is the most efficient way to be able to turn on and off a specific single zone on the fly? It would be nice to be able to manually activate a specific zone to test it, or give the area a little extra water if it needs it, leave it on as long as I want, and then manually turn it off. It doesn't look like I can send an ON and OFF to the zones like through the device status window even if I have a group up for each individual zone because it's looking for a 64 or 65 command. I'm stumped.
Thanks!
|
Back to Top |
|
|
|
|