Skip to main content

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.

Which Sony TV driver?

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

  • Powerpower_on, power_off, and a Control-S standby-enable command. A get_power query 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 volume and power_state attributes (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 4999 on 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

  1. 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.
  2. 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.
  3. 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 as port.
  4. 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.
  5. Save and enable the device. GEM opens a persistent TCP connection to the gateway and keeps it up, reconnecting automatically if the link drops.
  6. On the device's Commands tab, run get_power, then power_on / power_off and an hdmi_1 to 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.

AttributeSet it toWhy
encodinghexThe 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.
danger
Set Encoding to hex or nothing works

This 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_up and volume_down send 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_toggle flips mute. This driver has only a toggle — there are no discrete mute_on / mute_off commands, and it does not track a mute state, so drive mute with the toggle.
  • Absolute volume. A volume command exists and takes a volume argument (0100), but it records the requested level to the volume attribute 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 use volume_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_1 through hdmi_4 jump 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, and home map to the matching remote keys; info shows the info banner and action_menu opens the action menu. These are handy for driving the TV's on-screen menus from a touchpanel button.

Power and standby

  • power_on and power_off send the Control-S power frames. enable_standby sends 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_on does 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 volume attribute (0100);
  • a power reply → written to the power_state attribute (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

AttributeTypeDescription
ipstringLAN IP of the serial-to-IP gateway that fronts the TV (not the TV's own IP).
portintTCP port on that gateway mapped to the RS-232 channel wired to the TV (e.g. 4999).

Device — required for the binary protocol

AttributeTypeSet toDescription
encodingstringhexTransmit and parse Control-S frames as raw bytes. Must be hex; the default utf8 sends the frames as literal text.
response_terminatorstring(blank)Clear it — Control-S replies carry no terminator, and a set terminator blocks status parsing.

Device — status (set automatically)

AttributeTypeDescription
volumeintLast reported volume, 0100. Written from the TV's volume reply frames.
power_statestringLast 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

CommandSendsAction
power_on8C 00 00 02 01 8FTurn the TV on.
power_off8C 00 00 02 00 8ETurn the TV off (standby).
enable_standby8C 00 01 02 01 90Arm the set's standby-enable so power_on can wake it.
get_power83 00 00 FF FFQuery the current power state → power_state.

Volume and mute

CommandSendsAction
volume_up8C 00 05 03 00 00 94Step volume up.
volume_down8C 00 05 03 00 01 95Step volume down.
mute_toggle8C 00 06 02 00 94Toggle mute (no discrete on/off).
get_volume83 00 05 FF FF 86Query the current volume → volume.
volume (arg volume)Records the requested 0100 level to the volume attribute; does not send a volume frame. Use volume_up / volume_down to change the set.

Inputs

CommandSendsAction
hdmi_18C 00 02 03 04 01 96Select HDMI 1.
hdmi_28C 00 02 03 04 02 97Select HDMI 2.
hdmi_38C 00 02 03 04 03 98Select HDMI 3.
hdmi_48C 00 02 03 04 04 99Select HDMI 4.
CommandSendsAction
up down left right8C 00 67 03 01 74/75/34/33 …Directional pad.
enter8C 00 67 03 01 65 5CSelect.
back8C 00 67 03 97 23 B0Back / return.
home8C 00 67 03 01 60 57Home menu.
info8C 00 0F 02 00 9DShow the info banner.
action_menu8C 00 67 03 97 36 C3Open the action menu.

Known limitations and quirks

  • Binary transport must be configured. Set Encoding to hex and 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 volume command stores the requested level but sends no volume frame — use volume_up / volume_down.
  • Mute is toggle-only. There are no discrete mute_on / mute_off commands, and mute state is not tracked; use mute_toggle.
  • No automatic status poll. Volume and power read back only when a reply arrives — run get_volume / get_power on 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

SymptomCheck
Connects to the gateway, but no command does anythingEncoding 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 updateClear 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 allConfirm 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 respondsEnable 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 offThe 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 effectExpected — 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 / reconnectingVerify 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