[BETA] Lutron Caseta Integration using Raspberry Pi (Pro or Standard Bridge) [DEPRECATED--See new Release thread instead]

LOL i was running it from the shell, just realise I have to run it from the cmd prompt from the python directory

Aw well running it from C;\python27\scripts ( pip is not recognised as a command…)

You can (and should) add the python bin directory to your path. I believe there is an option to do that during the install, but you can also do it post-install - the method varies depending on Windows version. That might help you with some of the problems in the future, too!

PS, just remember this whole process is a learning experience and the next time you do something it will be easier.

I did add it to my path. and I guess you misread, its still not installing from the cmd prompt

If the pip command is not recognized than either it’s not in path, you’re not in the right directory, or it it’s not installed. Do some googling and look around the various Python 2.7 directories to see if you can find it. If not it’s not hard to install…https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

Yes I couldnt find pip in the script directory and am googling how to install it, will look into that link also. thanks

You’re right, I did misread or still am. Just to test, I downloaded python 2.7.13 on a clean machine I’ve got here, made sure pip was installed (as part of the python package) and that add to path was installed. I then, from a standard command prompt - not python, did pip install twisted:
C:\Users\mgust>pip install twisted
Collecting twisted
Downloading Twisted-17.1.0.tar.bz2 (3.0MB)
100% |################################| 3.0MB 201kB/s

Got error;
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

----------------------------------------

Command “c:\python27\python.exe -u -c “import setuptools, tokenize;file=‘c:\users\mgust\appdata\local\temp\pip-build-f6kfvc\twisted\setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record c:\users\mgust\appdata\local\temp\pip-mbnth6-record\install-record.txt --single-version-externally-managed --compile” failed with error code 1 in c:\users\mgust\appdata\local\temp\pip-build-f6kfvc\twisted\

So installed MS VC++ from http://aka.ms/vcpython27 (which redirected to microsoft) and then ran again:
C:\Users\mgust>pip install twisted
Collecting twisted
Using cached Twisted-17.1.0.tar.bz2
Requirement already satisfied: zope.interface>=3.6.0 in c:\python27\lib\site-packages (from twisted)
Requirement already satisfied: constantly>=15.1 in c:\python27\lib\site-packages (from twisted)
Requirement already satisfied: incremental>=16.10.1 in c:\python27\lib\site-packages (from twisted)
Requirement already satisfied: Automat>=0.3.0 in c:\python27\lib\site-packages (from twisted)
Requirement already satisfied: setuptools in c:\python27\lib\site-packages (from zope.interface>=3.6.0->twisted)
Requirement already satisfied: attrs in c:\python27\lib\site-packages (from Automat>=0.3.0->twisted)
Requirement already satisfied: six in c:\python27\lib\site-packages (from Automat>=0.3.0->twisted)
Installing collected packages: twisted
Running setup.py install for twisted … done
Successfully installed twisted-17.1.0

Edit: After running through the above, run “pip install pypiwin32” before running lutron python script.

1 Like

Thanks a million. I was using the python2.7 as stated and couldnt find pip anywhere…installing 2.7.13 and I see pip package included. will keep you guys updated

1 Like

I finally got twisted and Paramiko installed…getting a win32api error when I run the lutronpi.py script so will try to figure that out

Well that does explain things. I guess I should have written 2.7.x. Sorry for the confusion. The 2.7.13 version comes with pip where as 2.7 alone does not which is why you were having that issue.

Was just going to write I did that and it solve the problem

Yeah I guess I was concentrating on 2,7

Thanks for all your help guys… working awesome

2 Likes

I looked at the ST logs, and the only error I see is:

error java.lang.NullPointerException: Cannot get property ‘Body’ on null object @ line 172

Any ideas? Everything seems to work fine, but the switches just never get added to My Home.

Are you using the latest stuff I posted last night? I would suggest updating everything to the new 1.0 release and trying it. I am running it and several other are as well and I have not heard of any major issues. Give that a shot and let us know how it goes.

I updated LutronPi.py and the handlers that were updated. I have a Pro bridge and I turned on Telnet in the Lutron app, but it is still giving me this error. Sorry I am being such a bother, but getting this to work would be amazing for me.
I am now getting this error when opening LutronPi.Py:

C:\Python27>python lutronpi.py
Unable to connect via Telnet. Either you have a Standard bridge or you forgot to turn on Telnet in the Lutron app!
Unhandled Error
Traceback (most recent call last):
File “C:\Python27\lib\site-packages\twisted\internet\base.py”, line 428, in fireEvent
DeferredList(beforeResults).addCallback(self._continueFiring)
File “C:\Python27\lib\site-packages\twisted\internet\defer.py”, line 321, in addCallback
callbackKeywords=kw)
File “C:\Python27\lib\site-packages\twisted\internet\defer.py”, line 310, in addCallbacks
self._runCallbacks()
File “C:\Python27\lib\site-packages\twisted\internet\defer.py”, line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
— —
File “C:\Python27\lib\site-packages\twisted\internet\base.py”, line 441, in _continueFiring
callable(*args, **kwargs)
File “lutronpi.py”, line 405, in main
ssh = smartBridgeSSH()
File “lutronpi.py”, line 281, in init
self.client.connect(SMARTBRIDGE_IP, port, uname, None, key)
File “C:\Python27\lib\site-packages\paramiko\client.py”, line 305, in connect
retry_on_signal(lambda: sock.connect(addr))
File “C:\Python27\lib\site-packages\paramiko\util.py”, line 269, in retry_on_signal
return function()
File “C:\Python27\lib\site-packages\paramiko\client.py”, line 305, in
retry_on_signal(lambda: sock.connect(addr))
File “C:\Python27\lib\socket.py”, line 222, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Well you are very close. My guess is your IP address is wrong in the script. Did you update lines 32 and 33 with your IP addresses? Specifically line 33 because it is saying it cannot connect to your Lutron Bridge.

Do I need to edit any router settings? The only thing I changed was to assign the IP addresses for the Lutron and Smartthings hubs.

I was so hopeful that work would because I initially did not update lines 32 and 33. But it’s still giving me the same error! I edited lines 32, 33, 323, 397, and 398 with the appropriate IP addresses.

I just got mine installed this evening. I got that same exact error cause I edited the wrong Lutronpi.py file and not the one that I was supposed to run. You might want to double check. And the only place I changed the IP was in the first instance.

@jays is right. Only change those two lines at the top 32/33. Other than that, make sure you have the right IP address. Make sure your are saving and running the correct script.

You can do a little test and use something like putty to ensure that you are actually able to connect to your hub. Not sure what what I can tell you. I think you have a small error somewhere that we’re missing.