Core: Lutron_Caseta component setup fails with Hassbian 0.73.1

Created on 11 Jul 2018  ·  25Comments  ·  Source: home-assistant/core

Home Assistant release with the issue:
Hassbian 0.73.1 (another comment to this issue below is reporting the same with 0.73.1 with HASSIO)

Last working Home Assistant release (if known):
this is my first Hassbian installation

Operating environment (Hass.io/Docker/Windows/etc.):
HASSBIAN, Raspberry Pi 3b+, downloaded image at this link: https://github.com/home-assistant/pi-gen/releases/tag/v.1.3.2 (image_2018-03-16-Hassbian.zip) Note that a subsequent comment is reporting this also with HASSIO

Component/platform:
lutron_Caseta

Description of problem:

Getting invalid config card. Hass will not setup the component at start up and none of my Lutron light switches are set up and operable with Hass

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
Here is my config'.yaml entry:

lutron_caseta:
    host: MY_IP_ADDRESS
    keyfile: caseta.key
    certfile: caseta.crt
    ca_certs: caseta-bridge.crt

(this config worked fine in a trial docker container)

Traceback (if applicable):

Tue Jul 10 2018 19:50:27 GMT-0400 (Eastern Daylight Time)

Error during setup of component lutron_caseta
Traceback (most recent call last):
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py”, line 143, in _async_setup_component
    hass, processed_config)
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/lutron_caseta.py”, line 57, in async_setup
    yield from 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)

Additional information:

lutron_caseta stale

Most helpful comment

quick fix :
in [ /srv/hass/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py ] line 50 :
ssl_context.verify_mode = ssl.CERT_NONE

instead of
ssl_context.verify_mode = ssl.CERT_REQUIRED

All 25 comments

Same for me after restarting home assistant 0.72.1, work well before....

I try to generate a new certificate.... the problem still persist.

Same for me. New cert did not avail. The same config and certs work on a docker instance, so it is not a problem with the caseta files.

:/tmp/lutron# python3 get_lutron_cert.py 
Enter the address of your Caseta bridge device: 192.168.0.77
Traceback (most recent call last):
  File "get_lutron_cert.py", line 137, in <module>
    ssl_socket.connect((server_addr, 8081))
  File "/usr/lib/python3.4/ssl.py", line 840, in connect
    self._real_connect(addr, False)
  File "/usr/lib/python3.4/ssl.py", line 827, in _real_connect
    socket.connect(self, addr)
ConnectionRefusedError: [Errno 111] Connection refused

I am having a similar issue, running this on Hass.io. After recent restart just restart, running 0.73.1. I now get the “Invalid Config” card. Here are my log entries.

Log Details (ERROR)
Tue Jul 10 2018 22:10:54 GMT-0400 (Eastern Daylight Time)

Error during setup of component lutron_caseta
Traceback (most recent call last):
  File “/usr/lib/python3.6/site-packages/homeassistant/setup.py”, line 143, in _async_setup_component
    hass, processed_config)
  File “/usr/lib/python3.6/site-packages/homeassistant/components/lutron_caseta.py”, line 57, in async_setup
    yield from bridge.connect()
  File “/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py”, line 40, in connect
    yield from self._login()
  File “/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py”, line 281, in _login
    self._reader, self._writer = yield from self._connect()
  File “/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py”, line 58, in _connect
    family=socket.AF_INET)
  File “/usr/lib/python3.6/site-packages/pylutron_caseta/leap.py”, line 16, in open_connection
    limit=limit, **kwds)
  File “/usr/lib/python3.6/asyncio/streams.py”, line 75, in open_connection
    lambda: protocol, host, port, **kwds)
  File “uvloop/loop.pyx”, line 1877, in create_connection
  File “uvloop/loop.pyx”, line 1874, in uvloop.loop.Loop.create_connection
  File “uvloop/sslproto.pyx”, line 497, in uvloop.loop.SSLProtocol.data_received
  File “uvloop/sslproto.pyx”, line 204, in uvloop.loop._SSLPipe.feed_ssldata
  File “uvloop/sslproto.pyx”, line 171, in uvloop.loop._SSLPipe.feed_ssldata
  File “/usr/lib/python3.6/ssl.py”, line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

im getting the same issue on a venv install on fedora 28

quick fix :
in [ /srv/hass/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py ] line 50 :
ssl_context.verify_mode = ssl.CERT_NONE

instead of
ssl_context.verify_mode = ssl.CERT_REQUIRED

In the Hassbian image for my installation, pathing is a little different as
I have python 3.5, but the using "NONE" did in fact bring my Smart Bridge
controls back. Thanks for posting a workaround.

[/srv/homeassistant/lib/python3.5/site-packages/pylutron_caseta/smartbridge.py],
changed line 50 to ...

ssl_context.verify_mode = ssl.CERT_NONE (OPTIONAL did not work in my
case)

On Thu, Jul 12, 2018 at 10:32 PM Patrick Halley notifications@github.com
wrote:

quick fix :
in [ /srv/hass/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py
] line 50 :
ssl_context.verify_mode = ssl.CERT_OPTIONAL

