Modify pylutron

OK, I will try this when I get home in about an hour.

Just to confirm, am I installing any integration or am I just adding it to my config like here:

Also, I have used telnet on HomeWorks before to send a command to telnet to IR converter. When sending a command to Hassio how am I listening for it in Hassio? Is there any documents with what commands In can send? Need to create 2-3 triggers that send to Hassio so Hassio can begin an automation when it see each of these.

You are just adding a config entry just like your illustration. But, be sure you can edit your config externally from Hassio in case adding the entry hangs during Hassio startup which was happening prior to 0.101

The Lutron component uses telnet to login into your Lutron QS controller then it gets the mappings/commands to your Lutron Devices and sets up entities (like lights) in Hassio. You control the Lutron lights like any other light in Hassio. An automation can monitor a Lutron light to trigger an action or the automation can take an action on a Lutron light. I only have lights and keypads on my Lutron QS so I’m unsure what other Lutron QS devices will be created and controllable in Hassio.

OK, wow that was easy! Thank you. I already have Lutron goodnight button triggering my SONOS to turn off all rooms. In coding that I was wondering if there is a wild card I can use to turn off all SONOS rooms or do I need to list them all as I have to get it to work so far. Using a wildcard would be better so if you add rooms or change names it won’t break the automation.

Have you been able to monitor a Lutron keypad for a button press in an automation like they show in the example here at the bottom of the page: https://www.home-assistant.io/integrations/lutron/

I’m not sure if my system is being the button press on the lutron keypad or I just don’t have the naming of the keypad and button in right.

I have not tried before your post. I did try lutron_event after seeing your post but have been unable to make it work. By using telnet to monitor, I can see that the keypad button press is being communicated (as is the led button) but I don’t think the pylutron component is monitoring it since these actions are coming in as DEVICE instead of OUTPUT. OUTPUT commands are successfully sent and received using the pylutron component.

UPDATE:
My Homeworks QS system uses HWI_SLIM keypads. Adding HWI_SLIM to the list does create scenes for a certain type of button: ButtonType="SingleAction" . The majority of my buttons are ButtonType="AdvancedToggle" and these don’t show up as scenes in HA. I have not yet been able to get the right ( id: name / action: single/pressed ) combination to successfully get the lutron_event to simulate a button press on any type of my keypad buttons. However, I can turn_on a scene for the single action buttons.

1 Like

What are you using to monitor TELNET. Would be interested is seeing that. I was wondering if the I have the id’s correct and that would help.

Do you think we can’t read it because we are on QS and not RA. Does RA send a different event?

I also found this: Adding Lutron keypad support, unsure about how to model buttons

But I can not get it to work either. Have you tried this?

hi,

i am about to do the same with lutron homeworks QS can i am a very beginner but i have good understanding can you please provide me steps that you did to integrate it with HAssio i am gonna put a new clean install on RPI 3B+

Thanks in advance

To control and monitor the lights connected to QS, just 1) make sure you can telnet into the QS system and 2) add the lutron component into your configuration.yaml file following these instruction: https://www.home-assistant.io/integrations/lutron/

Let me know if you need additional assistance

hi, thank you for your quick reply, can you tell me way to connect to telnet is there a special cable required like usb to serial ? also the link you provided says its for radiora series i checked this says for series 4 and 5 https://www.home-assistant.io/integrations/homeworks/

so what component should be used sorry for reconfirming -

first i am gonna find the ip of home works
next i am gonna try telnet into it - is there a standard admin username or password for telnet ? i am fairly new and the lutron system was setup by professionals here my country

TIA

You can use a computer to Telnet into the Homeworks QS processor, so long as it’s on the same network. Below is a link to install Telnet:

https://social.technet.microsoft.com/wiki/contents/articles/38433.windows-10-enabling-telnet-client.aspx

As you stated, you’ll need to find the IP address of the Homeworks QS processor. You can find this in your router’s configuration page. As for the Telnet login, you’ll need to request this from whomever setup the Homeworks QS system. I believe the default login used to be:

username: lutron
password: integration

You can try those two, but it may not work.

Hi. I have been working with a HassOS on a VM and several integrations flawlessly for a few months now. The only problem I have had is with the Lutron Homeworks QS. Everything mapped pretty well and seems to respond, except a few scenes (probably incompatible keypads), but the problem is that HA stops talking to Lutron every once in a while. The logs indicate a disconnect every minute or so, and “monitoring” Telnet messages it doesn’t recognize. Both the HA server and the Lutron equipment are on cable. I get the same behavior many people have mentioned, where it stops updating light states, and after toggling something it goes back, as if it didn’t get a good response from Lutron. I also tried changing the state directly or calling a toggle or on/off service, with no success, until a restart happens. Since my installation doesn’t seem to get me easy access to pylutron file I am considering:

  • Using manual telnet messages (might work but it would be alot of work to sniff all of them and code them into switches)
  • Finding a way to access the files, even though from what I understand the change from GNET to QNET is no longer needed…
  • Trying another installation of HA where I can access the needed files
  • Switching users with a device, since I am not 100% sure what users have been assigned to devices here, and thought one of them could be using the lutron/integration one, and conflicting.

The repeating pattern I get in the log is the following:

