This project integrates an ESP32 microcontroller directly inside an Infinity Bluetooth speaker (or similar device) to bring it into Home Assistant. By wiring the ESP32 directly to the speaker's physical Play/Pause, Power, and Volume buttons, the microcontroller mimics physical button presses.
Power for the ESP32 is drawn directly from the Bluetooth speaker's internal circuitry, making it a fully self-contained smart integration without needing an external power supply.
- Direct Hardware Integration: ESP32 mimics physical button presses.
- Self-Powered: Draws power directly from the speaker.
- Power Control: Short and Long Press mimicking via GPIO output.
- Playback Control: Play/Pause mimicking via GPIO output.
- Volume Control: Volume Up/Down mimicking via GPIO output.
- Status Sensor: Reads speaker power state to report back to Home Assistant.
Caution
Always probe your specific hardware first!
Not all Bluetooth speakers use the same button logic (e.g., active low vs. active high, different voltage levels). You must use a multimeter to probe your speaker's physical buttons and power lines before connecting the ESP32 to ensure compatibility and prevent hardware damage. Revise the GPIO configurations in esphome-web.yaml as necessary based on your findings.
- ESP32 microcontroller
- ESPHome (v2025.9.0 or newer)
- Home Assistant
- Soldering equipment (to connect ESP32 to speaker button pads and power)
-
Clone this repository or download the files.
-
Copy
secrets.yaml.exampletosecrets.yamland enter your WiFi credentials.cp secrets.yaml.example secrets.yaml
-
Edit the
secrets.yamlfile to include your actual WiFi SSID and password. -
Modify the
substitutionsblock at the top ofesphome-web.yamlif you want to change the device name or friendly name. -
Compile and upload the configuration to your ESP32 device using the ESPHome dashboard or CLI:
esphome run esphome-web.yaml
This project is built to be seamlessly integrated directly into Home Assistant using the native ESPHome Integration.
- Auto-Discovery: Once your ESP32 flashes and connects to your local Wi-Fi, the built-in
api:component broadcasts its presence via mDNS on your network. - Add to HA: Open Home Assistant. You should see a notification under Settings > Devices & Services saying a new device has been discovered.
- Configure: Click Configure on the discovered ESPHome device. If it isn't automatically discovered, you can add it manually by clicking Add Integration, searching for "ESPHome", and entering the IP address of the ESP32.
- Done! The virtual buttons (Power, Play, Volume Up/Down) and the speaker power status sensor will immediately appear as entities in Home Assistant, ready to be added to dashboards or used in automations.
Here is how the speaker controls look when added to a Home Assistant dashboard!
(You can find the exact YAML for the standalone speaker card in dashboard_config.yaml)
Outputs (Active Low, Open Drain) - Connect to the corresponding button pads on the speaker's PCB:
- GPIO16: PWR (Power button)
- GPIO17: PP (Play/Pause button)
- GPIO18: VOLU (Volume + button)
- GPIO19: VOLD (Volume - button)
Inputs:
- GPIO34: Speaker Power Status (Connect to a point on the PCB that goes high when the speaker is on)
Power:
- ESP32 3.3V/5V In: Connect to an appropriate stable voltage source inside the speaker.
- ESP32 GND: Connect to the speaker's common ground.
To keep your credentials secure, this repository uses a secrets.yaml file. This file is ignored by .gitignore so your WiFi passwords will not be accidentally uploaded to GitHub. Always use the secrets.yaml.example file to show others what variables are required.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

