Samsung TV (Serial-over-IP)
Samsung consumer and Frame TVs expose a hidden RS-232 service port that accepts Samsung's hex-framed serial control protocol. This driver reaches that port over the network by carrying the serial line through a serial-to-IP adapter (a Global Caché iTach IP2SL, a Brainboxes ES/SW box, a MOXA NPort, or any TCP↔serial gateway). One TV becomes one GEM device, and commands target that device directly — this driver creates no zones.
Because the service port is silent when the TV is off, this driver also talks to the TV over the network — using the set's own LAN IP — to read volume and mute back and to work out whether the panel is on. So a full install uses two addresses: the adapter's IP/port for the serial control link, and the TV's own IP for status feedback.
This driver is for control over the TV's RS-232 service port through a serial-to-IP adapter. Three siblings cover other cases — pick by how the set is reachable:
- Samsung TV (Tizen WebSocket) — most networked consumer Tizen smart TVs (control over Wi-Fi/LAN, on-screen pairing).
- Samsung TV (Pro / HTTPS) — newer/Pro Tizen models using the HTTPS token-pairing API on port 1516.
- Samsung MDC — Samsung commercial/signage displays that speak the MDC protocol (a different serial/LAN command set, with Display ID addressing).
Reach for this driver when the set is a consumer/Frame TV with no working network control API and you are wiring its service port to a serial gateway.
What's controlled
- Power — on and off, with a power-state query. Because the serial port goes quiet when the TV is off, GEM infers power (see How GEM knows the TV is on).
- Volume and mute — set an absolute volume level 0–100, step it up/down, and mute. Mute has a native toggle; discrete mute-on / mute-off are handled with a state check (see below).
- Inputs — jump straight to HDMI 1–4 or to the tuner.
- Channels — direct channel entry (analog or digital), channel up/down, last channel, and the
numeric keypad
0–9. - Navigation and keys — the directional pad,
enter,menu,guide,exit,info, andback. - Art Mode — turn The Frame's Art Mode on or off.
- Live status feedback — GEM polls the TV and reports whether it's on, its current volume, and its mute state, so a touchpanel and triggers stay in sync.
Prerequisites
- A TTL/RS-232 serial adapter wired to the TV's service port and exposed over TCP. Samsung's
service port runs at TTL logic levels, not standard RS-232 voltages — a plain RS-232
gateway may need a level shifter in between, or the link will look dead. Note the gateway's
LAN-side IP and TCP port (for example port
4999on an iTach IP2SL). - The TV's own LAN IP, reachable from GEM with no NAT in between. Give the TV a static IP or a DHCP reservation so the address never moves. GEM uses this address for volume/mute read-back and power detection over the TV's built-in service — see below.
- The TV and GEM on the same network segment for the status link.
Setup
- Open Devices, add a device, and choose the Samsung TV (Serial-over-IP) driver. It suggests the AV subsystem and a tv device type — accept those.
- Fill in the fields:
- Adapter IP (required) — the LAN IP of the serial-to-IP adapter that fronts the TV's service port. This is not the TV's own IP.
- TCP Port (required) — the TCP port on that adapter mapped to the TV's serial line
(e.g.
4999on an iTach IP2SL). - TV IP (for Power Check) (optional but strongly recommended) — the TV's own LAN IP.
Without it, GEM cannot read volume/mute back or detect a power-off (see below). Enter the
attribute exactly as
tv_ip. - Status Poll Interval (ms) (optional) — how often GEM re-queries the TV over the serial
link. Defaults to
60000(60 s). Enter the attribute exactly asstatus_interval.
- Save and enable the device. GEM opens a persistent TCP connection to the adapter and keeps it up, reconnecting automatically if the link drops.
- On the device's Commands tab, run
get_power, thenpower_on/power_offto confirm control end-to-end before wiring the TV into macros or a UI.
How GEM knows the TV is on
The service port does not answer over serial when the TV is powered off, so a serial query alone can't tell "off" from "cable unplugged." GEM uses two mechanisms together, and both work best when TV IP is set:
- Network read-back (needs
tv_ip). Every few seconds GEM contacts the TV's built-in media service on the TV's own IP. If that service answers, the TV is on, and GEM reads the current volume and mute from it; if it stops answering, GEM marks the TV off. This is the reliable path, and it's also what keeps the volume and mute readouts live when someone changes them with the Samsung remote. - Serial heuristic. On the serial link, when GEM sees the TV report a state change it re-sends a power query; if nothing comes back within a few seconds it concludes the TV is off. It also marks the TV off if the set goes silent for three poll intervals while GEM believed it was on.
If TV IP is blank, only the serial heuristic runs — GEM can still send commands, but the power/volume/mute readouts become unreliable and may stick on the last seen value.
Volume, mute, and the TV's own speakers
- Absolute volume. Send the
volumecommand with avolumeargument from 0 to 100. You always work in plain 0–100; GEM converts the level to the byte the Samsung frame expects. - Stepping.
volume_upandvolume_downnudge the level one step at a time. - Mute.
mute_toggleflips mute directly.mute_onandmute_offare handled with a check: GEM first queries the current mute state, waits about 500 ms, and only sends a toggle if the state actually needs to change (somute_onon an already-muted TV does nothing). On a slow or noisy serial link that extra query can add a small delay, and a missed reply can make the discrete commands look like they flap — prefermute_toggle, or raise the command gap, if that happens.
If the room's audio comes out of the TV's own speakers, make this TV the AV zone's volume device: open AV Zones, edit the zone, and set the Volume Device field ("Device that controls volume for this zone") to this TV. The zone's volume slider and mute button then route to the TV. If the room audio instead comes from a receiver, amp, or soundbar, leave that device as the zone's Volume Device and set the TV's own audio output away from its speakers, so you aren't fighting two volume controls at once.
Inputs and channels
- Inputs.
hdmi_1throughhdmi_4jump to those HDMI inputs;tunerswitches to the TV tuner. There is no on-screen "source list" command on this driver — use the specific input commands. - Direct channel entry.
channeltakes three arguments:tuner(atvfor analog ordtvfor digital),major(the channel number), andminor(the sub-channel,0when there isn't one). GEM applies the encoding Samsung's frame requires — you supply plain channel numbers. - Channel stepping.
channel_up,channel_down, andprevious_channel(jump back to the last channel). - Keypad. The digit commands
0–9send the numeric remote keys, andguideopens the program guide.
GEM queries the current input as part of status polling, but this driver does not store or report a "current input / source" value — only power, volume, and mute are surfaced as live attributes. Drive input selection with the input commands rather than reading a current-input attribute.
Navigation and Art Mode
- Navigation.
up,down,left,right,enter,menu,guide,exit,info, andbackmap to the matching remote keys — useful for driving on-screen menus from a touchpanel. - Art Mode (The Frame).
art_mode_onandart_mode_offtoggle The Frame's Art Mode.
Sending a raw frame
For anything the named commands don't cover, passthrough takes a single command argument
and sends it to the TV verbatim — supply the exact space-delimited hex bytes for the Samsung
frame you want (see the wire strings in the command tables for the format). Use this
only when you have Samsung's RS-232 reference in hand; a malformed frame is simply ignored by the
set.
Attributes
tv_ip and status_interval are specific to this driver and are not offered in the attribute
autocomplete list — type them exactly as shown when you add them. The live status attributes
(power_state, volume, mute_state) are standard device attributes GEM sets automatically; 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 adapter that fronts the TV's service port (not the TV's own IP). |
port | int | TCP port on that adapter mapped to the TV serial line (e.g. 4999 on an iTach IP2SL). |
Device — optional
| Attribute | Type | Default | Description |
|---|---|---|---|
tv_ip | string | — | The TV's own LAN IP. Enables network read-back of volume/mute and power detection. Leave blank only if the TV isn't on the LAN. |
status_interval | int | 60000 | How often (ms) GEM re-queries the TV over the serial link. |
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 adapter is dropping
back-to-back commands, in which case raise command_throttle (default 200 ms).
Device — status (set automatically)
| Attribute | Type | Description |
|---|---|---|
power_state | string | on / off. |
volume | int | Current volume 0–100. |
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. The Sends column is the raw Samsung serial frame (hex), shown so you can match it against Samsung's RS-232 control reference; GEM appends the checksum byte automatically where a frame ends in one.
Power
| Command | Sends | Action |
|---|---|---|
power_on | 08 22 00 00 00 02 D4 | Turn the TV on. |
power_off | 08 22 00 00 00 01 D5 | Turn the TV off. |
get_power | 08 22 F0 00 00 00 E6 | Query the current power state. |
Volume and mute
| Command | Sends | Action |
|---|---|---|
volume (arg volume) | 08 22 01 00 00 [volume] [checksum] | Set absolute volume; volume is 0–100. |
volume_up | 08 22 01 00 01 00 D4 | Step volume up. |
volume_down | 08 22 01 00 02 00 D3 | Step volume down. |
get_volume | 08 22 f0 01 00 00 E5 | Query the current volume. |
mute_toggle | 08 22 02 00 00 00 D4 | Toggle mute directly. |
mute_on | — | Mute (checks current state first, then toggles if needed). |
mute_off | — | Unmute (checks current state first, then toggles if needed). |
get_mute | 08 22 F0 02 00 00 E4 | Query the current mute state. |
Inputs and channels
| Command | Sends | Action |
|---|---|---|
hdmi_1 … hdmi_4 | 08 22 0a 00 05 00…03 … | Jump to HDMI input 1–4. |
tuner | 08 22 0a 00 00 00 CC | Switch to the TV tuner. |
get_input | 08 22 f0 04 00 00 E2 | Query the current input. |
channel (args tuner, major, minor) | 08 22 04 [tuner] [major] [minor] [checksum] | Tune a channel; tuner = atv or dtv. |
channel_up / channel_down | 08 22 03 00 01/02 00 … | Tuner channel up / down. |
previous_channel | 08 22 0d 00 00 13 B6 | Jump to the last channel. |
get_channel | 08 22 f0 03 00 00 E3 | Query the current channel. |
0 … 9 | 08 22 0d 00 00 … … | Numeric keypad digits. |
guide | 08 22 0d 00 00 4F 7A | Open the program guide. |
Navigation
| Command | Sends | Action |
|---|---|---|
up down left right | 08 22 0D 00 00 60/61/65/62 … | Directional pad. |
enter | 08 22 0D 00 00 68 61 | Select. |
menu | 08 22 0D 00 00 1A AF | Open the menu. |
exit | 08 22 0D 00 00 2D 9C | Exit / close. |
info | 08 22 0D 00 00 1F AA | Show the info banner. |
back | 08 22 0D 00 00 58 71 | Back / return. |
Art Mode and advanced
| Command | Sends | Action |
|---|---|---|
art_mode_on / art_mode_off | 08 22 0B 0B 0E 01/00 … | Turn The Frame's Art Mode on / off. |
passthrough (arg command) | [command] | Send a raw hex frame verbatim (see above). |
Known limitations and quirks
- The TV is silent on serial when off. Power state is inferred, not read directly — keep TV IP set so the network read-back can confirm on/off reliably (see above).
- Service port runs at TTL levels. A true RS-232 gateway may need a level shifter, or the link won't work. If there's no serial response at all, suspect wiring/levels first.
mute_on/mute_offadd a short delay. They query mute state and wait ~500 ms before toggling; usemute_togglefor a direct, immediate mute flip.- Input isn't reported. Only power, volume, and mute are surfaced as live attributes; there's no current-input read-back.
- Single device, no zones. A Samsung TV is one GEM device; it creates no zones. Group rooms and multi-room behavior at the AV-zone / macro layer.
Troubleshooting
| Symptom | Check |
|---|---|
| Power state stuck on the last value | Set TV IP to the TV's own LAN IP (not the serial adapter). Without it, GEM can't read power/volume/mute back over the network. |
| No serial responses at all | Confirm the adapter's baud/framing matches the TV, and remember the service port is TTL — a level shifter may be needed for a true RS-232 gateway. Confirm Adapter IP and TCP Port point at the serial line, not the TV. |
mute_on / mute_off seem to flap | These query get_mute first, then blind-toggle after ~500 ms if no clear reply; a slow or noisy link makes them unreliable. Use mute_toggle, or raise command_throttle. |
| 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. |
| 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. |
| Volume/power readout never reflects the remote | Confirm TV IP is set and reachable; the live read-back is what catches changes made from the Samsung remote. |
See also
- Samsung TV (Tizen WebSocket) — networked consumer Samsung TVs over Wi-Fi/LAN.
- Samsung TV (Pro / HTTPS) — newer/Pro Tizen models (HTTPS token pairing).
- Samsung MDC — Samsung commercial/signage displays (MDC protocol).
- 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 — set the TV as a zone's Volume Device for volume and mute.
- Devices — adding and configuring devices.
- Commands — running and scripting device commands.
- Triggers — fire automations on the TV's power, volume, or mute state.