instead of
ssl_context.verify_mode = ssl.CERT_REQUIRED


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/15421#issuecomment-404707225,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AnN8raF1yjc1IPnVr_WqEovDgPLryqB5ks5uGAawgaJpZM4VLc45
.

CERT_OPTIONAL work one time for me.... and after a restart, it's did the same error.... so i try NONE.

It's probably not the best thing to do... Lutron must have change something about their certificate...

I have the same issue with hass.io 0.73.1. Where can I find the smartbridge.py file in a hass.io instance?

Same here for 73.1 on hass.io. Thought upgrading from .72 would fix, but still not working.

You have to get access to python files inside the container that running home assistant....
Maybe this link will help you : https://developers.home-assistant.io/docs/en/hassio_debugging.html

* UPDATE 2018-07-17 on hass.io 0.73.2 *
Lutron Caseta now connected without any issues. Seems to be fixed via the latest update.

#

0.73.1 hass.io on Intel NUC
Resin OS 2.3.0+rev1

Worked on last version of hass.io, I may load the previous snapshot to verify again.
Current errors on 0.73.1:

Error doing job: SSL handshake failed
Traceback (most recent call last):
  File "uvloop/sslproto.pyx", line 593, in uvloop.loop.SSLProtocol._on_handshake_complete
  File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
Error doing job: SSL error errno:1 reason: CERTIFICATE_VERIFY_FAILED
Traceback (most recent call last):
  File "uvloop/sslproto.pyx", line 497, in uvloop.loop.SSLProtocol.data_received
  File "uvloop/sslproto.pyx", line 204, in uvloop.loop._SSLPipe.feed_ssldata
  File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
Error during setup of component lutron_caseta
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 143, in _async_setup_component
    hass, processed_config)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/lutron_caseta.py", line 57, in async_setup
    yield from bridge.connect()
  File "/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py", line 40, in connect
    yield from self._login()
  File "/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py", line 281, in _login
    self._reader, self._writer = yield from self._connect()
  File "/usr/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py", line 58, in _connect
    family=socket.AF_INET)
  File "/usr/lib/python3.6/site-packages/pylutron_caseta/leap.py", line 16, in open_connection
    limit=limit, **kwds)
  File "/usr/lib/python3.6/asyncio/streams.py", line 75, in open_connection
    lambda: protocol, host, port, **kwds)
  File "uvloop/loop.pyx", line 1877, in create_connection
  File "uvloop/loop.pyx", line 1874, in uvloop.loop.Loop.create_connection
  File "uvloop/sslproto.pyx", line 497, in uvloop.loop.SSLProtocol.data_received
  File "uvloop/sslproto.pyx", line 204, in uvloop.loop._SSLPipe.feed_ssldata
  File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

After the update to 0.73.2, I'm getting the same error:

018-07-19 15:43:19 ERROR (MainThread) [homeassistant.setup] Error during setup of component lutron_caseta
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 143, in _async_setup_component
    hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/lutron_caseta.py", line 57, in async_setup
    yield from 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)

so I don't think it's fixed in that release. However, changing the verify_mode in smartbridge.py did fix the problem.

upstream issue: gurumitts/pylutron-caseta#28

I have the same issue reported here. I just updated to 0.74.0 and my Lutron stopped working. The error was the same certificate error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720).
I am running Hassbian, after regenerating the certificates 3 times, I decided to modify the smartbridge.py as recommended by @mrsnyds . I got it to work. I am using a Lutron Standard Bridge. I really do not know what to do to get it to work again with the certificates. Any help or guidance is highly appreciated.

gurumitts/pylutron-caseta#29 should fix it with the certificates still used. There's some explanation of the problem there. I'm not sure why people are seeing it appear and disappear when switching between versions of Home Assistant, but that should fix it.

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

I still see this issue on latest (0.82.1), requiring me to change CERT_REQUIRED to CERT_NONE to get it to work.

There was a fix in pylutron-caseta, but there hasn't been a new release including it. Interestingly, only some people seem to have this problem.

I'm also seeing this on a manual install on Raspbian running version 82. Using CERT_NONE as a workaround here. This issue does NOT however occur when running HA on my mac mini.

I just upgraded both hassbian and home assistant and the issue still exists. Running on a raspberry pi 3, with hassbian 4.14.79-v7+ #1159 , and home assistant 0.82.1.

I'm also seeing this on a manual install on Raspbian running version 82. Using CERT_NONE as a workaround here. This issue does NOT however occur when running HA on my mac mini.

I'm just starting to setup homeassistant and I'm seeing this certification verification failure as well. How exactly do I work around this?

quick fix :
in [ /srv/hass/lib/python3.6/site-packages/pylutron_caseta/smartbridge.py ] line 50 :
ssl_context.verify_mode = ssl.CERT_NONE

instead of
ssl_context.verify_mode = ssl.CERT_REQUIRED

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piitaya picture piitaya  ·  3Comments

i-am-shodan picture i-am-shodan  ·  3Comments

kirichkov picture kirichkov  ·  3Comments

missedtheapex picture missedtheapex  ·  3Comments

moskovskiy82 picture moskovskiy82  ·  3Comments