I was looking for smart home devices online when I stumbled across a smart knob and immediately wanted to buy it. Then I noticed that exactly what I needed was staring me in the face. My mini hi-fi system on my desk has a large knob that feels gorgeous to turn, so I wondered if I could turn it into a smart home controller.
Why a physical knob is useful for smart home control
Turning a dial is more satisfying than tapping buttons
The main reason that I wanted a knob was to change the brightness of the smart bulb in my home office. The smart bulb uses the Adaptive Lighting custom component to automatically change color temperature and brightness throughout the day to mimic the natural light of the sun. After a little tweaking, I have the settings just how I like them, but sometimes I need to change the brightness temporarily.
For example, if I need to take a photo of a product for an article, I will often need to turn the brightness up to get the best image. This means I either need to ask my local voice assistant to do it or open Home Assistant and drag a slider. When I’m not sure exactly how bright I want the light to be, using voice commands is frustrating, so I have to resort to using the slider to change the brightness up and down until I find the setting I like.
Life would be much easier if I had a smart knob that I could use to turn the brightness up and down by rotating the dial. I’d then be able to quickly and easily change the brightness to the level I want.
- Dimensions (exterior)
-
4.41″L x 4.41″W x 1.26″H
- Weight
-
12 Ounces
Home Assistant Green is a pre-built hub directly from the Home Assistant team. It’s a plug-and-play solution that comes with everything you need to set up Home Assistant in your home without needing to install the software yourself.
How I used my stereo’s volume knob in Home Assistant
Music Assistant exposes the media player volume
When I spotted the volume knob on my stereo, I knew I had to use it. It’s a Panasonic mini hi-fi that my dad gave me when he no longer needed it, and it features a large prominent volume knob that has a lovely feel to it. The slight resistance when you turn it is hard to beat.
I use Music Assistant to play music in my home, as it allows me to play music from multiple sources, including Apple Music, Spotify, and my own local media files. I have several devices connected as music players, including the stereo, which connects via DLNA.
In Home Assistant, the stereo is exposed as a media player. This includes many attributes, one of which is volume_level, which is exposed as a float between 0.0 and 1.0. Turning the knob on my stereo changes the value of volume_level.
It was fairly trivial to create an automation that takes the volume level and converts it to a brightness level. The automation triggers when the volume for the media player changes. Since I was using the brightness_pct field, which is on a scale from 1 to 100, I needed to use a template such as the following to translate the volume level to a brightness level:
{{ (trigger.to_state.attributes.volume_level * 100) | int }} I added this to the Brightness field for a light.turn_on action in my automation. Now, when I turn the volume knob up, the brightness of my smart bulb increases, and when I turn the volume down, the brightness reduces.
Building a smart home? Here’s one design principle you shouldn’t ignore
”Guest mode” is a sign that you’ve missed the brief.
The tricky part was stopping the music volume from changing
Making the lights brighter could get loud fast
There is one obvious flaw with this setup. Turning the volume knob makes the brightness go up or down, but it also makes the volume of the stereo go up or down. If I turn the bulb to full brightness, it means that my stereo is also turned to full volume.
If the stereo is playing, this is bad enough, but if it’s not playing, I get a real jump scare when I next play music, and it blasts out of the stereo at full volume. Unfortunately, I couldn’t find an obvious way to get the value of the volume knob without changing the volume of the stereo.
My solution ended up being a bit of a hack. The automation only runs when music isn’t playing, so that I’m not turning up the volume to crazy levels. The first time it runs, it detects that an “active” helper is currently off, stores the current volume, starts a 30-second timer, and toggles the “active” helper on.
As the knob is turned, the automation repeats, but now that the automation is marked as active, the original volume is not saved, so that it doesn’t get overwritten. When the timer reaches 30 seconds, the stereo’s volume is restored to the original value, and the “active” helper turns off.
Now, as long as my music is not playing, turning the volume knob on the stereo will change the brightness of the lights. Once I’ve stopped turning the knob, the volume will reset to its original value. When music is playing, the volume knob changes the volume as usual, and the light remains unchanged.
Sometimes you just want to turn a knob
Smart homes allow you to control devices in many different ways, from voice commands to automatic triggers such as motion sensors. Sometimes, however, you just want to turn a nice chunky knob. Changing the brightness of my lights has never felt so good.





