-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SYSVAR suport ? #7
Comments
@ronluna Do you have an example of what you want to do? |
When adding actions to Button press, Double Tap and Hold . the only way to prevent the Button press actions from running when Double tapping or holding the button is by creating custom actions and then stopping those actions before executing whatever is on Double tap or Hold . as explained here This forces the programming to create custom variables to track what to do when next button press happens (For toggle situations etc) in lutron and if this buttons presses events are being used trigger other devices inside HA then devices get out of sync between the two systems as currently there is no way to monitor/set SYSVAR from HA. By enabling this feature it will help keeping track and in sync this type of events. |
@ronluna I've checked that we can monitor |
I think a sensor in Home assistant that reflects the state of the the lutron sysvar would be great, Would it be possible to change/set the lutron sysvar value though HA's sensor ? |
Hello Riccardo, pylutron https://github.com/ronluna/pylutron |
Hey Ron, |
@rzulian I just updated to Home Assistant Core 2024.4.0 and my integration to Lutron QS broke. Did any files change from HA Core 2024.3.3 which works for me and 2024.4.0. I am not getting any log errors but the lights are no longer responsive. I can send logs etc. but fist wanted to confirm that something changed. Confirmed #114794 is a solid fix and all is good. |
@ronluna Could you please check that everything is working fine on your side? |
Thanks for the above - was just going to ask if you were going to update the custom component to allow better integration with the latest HA! Could I double check before I go upgrade my HA to the latest: I only need to copy the files in Lutron folder and put it in custom_components (well after adjusting the manifest to point to the pylutron fork above)? |
Hello @rzulian, thanks for taking the time in looking at this and making it much better, although, I believe the requirements for the Lutron component in the manifest.json file needs to be adjusted to: git+https://github.com/rzulian/pylutron.git@homeworks-support I was about to suggest:
I wanted to confirm the above before testing as currently I can only test in a live system and I'm trying to prevent complains... lol |
@ronluna @clementx2006 Just add |
@txwindsurfer could you please check latest version? |
Hello @rzulian, After implementing the above I've noticed the following: There is a new file named event.py being used to identify button types and events, I believe this was previously being handled in the component's init.py file around line 134 as
This mapping gave the ability to trigger event during more situation as hold and double_tap but are nowhere to be seen in the new update, I believe this other events are very important (Well I'm currently using them quite often). also the event.py is causing an exception when any button is pressed on any keypad (as seen below)
I tried editing the event.py file around line 90 to this:
But another exception came up and I think it would be better to be checked on your end as currently this system is live and it relies on the double tap and hold events to trigger other things (They will also complain pretty soon)... Hope my comments were helpful. |
@ronluna it looks like HA is using the standard pylutron. Are you using a custom component or did you replace the lutron component itself? |
Im certain HA was using the pylutron you’ve specified above . I even uninstalled it and reinstalled manually from within the ha docker instance and using pip show pylutron would show the correct library (your library 0. 2.5).
When I go back to my version of pylutron and replaced the lutron folder with my files back inside the custom_component folder everything works again . I had to manually uninstall your pylutron library and reinstalled mine. wondering if your latest version is currently running on your system ? |
Old custom component was using my pylutron via New component in my test environment. @ronluna From your error log it seems that your are not using my lutron integration, because this error |
Hello @rzulian, I've tried again this morning and I have the following to share: I had to delete the previous component as later I've noticed the proper component was not being loaded as I had two components using the same domain, after doing that everything started to flow as expected although I have the following suggestion, Would be nice to add labels to each check box for the Area creation and device naming options (as seen below) Also the component is currently crashing on my end after a button press event occurs, any ideas?
I had to revent back to the previous component as this is a live system. any inputs would appreciated. |
Ok, it's working. I had to change line 125 on event.py to:
As Home assistant 2024.5.1 does not like async_write_ha_state due to "unsafe thread writes." . |
I was about to ask you which HA core version you were using ... ;) |
@ronluna regarding the variables. Could you please check in your exported xml, if you have references to the variables?
What do you think about it? |
If you create a dummy timeclock in Lutron, with the variables that you need, we could get the list of the variables from the XML instead of
which is solution 2 in my proposal. |
It is indeed a more elegant solution to not have to get hands dirty finding out integrations id for the SYSVARs... Let's do your way!!!! 👍 |
@rzulian I replaced the pylutron file with the one at https://github.com/rzulian/pylutron that added the line for HWI_SLIM keypad. Unfortunately, the keypad button events are not recognized/seen when listening to lutron_event and the event entities are not updated. All other lutron actions appear to be fine but no lutron_events for keypad buttons. In contrast, if I just add the line for HWI_SLIM keypad to the standard pylutron file, the keypad events are seen and the event entities are created and updated. I would be happy to explore why the events are missing from the pylutron pull you are working on. |
@txwindsurfer you have to use this branch https://github.com/rzulian/pylutron/tree/homeworks-support |
@rzulian Yes that is the file I am using; I just didn't reference the branch in my post. It has the HWI_SLIM in it. However, I am not using the custom component but using the standard Lutron component to allow for a backwards compatibility check on this pylutron file. If backwards compatibility is not important, I can install the custom component and go from there. This configuration is producing this error messages indicating confusion between PRESS and PRESSED : `Logger: pylutron Uncaught exception |
@txwindsurfer make sure that inside your custom_components folder there are no other folders (old or backup lutron folder) using the same domain (lutron) in the manifest.json file as this might override the required pylutron version and preventing the use of the pylutron library that you are attemping to use. 1- ssh to HA
3-uninstall any pylutron library using:
4- install the library in question with:
5- Change to manifest.json file to reflect something like this:
6- Restart HA |
@ronluna Excellent instructions. Thanks! This is a fresh install, so I don't have a custom components folder or any custom components installed. Start-up indicated "Setting up Lutron by RZ" so that appears to have worked. Lights work. 4 scenes were added all referencing the same button on 4 different keypads so integration is seeing some of the HWI_SLIM keypads. However, not sure why only 4 scenes as I have multiple keypads with 10 buttons per keypad. However, still no recognition of lutron-events or event entities when I press a button with same error as before: |
@txwindsurfer it looks like you are running the standard lutron integration. You have to change all files, not only the manifest. |
@ronluna I've a branch that is implementing the support for the sysvars. If you have time to test it and give me some feedback, then I can finalise it |
Hey @rzulian , thanks for the above... I'm starting testing so I've added some sysvar into a timeclock and set them to unaffected as shown in the screenshot. I can see the new lutron_data.xml stored in HA with the newly created timeclock and the IntergrationID for the sysvar in questions but after restarting HA and loading the new lutron component is not adding anything new to the devices/entities table. any ideas? by the way, I also just noticed that pylutron is not detecting button press/double/hold events for Palladiom Keypads, seetouch is working fine. I had to add PALLADIOM_KEYPAD entry into the device's list in pylutron init.py line 334 I also just noticed whenever any of the sysvar changes value the logs show a warning
|
Did you add the ids for your variables in line 139? |
Totally miss that, I only check pylutron's init.py and since it didn't match what you mentioned above about line 139... I ignored it. It's working now... after hardcoding the variable ids into custom component's init.py on line 139. For a moment there I thought that the approach was to use the lutron_data.xml file to auto generate the variables so no harcoding was needed. This works as well although would be nice to be able to add it to the component's config flow. but I think once a config flow has been completed it does not allow to be edited (or at least I haven't been able to figure out how to re run it without deleting it and reinitialising it again). |
It should be possible to have some sort of refresh config flow. I'll work on this to add the ability to change variable ids in the config, and also to let the user switch from cached and not cached xml db. |
@rzulian would it possible to add support to set the sysvar value from within HA ? |
This is the plan, but I have to invest some time to learn the HA workflow. Is the current implementation working fine? |
@rzulian , yes the sensors have been created properly and its values are changing accordingly. The one thing missing is just the ability to change the sysvar values from within HA. |
Hello @rzulian , I created two new repos based out of yours and mine where I did the following:
HA Lutron Component:
The stop action for shades is working correctly but the _set_state I has not been able to properly test as I've been unable to find a way to properly add the HA action that would call the _set_state function . Wondering if you could share some pointers on how to properly achieve it? |
Hey, I can add the palladiom support to the repo |
I didn't see any function on the code that would allow to change the sysvar value from within HA into Lutron, So I thought that it has not been added... Currently the addon reports the value of a sysvar within a sensor in HA correctly but I didn't see a way to change the value from within HA into Lutron. maybe I'm missing something ? |
You are right, it's not working. Let me work on this |
I'm thinking about the way to change the variable from HA.
|
Thank you @ronluna - was scratching my head around the "uncaught exception"! |
Good day @rzulian @ronluna - I know this open issue is about SYSVAR support (which I don't use in my setup), can I just ask if it is possible to make this custom component somehow HACS compatible? Every time the container is restarted now I re-copy the files into the lutron folder inside the container and restart the HA (but not the container) so no longer automated when the server reboots... :-( Thank you in advance! |
Possible to add support to monitoring and setting custom variable (SYSVAR)?
The text was updated successfully, but these errors were encountered: