Where is the EzFlora xml command reference?

Comments and suggestions on the EZFlora irrigation controller

Moderator: Justin

mikeklein
Posts: 35
Joined: Fri Feb 27, 2009 10:23 pm

Where is the EzFlora xml command reference?

Postby mikeklein » Wed Mar 04, 2009 10:55 pm

Could only find lowlevel PLM api and this isn't what I need for EzBridge.

I see they exist for some other products you make.

Also see that you have sample ezrain get/set timers xml messages...but where are the commands to turn the valves on and off?

If I could get api or merely an example of turning on/off a specific valve (1-8) that'd be cool.


thanks.

grif091
Posts: 996
Joined: Wed Jan 30, 2008 3:50 pm
Location: North Carolina

Re: Where is the EzFlora xml command reference?

Postby grif091 » Thu Mar 05, 2009 4:24 am

The EZFlora commands are listed in the “Irrigation Controller Command Set” document in the Downloads section of the SHN web site.

Cmd1 0x40 – turns on a valve – cmd2 0x00-0x07 specifies the valve number 1-8
Cmd1 0x41 – turns off a valve – cmd2 0x00-0x07 specifies the valve number 1-8

An example of the XML to send an Insteon command to turn on valve 1 follows:

<?xml version="1.0"?>
<command>SndIns
<parameter1>AA</parameter1>
<parameter2>BB</parameter2>
<parameter3>CC</parameter3>
<parameter4>0F</parameter4>
<parameter5>40</parameter5>
<parameter6>00</parameter6>
</command>

I do not have an EZFlora to confirm this is a working example but I think it is correct. I took the SndIns template from the SHN Utility Control tab. The AA,BB,CC is the Insteon device address of the EZFlora. Parameter 5 is cmd1, parameter 6 is cmd2.

mikeklein
Posts: 35
Joined: Fri Feb 27, 2009 10:23 pm

Re: Where is the EzFlora xml command reference?

Postby mikeklein » Thu Mar 05, 2009 11:30 am

Thanks...I saw PLM APIs but wasn't sure initially how to use them with insteon xml...but now I see they are the long/raw form of xml insteon msg.

What I did to solve problem last night was use Ethereal (WireShark) to dump xml sent over wire.

Ended up with jsp to control the 3 sprinkler zones using following:

Code: Select all

   else if(paramName.equals("Sprinkler1On"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x40", "0x0");
   else if(paramName.equals("Sprinkler1Off"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x41", "0x0");
   else if(paramName.equals("Sprinkler2On"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x40", "0x1");
   else if(paramName.equals("Sprinkler2Off"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x41", "0x1");
   else if(paramName.equals("Sprinkler3On"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x40", "0x2");
   else if(paramName.equals("Sprinkler3Off"))
      sendInsteonCommand("0x01", "0x74", "0x39", "0x0F", "0x41", "0x2");

...

public void sendInsteonCommand(String p1, String p2, String p3, String p4, String p5, String p6) throws Exception
{
   String cmd =
      "<?xml version=\"1.0\"?>\n"+
      "<command>SndIns\n"+
      "<parameter1>"+p1+"</parameter1>\n"+
      "<parameter2>"+p2+"</parameter2>\n"+
      "<parameter3>"+p3+"</parameter3>\n"+
      "<parameter4>"+p4+"</parameter4>\n"+
      "<parameter5>"+p5+"</parameter5>\n"+
      "<parameter6>"+p6+"</parameter6>\n"+
      "</command>\n";

   writeSocket(cmd);
}

public void writeSocket(String message) throws Exception
{
   System.out.println("Sending message=\n"+message);

   Socket socket = new Socket("192.168.1.7", 8002);
   OutputStream os = socket.getOutputStream();
   os.write(message.getBytes());
   System.out.println("wrote msg...");
   InputStream is = socket.getInputStream();
   byte[] bytes = new byte[1024];
   int read = 0;
   while(is.available() != 0)
   {
      read = is.read(bytes);
      System.out.println("read "+read+" bytes...");
      System.out.println("read="+bytes);
   }
   os.close();
   socket.close();
}


Code is a hack but my web page now lets me control lighting and sprinklers...kewl.

Works reliably every time too...never yet had a problem with Insteon.


Return to “EZFlora”

Who is online

Users browsing this forum: No registered users and 1 guest