Lutron -

I am not a programmer but I try and follow instructions the best that I can. I have the Lutron_Caseta installed in my home and trying to set up hassbian. I downloaded the python script I uncommented the lines:
keyfile: caseta.keypython
certfile: caseta.crt
ca_certs: caseta-bridge.crt

(2 spaces before each line). That is the IP address of my Lutron Hub. when I run
python then I get:

root@hassbian:/home/homeassistant/.homeassistant# python
File “”, line 18

IndentationError: unexpected indent

I have tried this without any indenting and I get:

root@hassbian:/home/homeassistant/.homeassistant# python
File “”, line 18
SyntaxError: invalid syntax

Could someone tell me if this is the way I should run this and what my probably is?

Thanks very much.

I should have mentioned my version: Home Assistant

You aren’t meant to uncomment those lines in the python script. Those comments at the beginning are just telling you how to set up a venv with the script prereqs and then also how to add the component to your Home Assistant configuration.yaml. Recomment those lines and run the script again.

Thank you for your help. I nuked my modified file and downloaded again so it’s original.

I run it now like:

sudo python and I get:

pi@hassbian:/home/homeassistant/.homeassistant$ sudo python
Traceback (most recent call last):
File “”, line 25, in
import requests
ImportError: No module named requests

Line 25 states:

import requests

Any suggestions as to where I go from here?

Thanks again.

Yes - you need to follow the other instructions at the top of the py file. Do this:

  1. Move the py file into a directory.
  2. python3 -m venv [directory]
  3. source [directory]/bin/activate
  4. pip install cryptography==2.1.3 requests==2.18.4
  5. cd [directory]
  6. python

Thanks for those excellent directions. I got through it ok until line # 6.I am sure I missed something that you were telling me.

I got a "Open Browser and login at https://XXXXX
Enter the URL (of the “error” page you got redirected to (or code in the URL).
I put the code in the https:// line
and got back “Enter the address of your Caseta bridge device” I put that in and then got:

Enter the address of your Caseta bridge device:
Traceback (most recent call last):
File “”, line 156, in
KeyError: ‘Body’
(.homeassistant) root@hassbian:/home/homeassistant/.homeassistant#

Once I got the “Enter the ip address:” I thought it was going to work for me.

Or maybe it did?

I now have:

So it appears it works as expected?

Thank you so much for all of your help. I hope this help others as well. I don’t mean to be stupid, but I am trying to learn how to do this and again I appreciate all of your help.

I just verified that I now how what I needed and re-ran the configuration and now I have the lutron devices in hassbian

Thank you kindly, Marthocoo for your time and consideration in the help. I am so grateful.

This is awesome. I would have never figured it out without your help.


1 Like