-
Notifications
You must be signed in to change notification settings - Fork 0
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
Load Number Not Properly Derived #2
Comments
@zimmra thanks for figuring this out, sorry for the delay responding. I'll try to get this in the main branch. I'll see if I can get the Savant version and switch behavior based on that. |
@zimmra finally getting around to this. I did some more digging and found the actual definition of how the load state numbers are derived in my version:
If you have time, could you look through the Web UI source (via Chrome's inspector) for a similar |
I might have figured it out, yours seems to be bit-shifted by 7 instead of 16 (and I'm assuming the Load ID is being adjusted similarly), giving something like this?
|
@zimmra I pushed a branch that might work for you, haven't had time to test it myself though: main...light-load-state-name |
You were on the right track. Here is what I see in my getSetStateValue: function(e) {
return (u.intAddress << 7 | e - 1 & 15).toString(16)
},
Very cool! I'm hesitant to change my modifications on my active/live system because it's been working well for me, but I'll be able to spin up a second development HA instance and give this a whirl - should be able to sometime this week |
My system derives its load numbers differently than yours. (I am running 9.4.6 on a Linux based smart host)
Without modifying the code, the state within Home Assistant was being tracked properly when controlled from Savant, but I had no control over the lights from Home Assistant.
I am not sure if this is due to me being on 9.4.x or if it is just how they do this on Linux based hosts.
My load numbers follow a pattern of 80->100->180->200->280->300->380, and so on
I had to change this function to follow that on my system
savant-lighting-hacs/custom_components/savant_lighting/api/light.py
Lines 70 to 71 in fa0df9c
Changed to:
I don't expect you to necessarily adopt this in to your codebase - was more just documenting my findings in case somebody else wants to try this on their system.
I don't think there are enough potential Savant (Lighting)+Home Assistant users out there to warrant your code taking this in to account.
The text was updated successfully, but these errors were encountered: