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.3.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.3.0
File Size Uploaded Provenance Actions
lg_soundbar_bluetooth-0.3.0.tar.gz 35.9 kB With provenance Details for lg_soundbar_bluetooth-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 74.3 kB

Release files / lg_soundbar_bluetooth-0.3.0.tar.gz

Download URL lg_soundbar_bluetooth-0.3.0.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
899614ca5bb55c6a4d57795f559222ae3bbc7389c0276973497178b833fe86b9
BLAKE2b-256 checksum
How to use checksums
640ba111df98a6b002dd6c7aee49072f18e60fabc81dc962c89d57e3f19ee1ef
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.3.0-py3-none-any.whl

Download URL lg_soundbar_bluetooth-0.3.0-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3945b627c1ed2a17186099eece12e4a179a61a3ee53d3c2d110bd90af4103d90
BLAKE2b-256 checksum
How to use checksums
534e5027f3c4d054955c1868653ff7a353ee298101c3fdd8db8f2e6571a26ff7
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.3.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.3.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