Hi Thom,
I'm not that IRC saavy/equipped; I should probably add that to my list of things to learn. I'm also not sure how well it'd work via my iPad since I bounce between Safari, Textastic, and iSSH. Long story...
Anyway, based on my understanding of the devices' SDK, it needs a channel for the subscription for the SOAP events with a periodic heartbeat response, and commands are sent via the REST interface (so, two connections). Based on my understanding of the conn_object, it's a single channel implementation, but bi-directional. This all is with the caveat/disclaimer that I don't play a programmer on TV or the Internet; I'm a sysadmin who's managed to learn enough about programming to be able to glue various bits and pieces together.
So, I have this little private method which works beautifully, and I can control manually-defined children lights of the device quite nicely.
def sendISYcommand(command)
#$username=device_.devdata_[114].to_s
#$password=device_.devdata_[115].to_s
#$host=device_.devdata_[?].to_s
$host = "192.168.80.148"
$port = device_.devdata_[69].to_s
res = Net::HTTP.start($host) {|http|
req = Net::HTTP::Get.new(command)
req.basic_auth device_.devdata_[114].to_s, device_.devdata_[115].to_s
response = http.request(req)
xml_data = (response.body)
log("====== / sendISYcommand response body ======")
log(xml_data)
log("====== sendISYcommand response body / ======")
doc = REXML::Document.new(xml_data)
log(doc)
s = REXML::XPath.first(doc, "RestResponse/status")
log(s)
return s.text
}
end
I'll worry about http/https via the port data later when the driver is close to completion. Pulling device data like username & password works well. I'm just looking to find a means to obtain the IP cleanly for sending these REST commands. My next project is the conn_object for the subscription, and figure out all the other xml parsing that'll go along with it.
Thanks again for your time and guidance.
/Mike