2020-08-01 21:50:38 WARNING (Thread-2) [pylutron] Disconnected
2020-08-01 21:50:38 INFO (Thread-2) [pylutron] Connecting
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Connected
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,12,2)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,255,2)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,3,1)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,4,1)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,5,1)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,6,1)
2020-08-01 21:50:41 INFO (Thread-2) [pylutron] Unknown cmd MONITORING (~MONITORING,8,1)

Any help is appreciated. Thanks!

The errors you’re describing are indicative of a network issue. Dima (maintainer of pylutron) has worked to get reconnects working, but it’s proven to be a bit difficult, and doesn’t work 100% of the time. The short of it is that when your main repeater goes offline, or loses network, the ability for HA to reconnect to it is impacted. Sometimes, it’ll reconnect, but a lot of times, it won’t. I’d recommend you investigate the stability of your network because I haven’t had issues for months at a time with this integration.

1 Like

Thanks for the quick response Jon. Sorry I took this long to reply. I have been trying to pinpoint the problem for months now, with no success. I can connect through telnet to lutron and maintain a connection indefinitely with a terminal. The commands on HA with the lutron integration also seem to work for many hours, sometimes days, even though reconnections are happening every 1-2 minutes. Then it just stops responding, and I am not even sure for how long. It just goes back to working by itself. Nothing else shows in the logs, other than the recurring reconnects. I checked all the devices here, and they all have their own unique login users. I also kept pinging the HA server, lutron, and from HA to lutron, and had no package losses… Honestly don’t know what else to try, other than the telnet integration, which would be a lot of work

So, a quick update. I am still getting the repeating:

2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Connected
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,12,2)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,255,2)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,3,1)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,4,1)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,5,1)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,6,1)
2020-09-30 23:42:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,8,1)
2020-09-30 23:45:52 WARNING (Thread-5) [pylutron] Disconnected
2020-09-30 23:45:52 INFO (Thread-5) [pylutron] Connecting
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Connected
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,12,2)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,255,2)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,3,1)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,4,1)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,5,1)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,6,1)
2020-09-30 23:45:55 INFO (Thread-5) [pylutron] Unknown cmd MONITORING (~MONITORING,8,1)
2020-09-30 23:47:26 WARNING (Thread-5) [pylutron] Disconnected
2020-09-30 23:47:26 INFO (Thread-5) [pylutron] Connecting
2020-09-30 23:47:35 INFO (Thread-5) [pylutron] Connected

This pattern happens every 2 minutes, approx. I now have the HA server connected directly to the same switch as Lutron. I don’t see how instability in the network would cause such evenly spaced problems (but I am no network expert). It seems like some programmed routine, either in HA or Lutron is generating this issue, through poor socketing, or something like it. I believe the MONITORING messages shouldn’t have much to do with it, but they seem to fit perfectly in the recurring pattern. I would guess every reconnection HA receives those, and only after about 2 minutes of these messages, the connection crashes.

Any other ideas?

Thank you btw, i was about to start writing Telnet commands until i cam across this thread.

I’m using HASSIO, Where is “the list”, I’m guessing it is in pylutron but am crossing my fingers it is just in config somewhere, otherwise I guess i’m going to be forking the repo and creating a custom component.

The list I was referring to is a set of strings in init.py I believe. Can’t remember for sure. What I have tried on my test server that is working very well is this great pull from @rzulian which turns my legacy keypad buttons into scenes and can found at this thread:

@namurdock @FMG

If you want to try the current branch I’ve a repo with the Lutron custom component here

2 Likes

Hey @rzulian and @txwindsurfer , thanks for the help, suggestions and work.

I tried the custom component. I believe I did it correctly, by keeping the “lutron” part of my config file, and just adding the custom component files to the config/custom_components/lutron_custom_component-master folder. It is working exactly like before, except some of the entities, which were not useful anyways, are not available. Unfortunately the repeating disconnect pattern is still happening:

2020-11-12 18:37:39 WARNING (Thread-3) [pylutron] Disconnected
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Connecting
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Identified Lutron Controller.HOMEWORKS
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Connected
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,12,2)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,255,2)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,3,1)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,4,1)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,5,1)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,6,1)
2020-11-12 18:37:40 INFO (Thread-3) [pylutron] Unknown cmd MONITORING (~MONITORING,8,1)
2020-11-12 18:41:03 ERROR (Thread-3) [pylutron] Uncaught exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pylutron/__init__.py", line 192, in _main_loop
    line = t.read_until(b"\n", timeout=3)
  File "/usr/local/lib/python3.8/telnetlib.py", line 317, in read_until
    self.fill_rawq()
  File "/usr/local/lib/python3.8/telnetlib.py", line 526, in fill_rawq
    buf = self.sock.recv(50)
TimeoutError: [Errno 110] Operation timed out
2020-11-12 18:41:03 WARNING (Thread-3) [pylutron] Disconnected

I don’t recall being able to get this much info on the problem in the logs, but other than that, it looks like the same problem.

Any other suggestions? Do you believe outdated Lutron Homeworks QS firmware could be the cause? I am trying to contact a local company to back it up, and update it.

1 Like

Try putting the custom component files into the folder named:

config/custom_components/lutron

The custom_components folder should be the same name as the component.

Thanks for the tip. Unfortunately it didn’t seem to change anything.