Control digital potentiometer through home assistant via esphome?

I’ve gotten a rotary encoder to work see this thread. It’s just like a potentiometer but works off pulses instead of resistance.

I have it controlling a google home volume (I use the google home max as a sound bar) currently and have dimmed lights with it. Goal being to have it there to adjust any device requiring variable input, lights, volumes, blinds, thermostats, etc. I would like to use it for multiple devices, it has a button push on the knob that would be good to iterate through a group of devices. Working at the moment but needs more time. I also need to come up with an enclosure for it and maybe small rechargeable battery.