I might be the only one that is struggling with enabling the lutron caseta to home assistant, but just in case other newbies are experiencing the same issues, I decided to document my journey, which has not ended yet
One of the mistakes I made with the directions mentioned in the get_lutron_cert.py
script is:
- that I did not understand where I was in the directory path using the e.g. the putty terminal. I installed HASSBIAN and I am loging in with the ‘PI’ user id. This is NOT the directory path where home assistant is located.
cd /
brings you to the root and from therefore you can go up the tree to homeassistant. (there are 2 directories for homeassistant. The 2nd one .homeassistant is where the files are.
- Run the
get_lutron_cert.py
in a directory where the user you logged on with (in putty), has write permission. In my case I logged on with ‘PI’, but homeassistant had the write permission to the folder and this resulted in the permission error in the above post. Run ls -l
to check the permission and I used sudo -u homeassistant -H -s
to resolve that issue (thank you Matthew Donoughe).
- After you login to the Lutron WEBUI, get the error, copy-past the URL into the terminal and enter the IPaddress of the caseta hub, you should get the message that ‘a successful connection to your hub’ (Don’t celebrate too early, because you are not there yet)
4.1 the 3 files are in the directory from which you execute the get_lutron_cert.py
command and at this moment I am still not clear where to copy these files to. The documentation states 'Once you have the three necessary files, place them in your configuration directory. (I believe that the 'configuration directory is the directory where e.g. configuration.yaml is located, but I am not sure)
4.2. update the configuration.yaml file with the lutron_caseta:
entries (see the Lutron Caseta documentio at the home assistant website.
After hours of trial and error and multiple emails to Matthew, I still don’t have the Lutron caseta working (invalid config) error in home assistant with the following errors in the log. I’ll update my post if I eventually get it to work, but I might have to bite the bullet and switch to the Pro version of the bridge, because this way too time consuming.
LOG:
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py”, line 145, in _async_setup_component
hass, processed_config)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/lutron_caseta.py”, line 55, in async_setup
await bridge.connect()
File “/srv/homeassistant/lib/python3.5/site-packages/pylutron_caseta/smartbridge.py”, line 40, in connect
yield from self._login()
File “/srv/homeassistant/lib/python3.5/site-packages/pylutron_caseta/smartbridge.py”, line 281, in _login
self._reader, self._writer = yield from self._connect()
File “/srv/homeassistant/lib/python3.5/site-packages/pylutron_caseta/smartbridge.py”, line 58, in _connect
family=socket.AF_INET)
File “/srv/homeassistant/lib/python3.5/site-packages/pylutron_caseta/leap.py”, line 16, in open_connection
limit=limit, **kwds)
File “/usr/lib/python3.5/asyncio/streams.py”, line 75, in open_connection
lambda: protocol, host, port, **kwds)
File “/usr/lib/python3.5/asyncio/base_events.py”, line 801, in create_connection
sock, protocol_factory, ssl, server_hostname)
File “/usr/lib/python3.5/asyncio/base_events.py”, line 827, in _create_connection_transport
yield from waiter
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/asyncio/sslproto.py”, line 502, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File “/usr/lib/python3.5/asyncio/sslproto.py”, line 201, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 641, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)