I have a monoprice 6 zone amp that comes with in-wall volume control, but I couldn’t easily run wires for them, and I wanted something a bit more convenient, so I made some wireless volume knobs using some d1_minis with ESPHome, and I documented the build on github.
There are other folks out there who have made volume knobs, or dimmer knobs using potentiometers, or rotary encoders that set an entity to a value that matches the knob, but then the knob quickly gets out of sync with HA, so I simply set mine to raise and lower the volume instead of setting a specific volume tied to the knob. I made 5 total for different rooms in the house.
check out the github repo for more pictures, explanations, and even STL files for the case.
I may not have done this in the best/most efficient way, but it is the only way I could figure out how to make it work, and it seems to work well so far
For example, controlling different entities, which a cycled through on single press. Say:
1st click - switch to controlling light dimming (mode 1)
next click - switch to controlling those other lights in the corner (mode 2, etc)
next click - switch to controlling volume
next click - scroll through playlists
next click - go back to 1st click
Some sort of feedback is needed, otherwise the user won’t know what he is controlling. Options:
Different led lights up for each mode
One led but different colour for each mode
series of beeps (one for mode 1, 2 for mode 2 etc)
oled display would be ultimate and could display mode name (lights, vol) as weel as the level as a bar graph and/or track info as text.
So many options, you can see why I never built it, I have too many ideas swilling about.
oooooo!!! I dont know exactly how I would do it, but those are really cool ideas!
sounds like you need to just start with one click… and then work from there
Just a thought on the LED… when turning the knob, the onboard LED lights up(as it is connected to D4), and I cant see it through the black case, but it does come through the orange… so I think if you printed one in white with maybe some thinner walls, you could get color through nicely…
Another question, I’m thinking of using this for 4 different controls in one case if it works well. I’ve only briefly looked at your code but could it be used for multiple rotary encoders on one board or are the pins you’re using specific to an encoder and limited in number?