-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Toggle direction requires the button to be held twice #81
Comments
Hi @htvekov, I have fixed this bug already. The change is on the Feel free to switch to the Thank you for your help in advance :) |
Hi' Xavi. Great! 👍😎 Only one minor detail about this bug fix. on INITIAL start of app (restart appdeamon eg.) dimming direction apparently is NOT set correctly ?. Still has to press button a second time, before dimming up/down starts. But this only happens ONCE. if app is reconfigured and restarted or appdeamon itself is restarted. |
Hi @htvekov, I tested this on a friend's setup and I could not make it work (maybe I did not install it properly or something). Glad to hear you see the fix on your side. I ordered already a new Raspberry Pi that I will be getting soon, so I will be able again to test this again by myself. Then I will check the issue you are mentioning, although it is interesting because it should not matter if you restart AppDaemon or not since it gets the value and does the checking at the moment you press the button. I will keep you updated, thanks! |
Yep, the fix works perfectly here! 😎 Equally strange that on appdeamon restart or change in apps.yaml (reload of apps) then initial hold command doesn't start to dim lights as expected.
|
Almost forgot... |
Thanks for the logs @htvekov, I will be looking into it and I will let you know. Now I got my setup up and running again, so I will check it out in my setup.
Cheers! :) |
No worries, Xavi 😎 Just strange that I experience this behavior on initial appdeamon startup, when code is as you've described ? Ciao ! |
Hi @htvekov, I have been exploring this issue and apparently it was not working from me just when the light was in maximum brightness and not in minimum. Now it works well in both and it should work well when starting AppDaemon. However, I would like to confirm that you got the same problem as me. The problem came from HA, because as much as I try to put the brightness to maximum value (255), it bounces to 254: You can observe the brightness bar is to the maximum point, but the value is 254. What I did is to change the maximum brightness value to 254 and now it works. Not sure if that is a good solution (no that anyone would notice the difference between 254 and 255), but for the moment I will keep it like this. Let me know if you got the same behavior. |
Very strange, Xavi. Must be a bug in some implementations... ? With z2m integration i get: And same with Hue bridge as well: And it's the same on all type of bulbs I have. Ikea dimmable only, White Spectrum, Colour bulb, Hue colour bulbs and Hue WS bulbs. All showing 255 as max. brightness. |
Hi @htvekov, Indeed, the configuration you saw before was from second, but I am also getting the same on z2m: I did not go in research whose fault it is, for this reason I am leaving the max brightness to 254 for the moment. Also I just tried the following:
Then, the brightness goes down (when first move would be to go up if the brightness is in between 1 and 254). Code is on Thank you @htvekov :) |
Hi' Xavi. I've tested numerous times, and dimming direction is always correct now on appdeamon restart 👍 Still don't get the brightness 254/255 issue 🤔 - But hey - it works ! 😁😎 Ciao ! |
Perfect! Thank you for the thorough testing :) I don't about you, but I got my light near the window and people from the street see my light going on and off constantly due to all the tests I do with it haha I am not sure about the 254 brightness issue, but I asked a friend of mine and he also had this issue🤔 As you say, it works, so I will keep it like this for the meantime Thanks again! |
My nextdoor neighbors have asked many times during the last months what I'm doing with the office lights most evenings ? 😁🤣 No worries, Xavi ! 😎 |
Bug report
Description
One of the options to change the brightness or color temperature is to have a "toggle direction". This allows users to use a single hold-release button to change brightness up and down. As for now, if the light was set to 100% with ControllerX, then the direction changes to go down next time the button is held. However, the brightness might have been changed externally through HA or other integration. Then, the user will need to hold twice to dim down the brightness.
Solution
The proposed solution is to detect in runtime the brightness (or other attribute's state) if it is at its maximum or minimum level. If so, then we can determine the direction automatically.
Additional information
This bug was discovered by @htvekov. Thanks for spotting this out.
The text was updated successfully, but these errors were encountered: