Simple speaker control that looks like a media_player/speaker to HA

I’ve posted it there as a feature request (hope I did it right). Here’s the link:

2 Likes

The Number Component looks like a great way to present the Volume control.
The on/off part is easy - that’s just a switch.
I’m still hopeful, though, that there’ll be a way to expose the bundle of the two in a way that HA can operate on them as a single device, and treat the on/off/volume as “one thing”, just like it does with monochrome lights.
e.g. if you dim a monochrome light all the way down, it becomes ‘off’. And, likewise, if you brighten it above zero, it also becomes ‘on’. Further, you can turn it on/off without affecting the brightness (aka ‘volume’) level. That’s how I’d like to treat this amplifier.

Take the number and create logic if vol=0 then switch off via inc, if vol is > 0 then switch (on via i2c if off) and set vol via i2c

1 Like

Yep - good advice. Thanks.
Nonetheless, I may not rest until I’ve found a way to make it show up in HA as some kind of media control device, and not as just another switch or sensor. (yes, I’m retired, so pursuing inane things like that tend to become major goals.) :wink:

Phil Schatzmann has already created the esp32 library for audio streaming https://github.com/pschatzmann
We just need to be able to expose/register the esp32 device as a home assistant media player.
This would be an awesome solution and step forward to non-cloud home control

I’m reading this much later, after ESPHome Media Player feature became supported since 2022.6 --so perhaps there’s now something there that can meet your needs?

That new integration seemed promising, but I hadn’t explored further since it’s only for the ESP32 and wants to control a specific device.
But, thanks for reminding me. I might fork it and see about stripping out all the parts except the shell and then customize it to control only on/off/volume.

Or yet another possibliity-- A pre-built pre-packaged unit, reasonably priced (IMO), based on ESP32, capable of being flashed for ESPHome.

“This is intended to plug on your old stereo system to add connectivity such as Bluetooth, Airplay, Local Streaming, Home Assistant support & more.”

I had forgotten about having posted this, and had asked again. To which the first reply was ideal:
Use HA’s generic customizable Universal Media Player, and supply the details of how it will control volume and on/off.

Simple and effective.

Only drawback is that the HA docs on that custom integration could benefit from a bit more elaboration. But it’s still quite a good path for this goal.