HOME › Forums › Irrigation › EZFlora › Where is the EzFlora xml command reference? › Reply To: Where is the EzFlora xml command reference?
Inactive
March 5, 2009 at 6:30 pm
Post count: 35
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:
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 =
"n"+
"SndInsn"+
""+p1+"n"+
""+p2+"n"+
""+p3+"n"+
""+p4+"n"+
""+p5+"n"+
""+p6+"n"+
"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.