Sony Bravia TV smart home integration, free and open source

Sony Bravia TVs: power, volume, inputs, apps and remote keys, on your local network.
Control your Sony Bravia TVs from Gladys, over your local network: turn them on and off, set the volume, switch inputs, open an app, change the channel, press any key of the remote, from the dashboard or from a scene. And react to what happens on screen: "when the console turns the TV on HDMI 2, dim the lights".
Developed without the hardware: feedback welcome. This integration was built and tested against the answers documented by Sony (Bravia REST API and IRCC-IP) and those of the open-source pybravia library, with a simulated TV, not against a real Bravia. If something does not work as described, please say so on the Gladys forum or in the issues.
What you need
- Gladys Assistant 5.1.0 or later.
- A Sony Bravia Android TV or Google TV (2015 and later), on the same local network as Gladys, with a fixed IP address (a DHCP reservation in your router).
- IP control turned on, on the TV. The menus vary with the model; usually
Settings → Network & Internet → Home network → IP control (or Settings
→ Network → Home network setup → IP control):
- Authentication: Normal and Pre-Shared Key;
- Pre-Shared Key: type a key of your choice, for example
gladys2026; - Simple IP control is not needed.
- Remote start turned on (Settings → Network & Internet → Remote start): without it, a TV in standby cannot be turned on over the network.
Set up
- Install the integration from the Gladys catalog.
- In Configuration, enter the Address of your TV (for example
192.168.1.20), then authenticate it in one of the two ways below, and optionally give it a Name. Two or three TVs? Fill in the Second TV and Third TV sections too. - Save, then click Test the connection: the message under the button says, for each TV, whether it answers, its model and whether it is on.
- Open the Discover tab: one device per TV. Click Add, pick a room, save. A TV appears there once it has answered at least once: turn it on if it does not show up.
With a pre-shared key (recommended)
Type the key set on the TV in Pre-shared key. Nothing else to do.
With a PIN
Without a pre-shared key, the TV can pair with Gladys like with its phone app:
- Leave Pre-shared key empty, enter the address, save.
- Turn the TV on, then click Show a PIN on the TV (choose the TV): a 4-digit code appears on screen.
- Type it in PIN (without key), save. Gladys registers itself on the TV under the name Gladys Assistant, and registers again with the same PIN when the TV asks (about every two weeks).
The options at the bottom of the page:
- Wake-on-LAN (on by default): many Bravia TVs turn their network off in standby. Gladys then asks its core to send a Wake-on-LAN packet to the MAC address the TV gave, which wakes it up. The integration declares it, as the install screen shows.
- Refresh interval: how often the TVs are read (10 s by default). A TV in standby is only asked its power state.
- Volume step: the change of each press on Volume + and Volume −.
- Language of the feature names: the names given to the features when you add a device, and the texts of the lists and of the scene events.
The device of each TV
| Feature | What it does |
|---|---|
| Power | On or standby. Turning it on uses Remote start, or Wake-on-LAN when the TV does not answer at all. |
| Volume | The volume of the TV speakers, 0 to 100, as a slider. |
| Volume down | Lowers the volume by the configured step (the remote keys when a sound bar takes the sound). |
| Volume up | Raises the volume the same way. |
| Mute | Mutes or unmutes the sound. |
| Input | The input on screen (HDMI 1, HDMI 2…, with the names you gave them on the TV), and to switch to another one. Other (TV, apps) shows an app or the tuner, and choosing it presses Home. |
| App | Opens one of the TV apps. Shows the app Gladys opened, until the screen changes; Home screen presses Home. |
| Channel | The number of the channel on screen, and to switch to another number. |
| Channel down | Previous channel. |
| Channel up | Next channel. |
| Now playing | What is on screen, as a text: an input, 5 · France 5 — program, App or home screen, or Off. |
The lists of inputs and apps are read from the TV (every 30 minutes and every 6 hours, while it is on) and kept by the integration: they are there even when the TV sleeps. A command that needs the screen (an input, an app, a channel) turns the TV on first and waits for it, up to 20 seconds.
Dashboard
Three widgets, to place side by side; each one shows one TV (the first one of the configuration when none is chosen in its settings). The core allows four buttons per widget, hence three of them.
- Bravia remote: the state of the TV, what is on screen, the volume, and the buttons Turn on (or Turn off), Volume −, Volume + and Mute.
- Bravia keys: four keys of the remote, chosen in the widget settings: the arrows by default. Add a second one with OK, Back, Home, Input, or Play and Pause…
- Bravia shortcuts: up to four favorite inputs or apps, typed by name in
the settings (
HDMI 2,PS5,Netflix…); the connected inputs when none is typed. One tap shows it, the TV turned on first. A name the TV does not know is reported under the buttons.
Scenes
Trigger
TV: input, channel or app changed: what is on screen changed, turning on
included. Filters: the TV, what is now on screen (input, channel, app or home
screen), its name exactly as the TV shows it (PS5, HDMI 2, TF1), and who
changed it (Gladys, or the TV and its remote, a console over HDMI-CEC…). Variables: the TV, the kind (input, channel, app), the name
(of the input, the channel, or the app Gladys opened), the channel number, the
program, and who changed it.
The TV API never says which app is in front: an app opened from the remote is App or home screen; going from one app to another fires nothing.
No "TV turned on" or "TV turned off" trigger: the Power feature already triggers scenes, like any device.
Actions
- Open an app on the TV: by its name as on the TV (
Netflix,prime video: case, accents and spaces do not matter). Output: the app opened. - Choose a TV input: by its name (
HDMI 2) or the label set on the TV (PS5). Output: the input chosen. - Send a remote control key: Home, Back, arrows, OK, Input, volume, channel, playback, colors, digits, one to ten times. Output: the presses sent.
The first two turn the TV on first when needed. With several TVs, choose the TV in the action. The Power, Volume and Channel features are in the usual Control a device action.
Scene ideas
- Movie night: at 9 pm on Fridays, Open an app on the TV
Netflix, dim the living room lights. - The console is on: trigger TV: input, channel or app changed, now on
screen Input, name
PS5: set the lights to the game scene. - Leaving home: in the "everyone left" scene, turn the Power of the TVs off.
- News: at 8 pm, Choose a TV input
Freebox, then Send a remote control key2.
Troubleshooting
- "Not reached yet: turn the TV on once": the TV never answered. Check its address, turn it on, and check that IP control is on.
- "Key or PIN refused": the pre-shared key differs from the one on the TV, or the PIN has expired: click Show a PIN on the TV again.
- "The TV asks for a pre-shared key or a PIN": neither is filled in.
- "No Bravia IP control at this address": another device answers there, or IP control is off.
- The TV does not turn on: turn on Remote start on the TV. If its network sleeps in standby, keep Wake-on-LAN on; Wake-on-LAN must also be allowed on the TV (often with Remote start), and it does not cross routers or VLANs.
- The volume buttons do nothing on the sound bar: the integration then sends the remote keys, which the sound bar follows over HDMI-CEC; the Volume slider is the TV speakers only.
- An app is not found: its name must be part of the name the TV shows; the list is read again when a name is not found.
- The logs of the integration (Configuration tab) say what each TV answers; no key nor PIN is ever written there.
Limits
- Developed without the hardware: the behaviors come from the Sony documentation and from pybravia, not from a real TV.
- Android TV and Google TV Bravia models with IP control. Older Bravia models (before 2015) and the professional displays without IP control are not supported.
- The API does not tell which app is in front, nor the program of an HDMI source.
- Channels: those of the TV tuner (
tv:sources), read once a day. - Everything stays on your local network: no cloud, no Sony account. The integration only talks to the TVs you configured, and asks the Gladys core for Wake-on-LAN packets.
- Not affiliated with Sony. Bravia is a trademark of Sony Group Corporation.
Configuration settings
These are the settings Sony Bravia TV asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your Bravia TV | section | No | Sony Bravia Android TV or Google TV. On the TV, in Network, Home network, IP control: set Authentication to "Normal and Pre-Shared Key", type a key, and turn on Remote start. Up to three TVs. |
| Address | string | Yes | IP address of the TV. Give it a fixed address in your router. |
| Pre-shared key | secret | No | The key typed on the TV, in IP control (recommended). |
| PIN (without key) | secret | No | Only without a pre-shared key: run "Show a PIN on the TV" below, then type the 4 digits shown. |
| Name | string | No | Name of the device in Gladys. Empty: BRAVIA and the model. |
| Second TV (optional) | section | No | Same fields, for another Bravia TV. |
| Address | string | No | IP address of the TV. Give it a fixed address in your router. |
| Pre-shared key | secret | No | The key typed on the TV, in IP control (recommended). |
| PIN (without key) | secret | No | Only without a pre-shared key: run "Show a PIN on the TV" below, then type the 4 digits shown. |
| Name | string | No | Name of the device in Gladys. Empty: BRAVIA and the model. |
| Third TV (optional) | section | No | Same fields, for another Bravia TV. |
| Address | string | No | IP address of the TV. Give it a fixed address in your router. |
| Pre-shared key | secret | No | The key typed on the TV, in IP control (recommended). |
| PIN (without key) | secret | No | Only without a pre-shared key: run "Show a PIN on the TV" below, then type the 4 digits shown. |
| Name | string | No | Name of the device in Gladys. Empty: BRAVIA and the model. |
| Options | section | No | |
| Wake-on-LAN | boolean | No | Wakes a TV whose network sleeps when it is off (Gladys sends the packet). |
| Refresh interval | select | No | How often the TVs are read. |
| Volume step | select | No | Change of each press on Volume + and Volume −. |
| Language of the feature names | select | No | Names given to the features when a device is added, and texts of the lists and scene events. |
How to install Sony Bravia TV in Gladys
- In Gladys, open Integrations: Sony Bravia TV appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-sony-bravia:1.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-sony-bravia.
Sony Bravia TV requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
Sony Bravia TV is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.
- Browse all external integrations
- Discover the native integrations built into Gladys
- Build and publish your own external integration
- Source code on GitHub — source of this documentation