Sony TV (Serial over IP)
Sony BRAVIA and Pro/B2B displays expose an RS-232 control port that speaks Sony's binary Control-S protocol. This driver reaches that port over the network by carrying the serial line through a serial-to-IP gateway — a Global Caché iTach IP2SL, a Brainboxes ES/SW box, a MOXA NPort, or any TCP↔serial adapter. One TV becomes one GEM device, and commands target that device directly; this driver creates no zones of its own. It can still be attached to an AV zone (as the zone's display / volume device).
Control-S frames are short binary packets — for example 8C 00 00 02 01 8F (power on). They are
not text: GEM transmits them as raw bytes and parses the TV's binary replies back into device
attributes. Getting that byte-level handling right is a small but essential commissioning step —
see Make the binary protocol work, which you must complete or the
device will look connected while doing nothing.
GEM ships three Sony TV drivers — pick by how the set is reachable:
- Sony BRAVIA TV (HTTP) — modern BRAVIA Android / Google TVs over the REST/IRCC HTTP API with a Pre-Shared Key. Reach for this first for any current networked BRAVIA. See Sony BRAVIA TV (HTTP).
- Sony TV (Simple IP Control) — the older text-based Simple IP Control protocol on TCP 20060, straight to the TV's own IP with no serial adapter. See Sony TV (Simple IP Control).
- Sony TV (Serial over IP) — this driver. The TV's RS-232 Control-S service port carried over a serial-to-IP gateway, for sets with no working network control.
Reach for this driver when the set has an RS-232 control port and no usable network API, and you are wiring that port to a serial gateway. If the set answers on the network (HTTP with a Pre-Shared Key, or Simple IP Control on 20060), prefer one of those drivers — they need no gateway.
What's controlled
- Power —
power_on,power_off, and a Control-S standby-enable command. Aget_powerquery reads the set's power state back into an attribute. - Volume and mute — step the level up/down (
volume_up/volume_down), toggle mute (mute_toggle), and query the current level (get_volume). See Volume and the TV's speakers for how absolute volume behaves. - Inputs — jump straight to HDMI 1–4.
- Navigation — the directional pad,
enter,back,home,info, and the action menu, for driving on-screen menus from a touchpanel. - Status read-back — the TV's volume and power replies are parsed into the
volumeandpower_stateattributes (once the binary transport is configured — see below).
Prerequisites
- A Sony BRAVIA / Pro display with an RS-232 control port, with Control-S enabled in the TV's service menu. Many BRAVIA generations leave the RS-232 port dormant until Control-S is turned on there, so the set ignores every frame until you do.
- A serial-to-IP gateway wired to that port and configured for raw TCP at 9600 baud,
8N1. Note the gateway's LAN-side IP and the TCP port mapped to that serial channel (for
example port
4999on an iTach IP2SL). - The gateway reachable from GEM on the same network, with the serial port in raw / transparent TCP mode — not Telnet mode, which inserts protocol bytes that corrupt the binary frames.
Setup
- Wire the TV's RS-232 port to the serial-to-IP gateway (9600 baud, 8N1) and put the gateway's serial channel in raw TCP mode.
- Open Devices, add a device, and choose the Sony TV (Serial over IP) driver. It suggests the AV subsystem and a display device type — accept those.
- Fill in the connection fields:
- Gateway IP (required) — the LAN IP of the serial-to-IP gateway that fronts the TV. This
is not the TV's own IP. Enter the attribute exactly as
ip. - TCP Port (required) — the TCP port on the gateway mapped to the RS-232 channel wired to
the TV (e.g.
4999). Enter the attribute exactly asport.
- Gateway IP (required) — the LAN IP of the serial-to-IP gateway that fronts the TV. This
is not the TV's own IP. Enter the attribute exactly as
- Complete Make the binary protocol work below — set the Encoding and Response Terminator attributes. Without this the device connects but no command has any effect.
- Save and enable the device. GEM opens a persistent TCP connection to the gateway and keeps it up, reconnecting automatically if the link drops.
- 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.
Make the binary protocol work
Control-S is a binary protocol, so two device attributes must be set before the driver can transmit its frames or read the TV's replies. Neither is filled in automatically — set both during commissioning. Add them on the device's Attributes tab (they appear in the attribute name list, inherited from the generic TCP transport), then reload the device so the change takes effect.
| Attribute | Set it to | Why |
|---|---|---|
encoding | hex | The command frames are space-separated hex bytes. GEM only converts them to the real bytes on the wire — and only turns the TV's byte replies back into a parseable string — when Encoding is hex. Left at the default (utf8), GEM sends the characters 8C 00 00 … as plain text and the TV ignores them. |
response_terminator | (blank / empty) | Control-S replies are fixed-length frames with no line terminator. With a terminator set (the default is a carriage return), GEM waits for a delimiter that never arrives and never hands the reply to the parser — so volume / power_state never update. Clear the field. |
hex or nothing worksThis is the single most common reason a freshly added Sony serial TV "connects but does nothing."
The device shows a live TCP connection to the gateway, yet every command is silently discarded
because the hex frames are going out as literal text. Set Encoding to hex and reload the
device.
Sending is fixed once Encoding is hex; the Response Terminator must additionally be blank for
the status read-back to populate.
Volume and the TV's speakers
- Stepping (recommended).
volume_upandvolume_downsend the fixed Control-S step frames and are the reliable way to change volume on this driver. Each nudges the level one step. - Mute.
mute_toggleflips mute. This driver has only a toggle — there are no discretemute_on/mute_offcommands, and it does not track a mute state, so drive mute with the toggle. - Absolute volume. A
volumecommand exists and takes avolumeargument (0–100), but it records the requested level to thevolumeattribute rather than sending a dedicated Control-S volume frame — so it does not, on its own, move the set to that level. For dependable volume control usevolume_up/volume_down.
If the room's audio comes from the TV's own speakers, 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 and mute controls drive the set (via the step and toggle commands above). If the room audio instead runs through a receiver, amp, or soundbar, leave that device as the zone's Volume Device and route the TV's own audio away from its speakers, so you aren't fighting two volume controls at once.
Inputs and navigation
- Inputs.
hdmi_1throughhdmi_4jump straight to those HDMI inputs. There is no on-screen "source list" command on this driver — use the specific HDMI commands. - Navigation.
up,down,left,right,enter,back, andhomemap to the matching remote keys;infoshows the info banner andaction_menuopens the action menu. These are handy for driving the TV's on-screen menus from a touchpanel button.
Power and standby
power_onandpower_offsend the Control-S power frames.enable_standbysends the Control-S standby-enable frame — use it if the set needs its network/quick-start standby armed before it will answer a power-on frame from a fully-off state.- If
power_ondoes nothing when the set is fully off, the TV's RS-232 port has powered all the way down. Enable the TV's quick-start / network standby mode (labels vary by model) so the control port stays alive in standby. - Control-S can be turned off again when a firmware update power-cycles the set. If commands stop working after a TV update, re-enable Control-S in the service menu.
Live status feedback
Once the binary transport is configured (Encoding hex, Response
Terminator blank), the driver parses two reply frames:
- a volume reply → written to the
volumeattribute (0–100); - a power reply → written to the
power_stateattribute (on/off).
This driver does not run an automatic background status poll, so those attributes refresh when a
reply actually arrives — for example right after you run get_volume or get_power, or when
the set sends an unsolicited status frame. To keep a touchpanel or a trigger in sync, run the
get_power / get_volume queries on a schedule (a repeating macro or a
timed trigger) or immediately after each control command, rather than
relying on the set to push updates on its own.
Attributes
ip and port are the connection to the gateway. encoding and response_terminator are the
binary-transport settings covered above. The status attributes (volume, power_state) are set by
GEM as replies come in — 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 | LAN IP of the serial-to-IP gateway that fronts the TV (not the TV's own IP). |
port | int | TCP port on that gateway mapped to the RS-232 channel wired to the TV (e.g. 4999). |
Device — required for the binary protocol
| Attribute | Type | Set to | Description |
|---|---|---|---|
encoding | string | hex | Transmit and parse Control-S frames as raw bytes. Must be hex; the default utf8 sends the frames as literal text. |
response_terminator | string | (blank) | Clear it — Control-S replies carry no terminator, and a set terminator blocks status parsing. |
Device — status (set automatically)
| Attribute | Type | Description |
|---|---|---|
volume | int | Last reported volume, 0–100. Written from the TV's volume reply frames. |
power_state | string | Last reported power state, on / off. Written from the TV's power reply frames. |
The driver also inherits the standard TCP tuning fields (reconnect timing, command_throttle,
etc.); the defaults suit a TV on a gateway, so leave them alone unless a slow gateway is dropping
back-to-back commands, in which case raise command_throttle.
Commands
Driver-declared commands appear on the device's Commands tab and can be used in macros,
triggers, and on UI buttons. The Sends column is the raw Control-S frame (hex) that goes out on
the wire once Encoding is hex, shown so you can match it against Sony's Control-S reference.
These frames are sent verbatim — the driver does not compute a checksum for them (the checksum
byte is already part of each frame).
Power
| Command | Sends | Action |
|---|---|---|
power_on | 8C 00 00 02 01 8F | Turn the TV on. |
power_off | 8C 00 00 02 00 8E | Turn the TV off (standby). |
enable_standby | 8C 00 01 02 01 90 | Arm the set's standby-enable so power_on can wake it. |
get_power | 83 00 00 FF FF | Query the current power state → power_state. |
Volume and mute
| Command | Sends | Action |
|---|---|---|
volume_up | 8C 00 05 03 00 00 94 | Step volume up. |
volume_down | 8C 00 05 03 00 01 95 | Step volume down. |
mute_toggle | 8C 00 06 02 00 94 | Toggle mute (no discrete on/off). |
get_volume | 83 00 05 FF FF 86 | Query the current volume → volume. |
volume (arg volume) | — | Records the requested 0–100 level to the volume attribute; does not send a volume frame. Use volume_up / volume_down to change the set. |
Inputs
| Command | Sends | Action |
|---|---|---|
hdmi_1 | 8C 00 02 03 04 01 96 | Select HDMI 1. |
hdmi_2 | 8C 00 02 03 04 02 97 | Select HDMI 2. |
hdmi_3 | 8C 00 02 03 04 03 98 | Select HDMI 3. |
hdmi_4 | 8C 00 02 03 04 04 99 | Select HDMI 4. |
Navigation
| Command | Sends | Action |
|---|---|---|
up down left right | 8C 00 67 03 01 74/75/34/33 … | Directional pad. |
enter | 8C 00 67 03 01 65 5C | Select. |
back | 8C 00 67 03 97 23 B0 | Back / return. |
home | 8C 00 67 03 01 60 57 | Home menu. |
info | 8C 00 0F 02 00 9D | Show the info banner. |
action_menu | 8C 00 67 03 97 36 C3 | Open the action menu. |
Known limitations and quirks
- Binary transport must be configured. Set Encoding to
hexand clear Response Terminator, or the device connects but no command works and no status reads back (see Make the binary protocol work). - Control-S must be enabled on the TV. Many BRAVIA models leave the RS-232 port dormant until Control-S is turned on in the service menu, and a firmware update can switch it back off.
- Absolute volume doesn't drive the set. The
volumecommand stores the requested level but sends no volume frame — usevolume_up/volume_down. - Mute is toggle-only. There are no discrete
mute_on/mute_offcommands, and mute state is not tracked; usemute_toggle. - No automatic status poll. Volume and power read back only when a reply arrives — run
get_volume/get_poweron a schedule to keep a touchpanel in sync. - Single device, no zones. A Sony TV is one GEM device; it creates no control zones. Attach it to an AV zone and group multi-room behavior at the AV-zone / macro layer.
Troubleshooting
| Symptom | Check |
|---|---|
| Connects to the gateway, but no command does anything | Encoding is still utf8. Set the device's encoding attribute to hex and reload the device — the hex frames are otherwise sent as plain text and ignored. |
Commands work, but volume / power_state never update | Clear the response_terminator attribute (leave it blank). Control-S replies have no terminator, so a set terminator blocks parsing. Then run get_power / get_volume — this driver doesn't auto-poll. |
| Nothing connects at all | Confirm the gateway's serial channel is in raw TCP mode (not Telnet), and that Gateway IP / TCP Port point at the serial line — not at the TV's own IP. Confirm the gateway is reachable from GEM. |
| Connects, but the TV never responds | Enable Control-S in the TV's service menu, and confirm the gateway is set to 9600 baud, 8N1. If it worked before and went dead, a firmware update may have disabled Control-S. |
power_on does nothing when the TV is fully off | The RS-232 port powered down with the set. Enable the TV's quick-start / network standby, and use enable_standby so the control port stays alive in standby. |
| Absolute volume set has no effect | Expected — the volume command records the level but sends no frame. Use volume_up / volume_down, or make the TV the AV zone's Volume Device and drive it with the step commands. |
| Link keeps dropping / reconnecting | Verify only GEM is connected to that gateway port — many serial gateways allow a single TCP client at a time, so a second controller or a stuck session will fight GEM for the port. |
See also
- Sony BRAVIA TV (HTTP) — the modern REST/IRCC BRAVIA driver, commands ready to use.
- Sony TV (Simple IP Control) — text-based Simple IP Control straight to the TV on TCP 20060.
- Global Caché (iTach / Flex / GC-100) — a common serial-to-IP gateway that fronts this driver (Brainboxes and MOXA NPort adapters work the same way).
- AV Zones — attach the TV to a zone and set it as the zone's Volume Device.
- Devices — adding and configuring devices.
- Attributes — editing device attributes such as
encoding. - Commands — running and scripting device commands.
- Triggers — fire automations on the TV's power or volume state.