LG Soundbar Bluetooth
Control LG soundbars over Bluetooth.
LG soundbars such as the G1 have no network connection, but they can be controlled over Bluetooth Classic, through a serial link (RFCOMM, the Serial Port Profile). This library speaks the soundbar's Bluetooth serial protocol, in your own asyncio event loop:
- volume, mute, inputs and sound modes;
- the soundbar's settings (levels, dynamic range control, night mode, auto power and more), offered where its feature flags say it has them;
- the subwoofer and rear speakers' connection, firmware versions and the model;
- turning the soundbar off, and switching back to the input it was on when a connection moved it to Bluetooth.
The Bluetooth link comes from bluetooth-classic, which opens it through serialx. For LG soundbars with Wi-Fi, see temescal. The protocol is documented in docs/protocol.md.
Installation
Install this via pip (or your favourite package manager):
pip install lg-soundbar-bluetooth
It needs Linux with Bluetooth sockets in Python (as Home Assistant's Python has), and Python 3.12 or newer. The soundbar must be paired first; to pair from Python, use bluetooth-classic.
Usage
import asyncio
from lg_soundbar_bluetooth import LGSoundbar, function_name
async def main() -> None:
soundbar = LGSoundbar("00:11:22:33:44:55")
await soundbar.connect(keep_input=True)
state = soundbar.state
print(function_name(state.function), state.volume, state.sound_mode)
await soundbar.set_volume(12)
await soundbar.disconnect()
asyncio.run(main())
Connecting wakes a soundbar that is off, and moves one that is on to its
Bluetooth input; with keep_input=True the client switches it straight
back, makes sure it got there, and reports how in input_restore. lg_soundbar_bluetooth.testing.FakeSoundbar stands in for a soundbar
in tests.
Finding and pairing a soundbar
from bluetooth_classic import BluetoothClassic
from lg_soundbar_bluetooth import is_lg_soundbar
async def find() -> None:
async with BluetoothClassic() as bluetooth:
await bluetooth.discover()
for device in await bluetooth.devices():
if is_lg_soundbar(device.name, device.uuids, paired=device.paired):
await bluetooth.pair(device.address)
await bluetooth.trust(device.address)
Contributing
See CONTRIBUTING.md.
Credits
Message formats were cross-checked against frames captured by websterwh/lg-s75qr. No LG code is included. The project layout and tooling follow the Bluetooth-Devices libraries, which were created with browniebroke/cookiecutter-pypackage.
Metadata
Release files for lg-soundbar-bluetooth 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lg_soundbar_bluetooth-0.4.1.tar.gz | 34.9 kB | With provenance | Details for lg_soundbar_bluetooth-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lg_soundbar_bluetooth-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for lg_soundbar_bluetooth-0.4.1-py3-none-any.whl |
Total release size: 72.3 kB
Release files / lg_soundbar_bluetooth-0.4.1.tar.gz
| Download URL | lg_soundbar_bluetooth-0.4.1.tar.gz |
|---|---|
| Size | 34.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af7e5668af98a240918622ca949622c95cbcea97b80e3139d949fe8121867073
|
|
BLAKE2b-256 checksum How to use checksums |
abeb70f308ccacf84e58face8c4470fecbd8e00faa5e89ad2127fa8713340fa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / lg_soundbar_bluetooth-0.4.1-py3-none-any.whl
| Download URL | lg_soundbar_bluetooth-0.4.1-py3-none-any.whl |
|---|---|
| Size | 37.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40cb3186e491b8255c985c2df39e7fa443944d958a27f292caf1dff774bc1c18
|
|
BLAKE2b-256 checksum How to use checksums |
d9b82d82d397bf771d98aba6d39e34de3532bcd975fc810347969d5d33ecac5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logSecurity for lg-soundbar-bluetooth 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for lg_soundbar_bluetooth-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.