Lutron Caseta - invalid config

I’m trying to configure the Lutron Caseta component. It looks so straightforward… I see the following in homeassistant.log when HA starts:

17-04-18 23:11:30 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 192, in _async_setup_component
    None, component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/lutron_caseta.py", line 46, in setup
    password=config[CONF_PASSWORD]
  File "/etc/homeassistant/deps/pylutron_caseta/smartbridge.py", line 36, in __init__
    self._login()
  File "/etc/homeassistant/deps/pylutron_caseta/smartbridge.py", line 130, in _login
    self._telnet = telnetlib.Telnet(self._hostname, 23, timeout=2)
  File "/usr/lib/python3.5/telnetlib.py", line 218, in __init__
    self.open(host, port, timeout)
  File "/usr/lib/python3.5/telnetlib.py", line 234, in open
    self.sock = socket.create_connection((host, port), timeout)
  File "/usr/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/usr/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The frontend shows:

Invalid Config
The following components and platforms could not be set up:
• lutron-caseta
Please check your config

My configuration.yaml files has the following in it:

lutron_caseta:
  host: 192.168.2.121
  username: lutron
  password: integration

Anyone know how to sort this out?

Looks like the connection timed out. This can happen if the IP address is incorrect or you have a hub that doesn’t support telnet. Only the caseta ‘pro’ hub/smartbridge support telnet. Can you confirm you have a pro?

nmap scan shows ports 22, 8081, 8083 open, but not port 23… Likely no telnet. :frowning:

How can I identify if it is not a pro for sure?

nmap output is a pretty good indicator. If you can set the logs debug. You should see some output from a smartbridge class listing all the devices it found. Look for one similar to:

17-04-18 18:56:28 DEBUG (Thread-1) [smartbridge] {'Parent': {'href': '/project'}, 'SerialNumber': 32506946, 'ModelNumber': 'L-BDGPRO2-WH', 'RepeaterProperties': {'IsRepeater': True}, 'DeviceType': 'SmartBridge', 'Name': 'Smart Bridge', 'href': '/device/1'}

The ModelNumber for pro looks like: L-BDGPRO2-WH

Looks like this:

17-04-18 23:45:28 DEBUG (Thread-6) [smartbridge] {'href': '/device/1', 'SerialNumber': 31807678, 'DeviceType': 'SmartBridge', 'Parent': {'href': '/project'}, 'RepeaterProperties': {'IsRepeater': True}, 'Name': 'Smart Bridge', 'ModelNumber': 'L-BDG2-WH'}

No PRO in the model number. :frowning:

I don’t have a non pro bridge but I recently changed this component to use only SSH. I made this change for other reasons but I hope that it may work for you as well:

Interesting… I see that your PR is merged. Can I test this now or should I wait for the next release of homeassistant?

That is up to you. If you can do it without affecting you day to day setup you are more than welcome to. If you wait the upgrade process is fairly simple. If you do happen to test it out can you let me know your results please?

I’m willing to try, but I’m not sure how to run the version with your update. It’s after midnight here and I have to sleep. :slight_smile:

I can try tomorrow, if I can figure out how to update to the pre-release version. I may have to wait for the release as it is so simple to update a released version and I have limited time to work on this right now.

Either way, I’ll report back here on how it works for me.

I upgraded to version 0.43 today and lutron_caseta component is working great!

Thank you!

:slight_smile:

Awesome! I’m glad that worked for you. If you don’t mind can you tell me how many devices you are using with your hub and if they are all working as you expect with homeassistant.

I appreciate the help. Thanks!

i installed 4 dimmers and four remotes with one hub.

The dimmers were all discovered and work exactly as I expected they would.

Thanks for this!

G.

1 Like

@gurumitts Have you seen that a few people (myself included) are having issues with their non-pro caseta hubs recently.

It looks like ssh is not accepting the credentials anymore. I wonder if you have any insight.

@gurumitts

This really sucks… How did you get the previous key? Was it that you simply had access to it via the pro hubs?

I hate that I have to launch the caseta app to turn off my kitchen lights and my automations don’t work anymore. :frowning:

I found the Key in on another git hub project. I am really sorry that this happened. I liked the LEAP ssh integration as it did not require any additional files and worked with both pro and non-pro bridges.

I hope we can find an acceptable way forward.

I hope so too!

I’m using @jhn’s code because I have a “Pro” bridge and I like to be able to use Pico remotes for things other than Lutron switches/dimmers. But I’d love to see a common component that supports both bridges, even if there isn’t feature parity.

@gurumitts I don’t think you have anything to apologize for – your component worked great and this is just Lutron enforcing its market segmentation, unfortunately.

1 Like

Is there any chance you could do a simple write up of how you got @jhn code to work? I have a pro hub and spent some time today trying to get it going, but no luck. I put his components into custom_components and created the caseta_ip address.json, but I wasn’t successful. Perhaps it’s because I’m using hass.io?

I’d be interested in that write up too!

My Pro hub should be here in a few days.

It’s not so much a writeup, but I’ll tell you this: I couldn’t get it to work in custom_components either. So I just copy the necessary files from the github repository (the caseta-0.40 branch specifically):

… to the appropriate directories in my home-assistant installation. On my system, which uses Docker, it looks like this:

docker exec -t home-assistant mkdir /usr/src/app/homeassistant/components/caseta
docker cp /data/hd/home-assistant/casetapro/__init__.py home-assistant:/usr/src/app/homeassistant/components/caseta/__init__.py
docker cp /data/hd/home-assistant/casetapro/casetify.py home-assistant:/usr/src/app/homeassistant/components/caseta/casetify.py
docker cp /data/hd/home-assistant/casetapro/light-caseta.py home-assistant:/usr/src/app/homeassistant/components/light/caseta.py
docker cp /data/hd/home-assistant/casetapro/sensor-caseta.py home-assistant:/usr/src/app/homeassistant/components/sensor/caseta.py
docker cp /data/hd/home-assistant/casetapro/switch-caseta.py home-assistant:/usr/src/app/homeassistant/components/switch/caseta.py

You only need those five files, and I just keep them on my local system in the casetapro directory and use a script to inject them into my docker container every time I upgrade Hass. There’s no need to edit any of the files; just copying them over is enough.

Then set up your configuration.yaml per this component’s requirements. In my case again:

caseta:
  bridges:
    - host: 192.168.x.y
      devices:
        - id: 2
          type: switch
        - id: 3
          type: switch
        - id: 4
          type: switch
        - id: 5
          type: switch

You have to manually identify your on/off switches as such or everything will be treated as as a dimmer.

Finally, you need to export an integration report from the iOS app (or equivalent) and put it in your home-assistant configuration directory as caseta_192.168.x.y.json

Then off you go!

I don’t use hass.io so I don’t know what the process would be there, and I also wonder if this component will stop working at some point. It doesn’t seem to be under development currently.

But it does work perfectly now, and it does make Pico remotes visible as sensors that can be used for any purpose, so big thumbs up from me.

2 Likes