Zum Hauptinhalt springen

Samsung Smart TV Smart-Home-Integration, kostenlos und Open Source

Samsung Smart TV-Integration für Gladys Assistant

Control your Samsung Smart TVs (Tizen) over the local network: power, volume, mute and input source.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Overview​

Control your Samsung televisions (Tizen, 2016 models onwards) from Gladys, entirely over the local network: no Samsung account, nothing going through the cloud.

What the integration exposes​

FeatureDetail
PowerTurns the TV off, and wakes it up with Wake-on-LAN
VolumeA 0 to 100 % slider, showing the level actually read back from the TV
Volume up / downOne volume step, like the remote
MuteSet or cleared, never toggled blindly
SourceTV, HDMI, and the installed apps when the TV reports them

Sources and applications​

TV and HDMI are always offered: they are remote-control keys, present on every model.

The list of installed applications is requested from the TV during the scan, but several recent models (2021 and later) ignore that request. When that happens only TV and HDMI show up — that is expected behaviour, not a failure. Run a new scan after installing an app: if your model answers, it will be added.

Prerequisites​

  • Gladys 4.86 or later.
  • A Samsung Smart TV running Tizen, 2016 model or later.
  • The TV connected to the same local network as Gladys: Gladys finds it with a network scan and turns it on with a Wake-on-LAN packet. No Samsung account is needed.
  • The TV remote, to accept the authorization prompt the first time Gladys sends a command.
  • To turn the TV on from Gladys: the wake-on-network option enabled on the TV (see "Turning the TV back on").

Configuration​

  1. Turn your television on, then open the Discovery tab and run a scan. It shows up under its own name ("Samsung AU7025 55 TV", for instance). Create it.

    A TV in standby shuts its network interface down: it answers nothing and no scan can find it. A scan that comes back empty is almost always a television that is off — switch it on and scan again.

  2. Run a first command, Volume up for example. The TV then displays an authorization prompt for "Gladys": accept it with the remote. This happens only once, the token is kept afterwards.

If the TV asks nothing and commands keep failing, check that Settings → General → External Device Manager → Device Connection Manager still allows new devices.

Turning the TV back on​

A TV that is off answers nothing on the network: the only way in is Wake-on-LAN, a packet Gladys emits towards its MAC address. This requires the wake-on-network option to be enabled on the TV, under Settings → General → Network → Expert settings → Power On with Mobile (the wording varies across models).

Over Wi-Fi this wake-up depends on the model and is not guaranteed by every television. If turning on does not work while the option is enabled, an Ethernet link makes it reliable. Turning off always works.

To find out where you stand, turn the TV off, then run ping <TV IP address> from any machine on the network:

  • the TV still answers: its network interface stays alive in standby, and Wake-on-LAN has every chance of working;
  • the TV answers nothing at all: it shut its network interface down, no packet can reach it any more and the wake-up will fail. That is the symptom of a disabled wake-on-network option — enable it, then run the test again.

Refresh​

The integration reads the power state, the volume and the mute state back from every TV at the Refresh interval chosen in the integration settings (every 30 seconds by default, every 10 seconds at the quickest). A change made with the remote, or a TV woken up by Wake-on-LAN, shows up in Gladys within that interval.

How it works​

Three channels, each for what it does best:

  • the TV REST API (port 8001) reports the power state, read on every refresh;
  • UPnP RenderingControl (port 9197) reads and writes the volume level and the mute state, with no token involved;
  • the remote-control WebSocket (port 8002) carries key presses, the only part needing the authorization.

The pairing token is kept in the integration's /data volume: it survives restarts and container updates.

Troubleshooting​

The integration logs are available in Gladys, from the Configuration tab of the integration, alongside the supervision controls (start, stop, restart…).

The scan finds no TV: the TV is almost always in standby (see "Configuration"). Turn it on, wait a few seconds, then scan again. The integration logs then read No Samsung TV found. A television in standby is invisible on the network: turn it on, then run the scan again. If the TV is on, check that it is on the same local network as Gladys.

"Test the connection" answers "No answer from …: the TV is off or unreachable.": the TV is off, or no longer answers at the address it had when you created it. Turn it on and test again; if it still does not answer, see the next point.

The TV changed IP address: a TV whose address was reassigned by your router stops answering at the old one. If another Samsung TV took that address, the logs read A different device (…) now answers at …, not …: rescan to pick up the new address of this TV. Turn the TV on and run a new scan from the Discovery tab: the TV you created picks up its new address. Reserving its IP address in your router avoids the problem.

A command fails with Authorization was not granted on the TV at … within 30 s: the authorization prompt was not accepted in time. Send the command again and accept the prompt with the remote.

A command fails with The TV at … refused the connection (authorization denied): the prompt was refused on the TV. Check the Device Connection Manager settings described in "Configuration", then send a command again.

A command fails with The TV at … did not answer or Connection to … failed: …: the TV is off, or Gladys cannot reach its remote-control channel (port 8002, see "How it works").

The TV does not turn on: check the wake-on-network option and run the ping test described in "Turning the TV back on". If the command fails with This TV reported no MAC address: Wake-on-LAN is impossible, turn the TV on with the remote and run a new scan: its MAC address is read again.

Volume and mute are not updated while the TV is on: the logs read Could not read the volume of …: …. The TV did not answer on its UPnP channel (port 9197, see "How it works"); check that nothing between Gladys and the TV filters that port.

Only TV and HDMI in the sources: expected on several recent models, see "Sources and applications".

The connection status reads "Initialization failed, check the integration logs.": the integration could not finish starting up after connecting to Gladys. The logs give the reason (Post-connection initialization failed). Restart the integration from its Configuration tab.

Konfigurationseinstellungen​

Diese Einstellungen fragt Samsung Smart TV in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Finding your TVsectionNeinTurn the television ON before running a scan from the Discovery tab. A TV in standby cuts its network interface off: it answers nothing, and no scan can find it. If the scan comes back empty, switch the TV on, wait a few seconds, and scan again.
Before you startsectionNeinTwo settings on the TV itself matter. The first time Gladys sends a command, the TV asks you to authorize it: accept on screen, this happens only once. To turn the TV back ON, Gladys sends a Wake-on-LAN packet, which requires the wake-on-network option to be enabled on the TV (Settings > General > Network > Expert settings).
Refresh intervalselectNeinHow often the power state, volume and mute are read back from the TV.

So installierst du Samsung Smart TV in Gladys​

  1. Öffne in Gladys Integrationen: Samsung Smart TV erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/cicoub13/gladys-samsung-tv:1.1.2) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/cicoub13/gladys-samsung-tv.

Samsung Smart TV benötigt Gladys >=4.86.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Samsung Smart TV ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von cicoub13 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