I think this should be possible. I’m almost finished writing a Python script that talks to a very ancient Lutron HomeWorks panel via RS232 and presents it as an MQTT device. I haven’t integrated it into HA yet, but I am close.
For those not in the know about this old grand daddy from the 1990’s, the keypads, dimmers and switches have low voltage control cable wired back to the control panel.
I have the spec to talk to the Lutron hub. It is really quite simple. I am new to Python and even newer to HA. I am working on the code for it but, I don’t know how to get the pieces to integrate with any of the install scripts. The first piece that has to be placed in the virtual environment is the Python3.4 library “telnetlib.py” If anyone has experience with configuring the python for devices, I have the communications sequences. The cool part is being able to track button down and button up on the Pico remotes.
In the meantime, I am building this into my own system.
Unfortunately, I have major surgery next week so, don’t hold your breath on when I will have this done. Rest assured though, I will get this working (unless someone beats me to it.).
I believe that there will be some amazing features when I am done. Features that Wink isn’t even considering as far as I know. I have communicated with them about their new version, and I don’t see any improvements. They basically pair a Pico remote with a dimmer and then track whether the dimmer is off or on. I will have Pico remotes working independent of the dimmer and will be able to trigger anything as an independent switch. I can even detect depress and release of each switch so, there will be toggle actions that even Lutron doesn’t do.
Talking to the Lutron hub code is done. I just have to figure out how to initiate discovery and process asynchronous events. I really think the developers documentation could use a lot of work. I am trying things out but this doesn’t appear real obvious to me. I am reverse engineering the z-wave device operations to figure out how I need to code the Lutron.
I am trying to figure out how to use the helper services to:
set discovery by polling for devices and waiting for a device not in the database to be touched.
track asynchronous events (switch touched lights on) by frequently sampling my routines to see if a new event is present.
add the ability to send an event to a light (turn on, dim, etc.)
I have more studying to do and am setting a two development environments. One in a Lunux VM to edit and work on the code and that is working smoothly. The second is a docker test environment on a RPI3. Still working on that and items 1,2,and 3. The Lutron stuff if super easy. If anyone has better documentation or straight forward examples of a switch, light and discovery, that would be great.
I did some research as I wanted to write a plugin for HA but I’m busy working on a better Insteon one and I don’t have the money right now to buy the Lutron stuff
So hopefully these will be helpful to you:
(note that the caseta stuff uses the same commands as RadioRA)
And I’d recommend you try to incorporate this third party library instead of rolling your own, since that seems to be the preferred Home Assistant way:
You didn’t seem to understand what I wrote. I already have the Lutron Caseta library written (it is just a matter of how it is used). The Lutron side is easy as the spec is known. It is the HA side that I am having problems with. Also, that third party API is missing a key components that I have already written and it is under developed as it is designed for a Wink which, in my opinion, missed a lot of the functionality in that it does not read the Pico remotes as one can with the Caseta Pro hub. Wink has a single function accessible with caseta, which is the on or off state of a light.
My code will not require any third party API. I feel that that is a weakness in the HA design.
Lutron Caseta support is a little closer. I have the interrogation loop on the hub working in HA and I can send commands. I have some cleanup and error handling to do and then add command processing then light and switch controls. The last parts should be easy. The hardest time was the learning of the event loop structure and commands as well as the python libraries used.
I’ve been following this thread for about a month as I’ve been deciding what platform to pursue. Caseta support for Home-assistant is must. I just wanted to pre-thankyou for your hard work.
I didn’t realize that work was already being done for caseta/ha integration. I could not find any GitHub repos specifically for HA integration or else I would have just contrubuted there. Here is my work: https://github.com/home-assistant/home-assistant/pull/6631
Current:
-Discovers devices connected to the smartbridge.
-Sets up wall dimmers as lights.
Future:
-Support additional devices as appropriate in HA
-Push notification (no polling)
I am currently working with the maintainers to have it included.
I am not sure about the non-pro bridge. I believe that mine is a pro. Can you help me? Does your lutron mobile app give you the option to turn telnet on?
Lutron mobile app > settings (gear icon) > Advanced > Integration > telnet support checkbox
Can you toggle the checkbox if it is there? If so this should work.