Lutron Caseta Interface

So can anyone say if the newest version of HA is still working with the custom component from @upsert? Been a while since I updated and feel I should probably update now.

Yea, still working great with the latest release

2 Likes

Thanks!
10char

I have updated the custom component with a potential fix for an issue where the state of switches is not retained after an upgrade or occasionally errors happen on restart.

If you are running the component, please update to the latest and post any feedback here or on the Github issue.

I have a python script to do the actual controls

    ###pico_control_light.py

entity_id = str(data.get(‘entity_id’))
action = data.get(‘action’)

states = hass.states.get(entity_id)
current_level = states.attributes.get(‘brightness’) or 0
if (action == “on”): # Turning lights on
data = { “entity_id” : entity_id, “brightness” : 255 }
hass.services.call(‘light’, ‘turn_on’, data)

elif (action == “off”): # Turning lights off
data = { “entity_id” : entity_id}
hass.services.call(‘light’, ‘turn_off’, data)

elif (action == “up”): # increase brightness
new_level = current_level + 51
data = { “entity_id” : entity_id, “brightness” : new_level }
hass.services.call(‘light’, ‘turn_on’, data)

elif (action == “down”): # decrease brightness
new_level = current_level - 51
data = { “entity_id” : entity_id, “brightness” : new_level }
hass.services.call(‘light’, ‘turn_on’, data)

elif (action == “fav”): # favorite /40% for now
data = { “entity_id” : entity_id, “brightness” : 100}
hass.services.call(‘light’, ‘turn_on’, data)

It’s called by the following from automations.yaml ( this could be improved but why fix what works…)
#### living room Hue pico ###########

Pico state codes

- On: 1

- Up: 8

- Fav: 2

- Down: 16

- Off: 4

  • alias: Living Room On
    initial_state: True
    hide_entity: True
    trigger:

    • platform: state
      entity_id: sensor.office_Pico_1
      to: ‘1’

    action:

    • service: python_script.pico_control_light #pico handling of hue lights
      data:
      entity_id: light.living_room
      action: “on”
  • alias: Living Room Off
    initial_state: True
    hide_entity: True
    trigger:

    • platform: state
      entity_id: sensor.office_Pico_1
      to: ‘4’
      action:
    • service: python_script.pico_control_light #pico handling of hue lights
      data:
      entity_id: light.living_room
      action: “off”
  • alias: Living Room Brighter
    initial_state: True
    hide_entity: True
    trigger:

    • platform: state
      entity_id: sensor.office_Pico_1
      to: ‘8’
      action:
    • service: python_script.pico_control_light #pico handling of hue lights
      data:
      entity_id: light.living_room
      action: “up”
  • alias: Living Room Dimmer
    initial_state: True
    hide_entity: True
    trigger:

    • platform: state
      entity_id: sensor.office_Pico_1
      to: ‘16’
      action:
    • service: python_script.pico_control_light #pico handling of hue lights
      data:
      entity_id: light.living_room
      action: “down”
  • alias: Living Room Favorite
    initial_state: True
    hide_entity: True
    trigger:

    • platform: state
      entity_id: sensor.office_Pico_1
      to: ‘2’
      action:
    • service: python_script.pico_control_light #pico handling of hue lights
      data:
      entity_id: light.living_room
      action: “fav”
1 Like

Yeah Python scripts are excellent for working with the powerful capabilities of the Pico remote… but FYI, you can remove all but one of your automations and have the same functionality you could trim that way down.

Just use Python variables in your script to store the integer values of the Pico sensors, you could eliminate all of your Automation code except for just one of them… saving tons of lines of automation code to manage.

#At the top of your Python script...
PICO_ON = 1
PICO_FAV = 2
PICO_OFF = 4
PICO_UP = 8
PICO_DOWN  = 16

I have mine working with one simple automation for each pico remote (vs a copy/paste automate for all 5 states for each remote), that calls one Python script to handle all the logic and various scenarios I want that remote to support.

