|
Page 1 of 1
|
[ 12 posts ] |
|
Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY 99i
| Author |
Message |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY 99i
I have created a plugin to integrate my pentair intellitouch pool controller into indigo. Once I get that fully functional, I'd like to also integrate my elk M1gold, Russound MCA-C5, Onkyo tx-nr708, TiVo premier and isy 99i. I currently have all of these devices working over ip with iRule, so I'm comfortable with the ip control command sets for each device. However, I'm new to indigo, python and tcp/socket handling (and I'm also more comfortable with procedural vs object oriented programming). I've gotten my feet wet with the intellitouch plugin, but it would be great if someone had any helpful code samples, advice, already written plugins, etc... I'd be happy to share anything I create back with the community. I've noticed that many of these devices have previously been discussed in threads, but I have yet to find any resolution or code samples. update: I removed tcp related questions. it appears that the built in serial methods allow for serial connections over IP. Is there anything that's not built in to Indigo? 
Last edited by bcall on Thu May 24, 2012 2:20 am, edited 1 time in total.
|
| Wed May 23, 2012 3:56 pm |
|
 |
|
Swancoat
Joined: Nov 20, 2009 Posts: 182 Location: Houston
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
Doh! I'm also in the testing phase of a Pentair Pool plugin as well (mine's serial, not IP). I didn't know there was an IP option...
_________________ http://nerdhome.jimdo.com
|
| Wed May 23, 2012 4:40 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
Yes, you can communicate with the pentair over ip. All you need is a serial to ip gateway i'm using the global cache iTach but there are others available. For the serial connection to my intellitouch I'm using the pentair I-link. If you decide to go ip, let me know and I'll send you a copy of my plugin for the ip stuff. 
|
| Wed May 23, 2012 5:24 pm |
|
 |
|
Swancoat
Joined: Nov 20, 2009 Posts: 182 Location: Houston
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
ahhh, ok. I have an iTach as well. Also using one on my Grand Concerto. I built the plugins using simple usb-serial adapters, but am replacing them with the iTachs.
I had the GC running, but swapped out one iTach for another (one is POE, the other not...) and I CAN NOT get it to communicate again. I can't remember what the trick is to set this up. I'm simply selecting it using the built-in function in the serial port field type...
Basically, this thing says the serial port is open... but it's not. It won't read or write data. I wish I had a simple terminal app that I could set up to refer to the iTach to help troubleshoot this.
_________________ http://nerdhome.jimdo.com
|
| Wed May 23, 2012 6:15 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
I'm not clear on whether you're having trouble with the iTach from withing your plugin, or in general.
If you want to test the iTach (from outside indigo), the easiest thing to do is download iTest.exe from the global cache website. Just enter your iTach's ip address and select port 4999 for the serial connection.
From inside an indigo plugin, you have to set up a tcp connection to the iTach, and then send the commands over that connection.
Did I answer your question?
|
| Wed May 23, 2012 6:46 pm |
|
 |
