Skip to content
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

Min brightness not handled correctly #255

Open
SweVictor opened this issue Oct 20, 2022 · 0 comments
Open

Min brightness not handled correctly #255

SweVictor opened this issue Oct 20, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@SweVictor
Copy link
Collaborator

SweVictor commented Oct 20, 2022

For the longest time, I've had issues with lamps misbehave when using transitioning.

After a long session of debugging, I've realized that the core issue is that representation of minimum brightness differs between HA and Plejd.

HA treats brightness = 0 as "off" whereas Plejd treats brightness = 0 as "on, minimum brightness".

The issue seen when transitioning (to 0) in my case shows up when previous brightness was "minimum". Instead of transitioning from "minumum" to "0" the end result currently is that transitioning happens from "full brightness" (ON without any brightness value) and "0".

A side note when debugging this is that all (of my) 0-100% Lovelace sliders send the minimum brightness=3, not 1 as could be expected. The reason for this is that the same logic is applied HA-side: 0% = off, 1% => round(255*1/100) = 3. Quite annoying to be honest, but something to solve on the HA side.

I'm working on an update that simply replaces 0 <=> 1 when translating between Plejd <=> HA. Since the precision is only 0..255 / 1..255 I don't think scaling the values is a good idea.

@SweVictor SweVictor self-assigned this Oct 20, 2022
@SweVictor SweVictor added the bug Something isn't working label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant