-
Notifications
You must be signed in to change notification settings - Fork 22
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
Get current RGBA value and set it #1
Conversation
When controlling gateway from Homekit, this implementation correctly updates state (on/off) but does not update brightness and color (if it is set from homekit) this patch adresses that and parses incoming value.
Now it sets RGBA value only if you turn ON the light, but when you turn it off - it leaves old value in memory. So toggling works better. Also some additions - added togling the light, because sometimes on fresh boot the light just wouldnt turn on otherwise, as HA was sending turn on command with 0 brightness...
Hi @quarcko, no idea how, but I missed your pull request. :o I'll review it soon, probably make one method extraction (calculation on rgba struct), test and merge. |
So, any progress on this merge? |
Fixed GW timeout listeners; Shorter ping times; Added auto-destate
Trying to monitor the socket, and recreate it when it dies
If gateway sent some "unknown" methods to this component - it caused it to crash because of unknown variable that it was trying to print.
@quarcko got one question. I haven't implemented setting HA color state from gateway data (Homekit or HA itself) because I had problem with finding right struct. Sometimes there was 1 byte shift and on edge settings for R, G or B (can't remember now) the color was totally different that is suppose to be. Can you check it for 100% R, 100% G and 100% B? Confirm if value set is the same as displayed in HASS. |
@cadavre As far as i tried this modification until now it always gave me good values, |
I've made my testing based on previous implementation attempts. Look what I test:
I set above values via HA, then I wait for gateway to response with
Now, if we take this test script:
This is what we will get:
Result: I found no way to fix this. :/ That's why I abandoned receiving and parsing Can you confirm this above? What you're saying is that you have Gateway with Homekit version? Maybe they've fixed it and we can find to patch it? |
Proper v1.2
Okay, now clearer for me what to test, so i tried and got same results as you... there is 1 difference. 1694498641 -> 1694498688 And some others, did not wrote them down, but it is even worse than just -1 difference.... So my only thoughts are - maybe when you "want" to set specific color you set it, Also yes, my gateway is "lumi.gateway.aqhm01" |
On In most cases – if you can set rgb color only via HASS (hass itself, homekit bridge, google assistant etc.) – I'm leaving set and not updating Have you thought on moving from gateways' Homekit integration to HASS Homekit bridge? I actually use it this way, so there's only one single-source-of-truth for gateway to be set (via hass). I would prefer for this to work properly in case described above but not broke things to work 50% everywhere. We should think of fixing this responses, because in Miio Home app they've managed it somehow. :) |
It is indeed much muhc worse than just -1... here are results whem R & G are 255 const. and B {0-255}: 1694498560 | 1694498560 It looks like it only can report "B" in 3 levels total.... |
OK, i give up. This is nuts. The only possible way i can think of, is modifying "miio_client" binary, so it does not pass this command to the "gw.mi" binary (which i watched in terminal, it is source of bad data) /sys/class/backlight/lumi_r/actual_brightness compose correct struct & send it back, but this is nuts, and not worth it, |
New requirements in HA 0.103. Fix for that
Update alarm_control_panel.py
Unfortunately with #1 (comment) – it seems that there's nothing we can do. Or maybe any updates since then? |
When controlling gateway from Homekit, this implementation correctly updates state (on/off)
but does not update brightness and color (if it is set from homekit)
this patch adresses that and parses incoming value.