pybravia
Python Bravia provides an easy-to-use async interface for controlling of Sony Bravia TVs 2013 and newer.
This library primarily being developed with the intent of supporting Home Assistant.
For more information, take a look at BRAVIA Professional Display Knowledge Center.
Requirements
This library supports Python 3.10 and higher.
Installation
pip install pybravia
Connect and API usage
With PSK (recommended)
import asyncio
import logging
from pybravia import BraviaClient, BraviaError
HOST = "192.168.1.20"
PSK = "sony"
logging.basicConfig(level=logging.DEBUG)
async def main():
"""Example of connect with PSK."""
async with BraviaClient(HOST) as client:
try:
connected = await client.connect(psk=PSK)
info = await client.get_system_info()
print(info)
await client.volume_up()
except BraviaError:
print("Could not connect")
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()
With PIN code
Start pairing process and display PIN on the TV
import asyncio
import logging
from pybravia import BraviaClient, BraviaError
HOST = "192.168.1.20"
CLIENTID = "MyClientID"
NICKNAME = "MyNicknameID"
logging.basicConfig(level=logging.DEBUG)
async def main():
"""Pairing process initialization example."""
async with BraviaClient(HOST) as client:
try:
await client.pair(CLIENTID, NICKNAME)
except BraviaError:
print("Could not connect")
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()
Connect and usage
import asyncio
import logging
from pybravia import BraviaClient, BraviaError
HOST = "192.168.1.20"
CLIENTID = "MyClientID"
NICKNAME = "MyNicknameID"
PIN = "2170"
logging.basicConfig(level=logging.DEBUG)
async def main():
"""Example of connect with PIN."""
async with BraviaClient(HOST) as client:
try:
connected = await client.connect(
pin=PIN, clientid=CLIENTID, nickname=NICKNAME
)
info = await client.get_system_info()
print(info)
await client.volume_up()
except BraviaError:
print("Could not connect")
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()
License
Metadata
Release files for pybravia 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pybravia-0.5.3.tar.gz | 94.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybravia-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.5 kB
Release files / pybravia-0.5.3.tar.gz
| Download URL | pybravia-0.5.3.tar.gz |
|---|---|
| Size | 94.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54e80b08c2809dd05562a7c4f5bfb995b902c0b4d7f6505e7ea3f77d85e1bdbf
|
|
BLAKE2b-256 checksum How to use checksums |
cbe4b82572ae7480f5c71cd2d6cfd94f92fa8f625879639fe3aca5790cbf2266
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency logRelease files / pybravia-0.5.3-py3-none-any.whl
| Download URL | pybravia-0.5.3-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3341421f1b2c3ef160a1a893d4a4228c4369e936b248af434b1e84826e3a71c2
|
|
BLAKE2b-256 checksum How to use checksums |
a8b29a887c481b82478415bbf9963e54ff4ecb8d6f74cc1484423b95fbf49b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency log