I am trying to revitalize my Lutron Caseta within HA again, which broke due to a firmware upgrade distributed by Lutron a few weeks ago. Here are the instructions copied from the latest HA component description:
To use Lutron Caseta devices in your installation, you must first log in to your Lutron account and generate a certificate that allows Home Assistant to connect to your bridge. This can be accomplished by downloading and executing this script, which will generate three files: caseta.key, caseta.crt, caseta-bridge.crt when you run it. See the instructions at the top of the script for more information.
I really have problems, guess because I have so little understanding how this should work.
_âYou must first log in to your Lutron accountâ: Which account? I have a Lutron app on my Android connecting to Lutron and controlling the Caseta devices. This is a smartphone app only, and according to Lutron customer service there is no way to connect to the Caseta system using a PC or Unix device. Lutronâs website shows that there is a âMy Lutronâ account, but I donât have one and according to Lutron customer service this account is used for distributors and resellers and needs Lutron approval. So what should I do?
âThis can be accomplished by downloading and executing this scriptâ: I downloaded the script and could not find instructions. However, the script seems to be configured for a very specific style of configuration. Running the script on my pi results in many ânot foundâ errors (not surprising as I am not logged in any Lutron account), but I also think it would not work for my configuration as there are certain paths in the script that I doubt would be valid in my case.
Anyway, as you can see I am totally clueless what to do. Any advice or clarification anyone could provide?
I also can not get this to work, I installed Python on windows. When i run the script i keep getting multiple errors. Right now i am stuck @ this error.
Traceback (most recent call last):
File âC:\get_lutron_cert\get_lutron_cert.pyâ, line 29, in
from cryptography import x509
ImportError: No module named cryptography
Okay, my account credentials for the Lutron app on my smartphone are â[email protected] / passwordâ.
How or where do I connect to the Lutron app so I can run the script? As far as I know there is no windows or linux client for the Lutron bridge. I also do not see a place in the script to supply my credentials.
I am at a total loss. I just do not understand how I can log in into a Lutron account (other than through the Lutron app on my phone).
Is there somebody out there who can explain what I have to do to âlog inâ?
I was able to successfully run this on a raspberry pi. I copied the script to my home folder. Then I ran the command:
python3 -m venv lutron-env
Note: at least on my pi, running python, rather than python3 complained that the venv module didnât exist. Running python3 fixed that.
Note2: I chose to name the resultant virtual environment lutron-env so I could tell the difference between it and other virtual environment projects I run.
After that I ran: source ./lutron-env/bin/activate pip install cryptography==2.1.3 requests==2.18.4 python3 get_lutron_cert.py
Then the script asked me to copy a link it generated and paste it into a web browser. What happened at that point is that the lutron site asked me to sign in with my lutron account credentials.
After signing in, it took me to a page that had a message showing indicating âthe page you were looking for does not existâ. HOWEVER, the script indicated that I should copy THAT link (of the error page), and paste it back to the waiting script.
Once I did that, it asked for the local IP address of the hub. Once I provided the IP, it successfully completed generating the key and two cert files. I placed them in the .homeassistant directory, added the lines to configuration.yaml, restarted and my lutron switches were working again (In fact I even did not have to redo groups, they just worked again).
Hope sharing my experience helps someone get it going. I have no Windows environment on which to test, but my understanding is that if you have home-assistant running, you should have the ability to run the script in the same environment.
I was also able to get this working. I spun up a fresh install of Ubuntu in VM. I ran the Python script with âPython3 get_lutron_cert.pyâ. I was not able to get it to work just running the script âPython get_lutron_cert.pyâ.
I tried following your example, which was going great, until I got to installing cryptography.
Iâts showing the following error, any ideas?
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-j7vd07be/cryptography
Storing debug log for failure in /home/pi/.pip/pip.log
When I run âpython get_lutron_cert.pyâ
I get the following error:
Traceback (most recent call last):
File "get_lutron_cert.py", line 25, in <module>
import requests
ImportError: No module named 'requests'
The second error is probably because the pip install command didnât complete, so that has to be fixed first. Did the virtual environment activate properly? You would see (lutron-env) at the start of the command line prompt if so, assuming youâre following my example. Can you post the pip.log?
Just in case it matters, Iâm on an up-to-date Raspbian Stretch running the home-assistant virtual environment install, not hassbian. I had also recently done sudo apt-get update sudo apt-get upgrade
Googling the error suggests that setuptools might need to be updated? This is a little out of my wheelhouse and I donât want to recommend anything that could break other things in your install.
Thank you thank you thank you!
I was able to get up an running reading the process you describe. I had the impression I needed to somehow log into the Lutron account and then run the script, until you showed that running the script will prompt to log into the account!
A few remarks for my specific case:
I ran the script on my âtest-piâ which has Stretch / Python 3 installed.
Installing cryptography errorred out until I installed libevent-dev, and also (virtual environment enabled)
pip install cffi
After that cryptography was installed successfully.
Finally running the script
python3 get_lutron_cert.py
did as you described above, prompted to paste a url in a browser, which opened a Lutron log in page, which resulted in an error page, I pasted the url of the error page to the terminal window running the script, supplied the local IP address of my Lutron bridge, and the script generated the 3 files (key and 2 cert) which I copied over to my production Pi running Home Assistant. Updating the configuration.yaml completed the setup, and -voila- Home Assistant can control my Lutron switches and dimmers again!
Thank you so much for your help, I really appreciate that!
You were dead on, I ran âpip3 install --upgrade setuptoolsâ and all went well untill I ran âpython get_lutron_cert.pyâ it gave the following error.
Traceback (most recent call last):
File "get_lutron_cert.py", line 29, in <module>
from cryptography import x509
File "/home/pi/env/lib/python3.4/site-packages/cryptography/x509/__init__.py", line 8, in <module>
from cryptography.x509.base import (
File "/home/pi/env/lib/python3.4/site-packages/cryptography/x509/base.py", line 16, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/home/pi/env/lib/python3.4/site-packages/cryptography/x509/extensions.py", line 18, in <module>
from cryptography.hazmat.primitives import constant_time, serialization
File "/home/pi/env/lib/python3.4/site-packages/cryptography/hazmat/primitives/constant_time.py", line 9, in <module>
from cryptography.hazmat.bindings._constant_time import lib
ImportError: No module named '_cffi_backend'
Finally got Caseta working again with @cssbhome additional step.
python3 -m venv env
source ./env/bin/activate
pip install cffi
pip install cryptography==2.1.3 requests==2.18.4
python3 get_lutron_cert.py
After it successfully generated the key and cert files, I moved the key and certs to my .homeassistant directory, adjusted my config, rebooted, and what do know, up and running.
Iâm getting the same error. Was sooo close! Actually, just before the error you mentioned, I get this text:
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fid2r96r/cffi/
Crazy enough, I had all this working on the temporary lutron fix before this was released in .58. But it seems my files from that time donât work with the released code for some reason so Iâm trying to get this script working again. Appreciate any help available.