Sony BRAVIA TV (HTTP)
Sony BRAVIA Android TV / Google TV sets are controlled over the TV's built-in HTTP control API — the same REST/IRCC interface Sony's own apps use on the local network. Everything runs to the TV's own LAN IP on port 80; there is no separate gateway or serial adapter. One TV becomes one GEM device, and commands target that device directly — this driver creates no zones.
Control is authenticated with a Pre-Shared Key (PSK) that you set on the TV first. Once the PSK is entered on both ends, GEM can turn the set on and off, switch inputs, set volume and mute, tune channels, send any remote-control key, and poll the TV so power, volume, mute, and the current input stay live on your touchpanels and in triggers.
This driver is for BRAVIA Android/Google TVs over the HTTP (REST/IRCC) API with a Pre-Shared Key. GEM ships several Sony drivers — pick by how the set is reachable. The others do not yet have their own guide pages, so they are listed here by their driver picker names:
- Sony BRAVIA TV (HTTP) — this driver. Modern BRAVIA Android/Google TVs; network control with a PSK. Reach for this first for any current networked BRAVIA.
- Sony TV (Simple IP Control) — the older text-based "Simple IP Control" protocol on TCP 20060, for BRAVIA models that expose that port instead of the REST API.
- Sony TV (Serial over IP) — the TV's RS-232 service port carried over a serial-to-IP gateway, for sets with no working network control.
- Sony Projector (IP Control), Sony Blu-ray (UPnP), and Sony AV Receiver (Legacy HTTP) cover the matching Sony source and display gear.
Reach for this driver when the set is a networked BRAVIA and you can enable IP Control and set a Pre-Shared Key in its menus.
What's controlled
- Power — on and off, with a power-state query. Power runs over the network, so the set must keep networking alive in standby (see Power and standby).
- Inputs — jump straight to HDMI 1–4, select any external input by name, list the TV's available sources, and read back the input currently showing on screen.
- Volume and mute — set an absolute volume level, step it up/down, and mute on/off, all against the TV's own speakers/output.
- Channels — tune a digital channel by its on-screen number (ATSC cable tuner).
- Remote-control keys — send any button from the Sony remote (navigation pad, Home, Back, the colored keys, transport keys, etc.) for driving on-screen menus and apps from a touchpanel.
- Direct content and raw API — play an arbitrary content URI, or pass a raw call straight through to any Sony API method for anything the named commands don't cover.
- Live status feedback — GEM polls the TV every few seconds and reports power, volume, mute, and the current input, so a UI button or a trigger stays in sync even when someone uses the Sony remote.
Prerequisites
- The TV on the same network as GEM, reachable at a fixed IP (give it a static IP or a DHCP reservation so the address never moves).
- IP Control enabled with a Pre-Shared Key on the TV. On the set, open Settings → Network → Home network → IP control, enable control (labelled Simple IP Control / Authentication: Normal and Pre-Shared Key on most firmware), and set a Pre-Shared Key. The exact menu wording moves around between BRAVIA firmware versions, but it always lives under the network / IP-control settings, and the key you type here is the one GEM must match.
- Automatic firmware updates turned off on the TV. When the set queues a firmware-update prompt it blocks the control API until the prompt is dismissed on-screen, so a TV that "stops responding" overnight is usually sitting on an update dialog. Disable auto-update in the TV's system settings.
Setup
- Open Devices, add a device, and choose the Sony BRAVIA TV (HTTP) driver.
- Choose the AV subsystem and the tv device type for the new device.
- Fill in the connection fields:
- TV IP Address (required) — the TV's own LAN IP (for example
192.168.1.50). - Pre-Shared Key (required) — the PSK you set on the TV under IP Control. This value is stored encrypted.
- Leave Port blank — control uses port 80. (If a leftover
20060is present from the Simple IP Control driver, GEM ignores it and still uses 80.) - MAC Address and Status Poll Interval (ms) are optional — see below.
- TV IP Address (required) — the TV's own LAN IP (for example
- Save and enable the device. GEM begins polling the TV immediately.
- On the device's Commands tab, run
get_power, thenpower_on/power_offand anhdmi_1to confirm control end-to-end before wiring the TV into macros or a UI.
Power and standby
power_on and power_off send the TV's REST power call — they do not send a Wake-on-LAN magic
packet. That means the TV's network interface has to stay awake while the set is "off":
- For
power_onto work, leave the TV in networked standby — the BRAVIA setting variously labelled Remote start, Network standby, or Power on by network. With it on, the set answers the REST call and powers up. With it off, a fully-powered-down TV won't respond and only a physical remote or a WoL packet from elsewhere can wake it. - The MAC Address field is offered for Wake-on-LAN, but this driver does not currently send a magic packet itself — treat it as informational. If a site genuinely powers the panel all the way down, wake it with networked standby (above) rather than expecting this driver to WoL it.
- When the TV reports it has gone to standby, GEM records the device's
power_stateasoff; when the API stops answering with the TV's "not powered" response, GEM also flipspower_statetooff. So the power readout tracks the real set even when it's switched off at the panel.
Inputs
- HDMI shortcuts.
hdmi_1throughhdmi_4jump straight to those HDMI ports — the simplest, most reliable way to switch a BRAVIA. - Any input by name. The
inputcommand takes aninputargument in the form<type>_<port>— for examplehdmi_1,hdmi_3, orcomponent_1. GEM turns that into the Sony external-input URI for you. This is the general form the HDMI shortcuts are a convenience for. - List the sources.
get_source_listasks the TV for the input types it exposes (HDMI, component, etc.) — handy when you need the exact<type>string for theinputcommand on an unfamiliar model. - Read the current input.
get_inputqueries what's on screen now; GEM also polls this automatically and stores it in the deviceinputattribute as the<type>_<port>string (e.g.hdmi_1), so a UI can show which source is live.
Volume and mute
- Absolute volume. Send the
volumecommand with avolumeargument (the TV's own volume scale, typically 0–100) to set the level on the TV's speakers/output. - Stepping.
volume_upandvolume_downnudge the level one step at a time. - Mute.
mute_onandmute_offmute and unmute directly — these are native TV calls, so there's no state-check delay. - Reading it back.
get_volumequeries the current level; GEM also polls volume and mute in the background and stores them in the devicevolumeandmute_stateattributes.
If the room's audio comes out of the TV's own speakers, you can make this TV the AV zone's volume device: open AV Zones, edit the zone, and set its Volume Device to this TV so the zone's volume slider and mute button drive the set. If the room audio instead runs through a receiver, amp, or soundbar, leave that device as the zone's Volume Device and point the TV's own audio output away from its speakers, so you aren't fighting two volume controls at once.
Channels
set_channel takes a channel argument (the on-screen channel number, e.g. 7.1) and tunes it on
the ATSC cable tuner. The first time it runs, GEM asks the TV for its scanned channel list and
matches your number against it, so:
- The TV must have completed a channel scan for the tuner, or GEM reports "channel not found — has it been scanned?".
- This command targets the ATSC cable source specifically. For non-tuner content, use the input and HDMI commands instead.
Remote-control keys, content, and raw API
- Any remote button —
remote_key. The named commands cover power, inputs, volume, and channels, but there are no discrete navigation commands in the command list — driving on-screen menus and apps is done withremote_key, which takes akeyargument. Valid keys include:up,down,left,right,confirm,home,back,options,display,help,channel_up,channel_down,volume_up,volume_down,mute_toggle,audio,input,sync_menu,hdmi1–hdmi4, the digits0–9,period,cc, the colored keysred/green/yellow/blue, and the transport keysplay,pause,stop,previous,next,flash_plus,flash_minus. (Notemute_toggleis available here even though there's no standalone mute-toggle command —remote_keywithmute_toggleflips mute.) - Play a content URI —
set_play_content. Send auriargument (a Sony content URI such as anextInput:ortv:URI) to jump directly to that content. - Raw API —
pass_through. For anything the named commands don't reach,pass_throughcalls any Sony API method directly. Supplyservice(e.g.system,audio,avContent),method(the Sony method name), optionalparams(a JSON object as a string), and optionalversion(defaults to1.0). Use this only with Sony's BRAVIA REST reference in hand.
The remote_key command authenticates against a psk (or password) attribute — not the
preshared_key field the rest of the commands use. So on a device where power, inputs, and volume
all work, remote_key can still fail authentication. If that happens, add a second attribute named
psk holding the same Pre-Shared Key, and the remote keys will start working. (set_play_content,
pass_through, and all the other commands read preshared_key and are unaffected.)
Live status feedback
GEM polls the TV about every 15 seconds (the Status Poll Interval default) and, on each pass,
reads the current external input, the power status, and the volume/mute state. Each is written to a
device attribute — power_state, input, volume, mute_state — so a touchpanel button, a
dashboard, or a trigger reflects the set's real state even when someone changes it with the Sony
remote. Raise the interval if you want lighter network traffic; lower it for snappier feedback.
Attributes
status_interval is specific to this driver; the live status attributes (power_state, input,
volume, mute_state) are set automatically by GEM as it polls — you don't create them by hand, but
type them exactly when you reference them in a trigger or macro.
Device — required
| Attribute | Type | Description |
|---|---|---|
ip | string | The TV's own LAN IP address (e.g. 192.168.1.50). |
preshared_key | string | The Pre-Shared Key set on the TV under IP Control. Stored encrypted. |
Device — optional
| Attribute | Type | Default | Description |
|---|---|---|---|
mac_address | string | — | TV MAC address. Offered for Wake-on-LAN, but this driver does not currently send a magic packet — informational only (see Power and standby). |
status_interval | int | 15000 | How often (ms) GEM polls the TV for power, input, volume, and mute. |
psk | string | — | Optional. The same Pre-Shared Key, needed only if you use the remote_key command (see the warning above). Also read as password. |
The driver inherits the standard HTTP-device tuning fields; the defaults suit a TV on a LAN, so leave them alone unless you have a reason to change them.
Device — status (set automatically)
| Attribute | Type | Description |
|---|---|---|
power_state | string | on / off. |
input | string | Current input as <type>_<port>, e.g. hdmi_1. |
volume | int | Current volume level. |
mute_state | string | on / off. |
Commands
Driver-declared commands appear on the device's Commands tab and can be used in macros, triggers, and on UI buttons.
Power
| Command | Action |
|---|---|
power_on | Turn the TV on (requires networked standby — see above). |
power_off | Turn the TV off (to standby). |
get_power | Query the current power state. |
Inputs
| Command | Action |
|---|---|
hdmi_1 … hdmi_4 | Jump to HDMI input 1–4. |
input (arg input) | Select an input by name, form <type>_<port> (e.g. hdmi_2, component_1). |
get_source_list | List the input types the TV exposes. |
get_input | Query the input currently on screen. |
Volume and mute
| Command | Action |
|---|---|
volume (arg volume) | Set absolute volume (TV's own scale, typically 0–100). |
volume_up / volume_down | Step the volume up / down. |
mute_on / mute_off | Mute / unmute (native TV calls). |
get_volume | Query the current volume and mute state. |
Channels, keys, and advanced
| Command | Action |
|---|---|
set_channel (arg channel) | Tune an on-screen channel number on the ATSC cable tuner (needs a completed scan). |
remote_key (arg key) | Send any Sony remote button — see the key list above. |
set_play_content (arg uri) | Play a specific Sony content URI. |
pass_through (args service, method, params, version) | Call any Sony API method directly (raw escape hatch). |
Known limitations and quirks
- Firmware-update prompts block the API. A queued update dialog freezes control until it's dismissed on the TV. Disable auto-update to avoid an overnight "stopped responding."
- No Wake-on-LAN magic packet.
power_onis a network call, so the TV must keep networked standby enabled; a fully-powered-down set won't wake from this driver. remote_keyusespsk/password, notpreshared_key. Add apskattribute with the same key if you use remote keys (see the warning above).set_channelis ATSC-cable only and depends on a completed channel scan on the TV.- Single device, no zones. A BRAVIA is one GEM device; it creates no zones. Group rooms and multi-room behavior at the AV-zone / macro layer.
Troubleshooting
| Symptom | Check |
|---|---|
| Nothing responds at all | Confirm IP Control is enabled on the TV and the Pre-Shared Key matches on both ends. Confirm the TV's IP is reachable from GEM and hasn't changed (use a static IP / DHCP reservation). |
| Worked, then went dead overnight | Check the TV screen for a firmware-update prompt — it blocks the API until dismissed. Turn off automatic updates. |
power_on does nothing when the TV is fully off | Enable networked standby (Remote start / Network standby) on the TV. This driver does not send a Wake-on-LAN packet. |
Power/volume/input work but remote_key returns an auth error | Add an attribute named psk with the same Pre-Shared Key — remote_key reads that field, not preshared_key. |
set_channel says "channel not found" | Run a channel scan on the TV's ATSC cable tuner first; this command matches against the TV's scanned list. |
| Volume slider does nothing | Confirm the TV's own speakers are the audio path and this TV is set as the zone's Volume Device; if the room uses a receiver/amp, that device should be the Volume Device instead. |
| Power/volume readout never reflects the Sony remote | Confirm the TV is reachable and polling is running (Status Poll Interval isn't set absurdly high); the background poll is what catches changes made from the remote. |
See also
- AV Zones — set the TV as a zone's Volume Device for volume and mute.
- Devices — adding and configuring devices.
- Commands — running and scripting device commands.
- Attributes — editing device attributes such as
status_interval. - Triggers — fire automations on the TV's power, volume, mute, or input.