Skip to main content

LG Soundbar Bluetooth

CI Status Documentation Status Test coverage percentage

Poetry ruff pre-commit

PyPI Version Supported Python versions License

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lg-soundbar-bluetooth 0.4.0
File Size Uploaded Provenance Actions
lg_soundbar_bluetooth-0.4.0.tar.gz 34.9 kB With provenance Details for lg_soundbar_bluetooth-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lg-soundbar-bluetooth 0.4.0
File Interpreter ABI Platform Actions
lg_soundbar_bluetooth-0.4.0-py3-none-any.whl Python 3 none any Details for lg_soundbar_bluetooth-0.4.0-py3-none-any.whl

Total release size: 72.3 kB

Release files / lg_soundbar_bluetooth-0.4.0.tar.gz

Download URL lg_soundbar_bluetooth-0.4.0.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bae1fffb238d603326f7de70ee6142146b7a1a5419f9bd75968e9ef79e79861b
BLAKE2b-256 checksum
How to use checksums
8bdb2b075c256728a1ee4f8c1851f8185e0848e90ed7e1af49815b9b9c1db61e
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 24, 2026.

Transparency log

Release files / lg_soundbar_bluetooth-0.4.0-py3-none-any.whl

Download URL lg_soundbar_bluetooth-0.4.0-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cbf9b56712e2d78b01e99efd78cecbb39629062beb7249a94f424cf83edba39
BLAKE2b-256 checksum
How to use checksums
43bcc9b1f6e1fede1f2e1bc4ca8333b414f23e89b6ef404664fc34e3eb9e729b
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 24, 2026.

Transparency log

Security for lg-soundbar-bluetooth 0.4.0

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.

Select from 2 files

Attestation for lg_soundbar_bluetooth-0.4.0.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 24, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page