No, I have not tried it at first, because by calculation that would yield too low resolution in the lower areas and too high a starting value.
(0.0001 + 0.9999 * 0.01) * 16383 = 165.451917
Strangely though, it somewhat works. Could you explain why? I guess, I misunderstood something…
What’s also a bit confusing is that I only get 14 bits resolution at 1000 Hz frequency. Here, it’s written, that with frequencies up to 1220 Hz, I should get 16 bits resolution. Meanwhile I also tried it with GPIOs 0 and 1. With that, resolution even goes down to 13 bits. With GPIOs 0 and 2, I’m back to 14 bits.
Ahhh, so the calculation with the gamma is already done before the template? I assumed, the template would get the value set in the UI. So, basically, it’s 0.0001 + 0.9999 * (x ^ 2.8) where x is the UI value.
Template output gets what ledc output would get without template in the middle.
That way you get tiny “boost” for next to 0 duty, but it doesn’t have any effect on higher values.
An issue with your suggested function is that 1% and 2% still had the same duty cycle which is a bit unexpected from am UX perspective. So, I’ve decided to define the function piecewise and am quite happy with the gradient that way
Yep, play with gamma function (or whatever other fine tuning) on template sensor. That way you keep the light component untouched.
Lot of time and posts for “cosmetic” reasons. But lot of learning as well. I never thought how non-linear brightness is from pwm. Now I wonder if speed fan component has some “functions” built in as well… I expect that it’s not perfectly linear with pwm either
You’re right. The actual topic was solved many posts ago. I set the solution to one of your posts. Got sidetracked just a little after that But as you said, we all learned something from it
Seems, I can no longer edit the title. Probably too old a topic - just a guess. Anyways, it’s got the checkmark, so it’s clearly visible solved
Don’t worry I’m not getting paid for solutions
Maybe you can’t edit the title if there is solution marked.
You could un-mark that and try to modify title. Never tried though.