Jared, Yea it sounds like the script is running just fine. I am pretty sure I can tweak the controller smartapp to work for you to manually input the ip. Let me look at it. Groovy can be pretty confusing and most of what I have is a mashup of other code.
I have indeed seen that Vera plugin. In fact, that is where I got a lot of what I needed to make my integration work. Vera allows SSH and Telnet connections which is why they can do it without a separate server. Really for those of us with the non pro bridge there isn’t much more that can be done beyond what this already does. For people with the pro there is the potential to get more control over things like Pico remotes and ramp rates but the pro doesn’t seem to work with this integration sadly. The one piece of the Vera code that I want to look more into is how it connects over http calls with Lutron. If I can figure out how they are doing that it may be a way to get it all working without a separate server. It would probably be a little less reliable cloud to cloud rather than local but could still be pretty nice for those that do not know how to set up a pi etc. I will look into that more as well.
Hi. Trying to run this on my Windows 10 machine. I’m running the 64bit flavor on this machine. I got Python installed along with Twisted and Paramiko. When I run python LutronPi.py I get this in return…
Traceback (most recent call last):
File “LutronPi.py”, line 12, in
from twisted.web.client import Agent
File “C:\Python27\lib\site-packages\twisted\web\client.py”, line 42, in
from twisted.internet.endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint
File “C:\Python27\lib\site-packages\twisted\internet\endpoints.py”, line 36, in
from twisted.internet.stdio import StandardIO, PipeAddress
File “C:\Python27\lib\site-packages\twisted\internet\stdio.py”, line 30, in
from twisted.internet import _win32stdio
File “C:\Python27\lib\site-packages\twisted\internet_win32stdio.py”, line 9, in
import win32api
ImportError: No module named win32api
Hey Neal. Glancing at that log it looks like the issue is you are missing that win32api module. You can try to install it using pip install win32api (No idea if that will work or not). A fellow user @stephack got it working on Win 10 so it can be done. He said he was using the 64 bit version as well so it may just be a matter of installing some modules. Let me know what happens.
Unfortunately this was the first thing I tried but this returned an error basically saying, “what the heck are you looking for…that thing doesn’t exist.” Strange thing is, I can SEE the win32api file in the folder it specifies. Perhaps I should use the 32 bit version of Python rather than the 64 bit one I have today?
That is because you are probably launching the script from outside the directory the files are in. Navigate to the folder the files are in and try it. If that does not work then you can just hard code in the absolute path rather than the relative path. Just change line 230 to “ssh = smartBridgeSSH(smartBridgeIP, “leap”,‘c:\My_File_is_Here\rsa_key’, smartThingsIP)”
ok. From cmd I’m entering “python c:\python27\LutronPi.py” and pressing enter. I get the same RSA error. When editing line 230 of LutronPi.py in Notepad to show as “python c:\python27\LutronPi.py” and running the same command again I now get the error “exceptions.IOError: [Errno 22] invalid mode (‘r’) or filename: ‘c:\python27\rsa_key’”
Hmm ok~Nothing can ever be simple ehh! lol Try switching the ‘’ to ‘/’ i.e. ‘c:/python27/rsa_key’ . I think Windows is funny about paths for whatever reason.
LOL that did it. stupid that Windows wants to see “/” but when Python wants to run something or find something it needs to see “”… I’m now "running as a client! Time to test in ST app.
Thanks Nate. I guess I have too many devices, I am getting this error (I added the BODY debug):
1c139d98-2031-4b48-a65c-149550dc5030 10:46:39 PM: error groovy.json.JsonException: Expected a value on line: 1, column: 4096.
But got an unterminated object. @ line 172
1c139d98-2031-4b48-a65c-149550dc5030 10:46:39 PM: debug BODY: {“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“MultipleDeviceDefinition”,“StatusCode”:“200 OK”,“Url”:"/device"},“Body”:{“Devices”:[{“Name”:“Smart Bridge”,“Parent”:{“href”:"/project"},“href”:"/device/1",“SerialNumber”:23628153,“ModelNumber”:“L-BDGPRO2-WH”,“DeviceType”:“SmartBridge”},{“Name”:“Office Remote”,“Parent”:{“href”:"/project"},“href”:"/device/2",“SerialNumber”:28450692,“ModelNumber”:“PJ2-3BRL-GXX-X01”,“DeviceType”:“Pico3ButtonRaiseLower”,“ButtonGroups”:[{“href”:"/buttongroup/2"}]},{“Name”:“Office Dimmer”,“Parent”:{“href”:"/project"},“href”:"/device/3",“SerialNumber”:22087158,“ModelNumber”:“PD-6WCL-XX”,“DeviceType”:“WallDimmer”,“LocalZones”:[{“href”:"/zone/1"}]},{“Name”:“Desktop Pico”,“Parent”:{“href”:"/project"},“href”:"/device/4",“SerialNumber”:28590190,“ModelNumber”:"PJ2-3BRL-GXX-X
It seems like ST is truncating the JSON, which is then failing lint. Is there a way to strip the payload down a bit, or otherwise get around that truncation?
Yea~That is a quirk of Windows that I forgot about. What I need to do is just put the key in the other file so it isn’t an issue I suppose. And find a way to make this whole thing install on it’s own. I will get there…
all good. I dont mind. I’ve never actually used Python so this is fun. ST app found the Python instance but now won’t find my switches. I’m going to reboot the Lutron AND ST hub I suppose.
Hmm~very interesting, I haven’t seen that issue before now. How many devices do you have? I only see 4 there and I have way more than that so that shouldn’t be the problem. When is this error coming about? During discovery? And that is the entire output there? I am wondering if ST is truncating or if it is the ssh server doing so somehow. Let me see if I can recreate that somehow on my end.
My guess is the port that twisted listens on is occupied by a prior instance of the script since it was started and died several times. Make sure all processes of the script are stopped and then start it again and it will probably get your switches.
how unlucky can I be?? I just realized it’s probably not seeing my Lutron devices because I’m running a Pro hub. I never even realized that’s what I’ve had until I just ran and looked. Ugh. Has anyone gotten the Pro hub to work?