|
Swancoat
Joined: Nov 20, 2009 Posts: 182 Location: Houston
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
eh, not really. I think my problem is in the plugin, but it's either out of my hands or something I don't understand.
I'm not using a TCP connection per se. When you setup your configUI fields and want a serial port, there's a lot of built in functionality there for choosing serial ports. You just tell it you want a serial port field, and they give you an automatic popup for physical port or network, let you specify it there, etc... I can have everything working, but when I change from a physical port to a network socket, I don't get any communication.
(I already had this problem once, and I thought I fixed it by ditching my prefs file, but that doesn't seem to be doing it for me anymore)
_________________ http://nerdhome.jimdo.com
|
| Wed May 23, 2012 6:57 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
That's very interesting. Do you mean that withing the plugin you can connect to a serial port through IP (as if the serial port where local)? That would be hugely helpful to me. I've been spending a lot of time trying to figure out how to manage tcp sockets. If there's an indigo built in functionality to do that I'd be a real happy camper. Can you point me to info on that? Does it only work for iTachs or any any remote serial port? For example, can I use it to control my onkyo over IP?
|
| Wed May 23, 2012 8:08 pm |
|
 |
|
Swancoat
Joined: Nov 20, 2009 Posts: 182 Location: Houston
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
_________________ http://nerdhome.jimdo.com
|
| Wed May 23, 2012 8:23 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
thanks! I'll check it out.
Perhaps you have run into another issue I'm currently facing... I'm creating a separate thread to monitor the device. I need to access the dev from that thread. The indigo built in method for running a concurrent thread fires before indigo has the dev set up (or at least the dev doesn't get passed to that method). So, I set up my own concurrent thread. But, I'm still having trouble figuring out how to access the dev from it. I need to access the dev so that I can update the states (dev.updateStateOnServer). I set up a pointer in the indigo start method (self.mydev = dev), but that doesn't work. I assume that instead of assigning a pointer, it's assigning a copy that goes away by the time I try to access it.
Update: I figured it out. The plugin docs give the example:
dev=indigo.devices["Custom Plugin Thermostat"]
which led me to believe that I should use the plugin name as an argument (i.e., "Custom Plugin Thermostat"). I figured out that you need to use the name of the specific device (i.e., "office thermostat"). This seems obvious in hindsight, but I still think the example given is misleading.
Last edited by bcall on Wed May 23, 2012 10:27 pm, edited 1 time in total.
|
| Wed May 23, 2012 8:40 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
It looks like the serial port is the way to go. I just spent the last few days figuring out how to get a socket working (and it finally works). Guess it's time to start over with the serial stuff. I think my head is going to explode.
|
| Wed May 23, 2012 9:10 pm |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6662 Location: Austin, Texas
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
bcall wrote:dev=indigo.devices["Custom Plugin Thermostat"]
which led me to believe that I should use the plugin name as an argument (i.e., "Custom Plugin Thermostat"). I figured out that you need to use the name of the specific device (i.e., "office thermostat"). This seems obvious in hindsight, but I still think the example given is misleading.
That is not the right way to do it - device names should never be used in plugins because you don't know what the user will name the device (and the device name can change). Also, there are plenty of built-in facilities to do what you're looking to do. If you want to just poll your device(s) inside the runConcurrentThread method, then when the deviceStartComm() thread is called with a device instance you can add it to a list that you define in the __init__ or startup() method (like self.deviceList = []) then in the runConcurrentThread() just iterate over the list doing whatever it is you need to do to poll. That's the easiest solution that doesn't require doing any threading yourself. Be sure to remove the device from the list when deviceStopComm() is called with the device instance so the user can enable/disable your devices like they can with any other device. If you need to thread each device communication individually then start up your own device specific thread when the deviceStartComm() method is called with the device instance and shutdown the thread when the deviceStopComm() method is called with the device instance.
_________________ Jay (Indigo Support)
|
| Thu May 24, 2012 9:17 am |
|
 |
|
Swancoat
Joined: Nov 20, 2009 Posts: 182 Location: Houston
|
 Re: Query re Elk M1, Russound MCA, Onkyo Receiver, TiVo, ISY
bcall, I've got my GC Plugin back up and running on the iTach... turns out my problem is that I bought a non-POE version (but was already using a POE version and wanted to swap so I could use the POE one on my Pentair setup...) Anyway, looks like the non-POE one I just bought is borked and I'll have return it.
Getting the iTach setup the first time isn't smooth though, and I don't know what I'm handling wrong. I set it up in the serial port config popups and get an immediate error. However, I can then just reload the plugin and all is good, and it works fine from then on out. Something simple with startup I'm sure.
My Pentair plugin is basically done though and running. Not on the iTach yet (although the support is technically there). It's set up to configure the interface in pluginConfig (not device config) and then everything on it (pool, spa, lights, etc...) are just recognized as devices. Pentair interface is dog slow too, but works fine.
If you'd like to take a look PM me your email and I'll send it. I'd like to see yours too (but I'm scared to because mine's done and I don't want to throw out my work for a better version!).
_________________ http://nerdhome.jimdo.com
|
| Thu May 24, 2012 8:15 pm |
|
|
|
Page 1 of 1
|
[ 12 posts ] |
|
Who is online |
Users browsing this forum: kw123 and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|