Example Automation:

  #This controls the normal 5 Buttom Pico Dimmer Switch to sync up with the build in Lutron States!
  - alias: Living Room Caseta Pico Switch
    hide_entity: True
    trigger:
      #We want to Trigger on ANY state change, therefore no from/to value is specified
      platform: state
      entity_id: sensor.living_room_pico
    action:
      - service: python_script.pico_living_room_switch

###Python Script:

# Obtain status of the Pico Remote
pico_status = hass.states.get("sensor.living_room_pico")
pico_state_value = int(pico_status.state)

#DEBUG Notification via Pushover
#hass.services.call("notify", "pushover", {"message": "Living Room Pico Switch [Pico={0}]".format(pico_state_value)})

service_data = { "entity_id": "group.living_room_lamps" }

#NOTE: On button == 1 (Full ON)
#NOTE: Center scene button == 2 (Center Scene Button)
if pico_state_value == 1 or pico_state_value == 2:
	#For full ON state we set to 100% brightness
	service_data["brightness_pct"] = 100
	hass.services.call("light", "turn_on", service_data)

#NOTE: Off button == 4 (Full OFF)
elif pico_state_value == 4:
	#For full OFF state we turn the lights off
	hass.services.call("light", "turn_off", service_data)
2 Likes

Spotted a new filing on the FCC.

Looks like Lutron may grant the long-standing request for a fan speed controller on Caseta. Model PD-FSQN if the label is correct. Up to 1.5 amp ceiling fans.

May have to dust off my custom component for Smart Bridge Pro / Ra2 Select and add ‘fan’ platform support. There are fan controllers on Ra2 Select since launch but have not got around to it and I do not own a fan.

Hey upsert, I’m still using your custom component. Any interest in turning it into an official integration?

3 Likes

Ditto! Excellent component that I love dearly :wink: Making it official would be fantastic.

Is it possible to get the “Smart Away” scene into Home Assistant? I’d love to be able to toggle it in an automation when I’m on vacation.

I’ve accepted a pull request on my component and built on it to add full support for fan platform including set_speed and speed_list.

Also a minor potentially breaking change to make area_name, integration_id and scene_id attributes lowercase and snake case.

If I find more time I will try to make some kind of official component, but I don’t know what the timeline will be. I would need to make a library in PyPI which I have not done before and there are some things I would like to rewrite. I’d like to have it supported and configured through integrations in the front-end.

3 Likes

Any word on getting your work merged into HASS? Been holding off updating HASS waiting for this.

The custom component works fine up through the current versions of HASS.

That is good to know but I am running it in a docker which presents unique issues with adding custom components. I was going to try to carve out some time to setup HA on my computer and update all of my configs. Figure it is going to be a pretty big task since it has been almost a year since I updated.

I use hassio and run custom_components, I believe docker would be the same, you just add a custom_components folder into your config directory.

Except you have to commit it to the docker container otherwise the changes are lost. Just need to refamiliarize myself with docker and plow through it. Like I said it is mostly because of the config changes that I am putting this off. Also I used a different caseta component from jhanssen so that will need rebuilt along with my automations. It is good that they support custom components now, at the time we had to dump the files into the components folder.

Custom components don’t need to be committed into the container. They can just go in a custom_components folder in the same directory as your configuration.

Yes I think custom_components is newer than when I last updated. I am running 0.53.1

Well then, yes, if you upgrade (minding all of the potential breaking changes between 0.53 and now) you’ll have support for custom_components and those will persist through container changes. The upgrade is likely to take some effort, but the component installation is super easy and this Lutron component works very, very well.

Does this component work with the Lutron RA2 Main repeater “RR-MAIN-REP”, that is the non-Select version? From what I understand the interface is identical to the Select version and this component seems to have much better support for Picos and other devices.

I note that in one of the posts above, there is mention of issues with the integration report being in a different format, is that the “only” issue? Would getting a Lutron Connect Bridge make is work, I’d be happy to get one… (a bit desperate to ditch my Vera when hooking up Lutron RA2 to HA).

I have several RA2 Main systems is use, including shades, fans, keypads and what not; would be happy to test/debug.

Thank you.