Skip to main content

Philips TV smart home integration, free and open source

Philips TV integration for Gladys Assistant

Philips Android and Saphi TVs: power, volume, sources, apps, Ambilight and remote keys, locally.

Control your Philips TVs from Gladys, over your local network: turn them on and off, set the volume, switch sources, open an app, change the channel, set the Ambilight (style, fixed colour, on or off), press any key of the remote, from the dashboard or from a scene. And react to what happens on screen: "when Netflix opens on the TV, dim the lights".

Developed without the hardware: feedback welcome. This integration was built and tested against the real answers of Philips TVs kept by the open-source ha-philipsjs library (the one Home Assistant uses) and the community documentation of the JointSpace API, with a simulated TV, not against a real Philips TV. If something does not work as described, please say so on the Gladys forum or in the issues.

What you need​

  • Gladys Assistant 5.1.0 or later.
  • A Philips TV with the JointSpace API 6, on the same local network as Gladys, with a fixed IP address (a DHCP reservation in your router):
    • an Android TV or Google TV model (2016 and later): paired once with Gladys, with a code shown on the TV;
    • or a Saphi (Linux) model: no pairing.
  • To turn the TV on from Gladys: on the TV, Switch on with Wi-Fi (WoWLAN) or Switch on with Chromecast turned on (usually in Settings → Wireless and networks → Wired or Wi-Fi). Without it, many TVs turn their network off in standby.

Set up​

  1. Install the integration from the Gladys catalog.

  2. Turn the TV on. In Configuration, click Search for TVs: the TVs that answer on your network are put in the free slots (TV 1, TV 2, TV 3), with their address. Or type the Address of the TV yourself (for example 192.168.1.20). Optionally give it a Name, then save.

  3. An Android TV is then paired once:

    1. click Show a pairing code on the TV (choose the TV): a 4-digit code appears on screen;
    2. type it in Confirm the pairing code (same TV), and run it, quickly: the TV waits about 30 seconds.

    Gladys appears on the TV as Gladys Assistant. The pairing is kept by the integration: no code is needed again. A Saphi TV needs no pairing.

  4. Click Test the connection: the message under the button says, for each TV, whether it answers, its model, whether it is on and paired.

  5. Open the Discover tab: one device per TV. Click Add, pick a room, save. A TV appears there once it has answered at least once: turn it on if it does not show up. Search in this tab also looks for new TVs.

The options at the bottom of the page:

  • Wake-on-LAN (on by default): a TV whose network sleeps in standby does not answer at all. Gladys then asks its core to send a Wake-on-LAN packet to the MAC address the TV gave, which wakes it up. The integration declares it, as the install screen shows.
  • Refresh interval: how often the TVs are read (10 s by default). A TV in standby is only asked its power state and its Ambilight.
  • Language of the feature names: the names given to the features when you add a device, and the texts of the lists and of the scene events.

The device of each TV​

FeatureWhat it does
PowerOn or standby. Turning it on asks the TV, or sends a Wake-on-LAN packet when it does not answer at all.
VolumeThe volume, as a slider, within the bounds of the TV (0 to 60 on most models).
Volume downOne step down, like the remote.
Volume upOne step up.
MuteMutes or unmutes the sound.
SourceAndroid TVs: TV (the tuner) or HDMI 1 to HDMI 4, and to switch to another one. Other is an app; choosing it presses Home.
AppAndroid TVs: the app in front (the TV says which), and to open another one. Home screen or other presses Home.
ChannelThe number of the channel on screen, and to switch to another number.
Channel downPrevious channel.
Channel upNext channel.
Now playingWhat is on screen, as a text: 5 · France 5, Netflix, HDMI 2, HDMI source, or Off.
AmbilightAmbilight on or off.
Ambilight styleThe style, from the menus of the TV: Follow video (Standard, Vivid, Game…), Follow audio (Lumina, Retro…), Lounge light (Hot lava…), or Fixed colour.
Ambilight colourA fixed colour, with the Gladys colour picker.
Ambilight + HueThe Hue lamps that follow the Ambilight, on or off (TVs with Ambilight + Hue only).

The TV says what it can do: a Saphi TV has no Source nor App, a TV without Ambilight no Ambilight features. The lists (apps, Ambilight styles, channels) are read from the TV and kept by the integration: they are there even when the TV sleeps. A command that needs the screen (a source, an app, a channel) turns the TV on first and waits for it, up to 25 seconds.

Dashboard​

Four widgets, to place side by side; each one shows one TV (the first one of the configuration when none is chosen in its settings). The core allows four buttons per widget, hence four of them.

  • Philips remote: the state of the TV, what is on screen, the volume, and the buttons Turn on (or Turn off), Volume −, Volume + and Mute.
  • Philips Ambilight: the Ambilight and its style, a button to turn it on or off, and three styles chosen in the widget settings (a fixed colour among them); the current one is checked.
  • Philips keys: four keys of the remote, chosen in the widget settings: the arrows by default. Add a second one with OK, Back, Home, Sources, or Play / pause…
  • Philips shortcuts: up to four favorite sources or apps, typed by name in the settings (HDMI 2, Netflix…); TV and HDMI 1 to HDMI 3 when none is typed. One tap shows it, the TV turned on first. A name the TV does not know is reported under the buttons.

Scenes​

Trigger​

TV: app, channel or source changed: what is on screen changed, turning on included. Filters: the TV, what is now on screen (app or home screen, channel, HDMI source), its name exactly as the TV shows it (Netflix, YouTube), and who changed it (Gladys, or the TV and its remote, a console over HDMI-CEC…). Variables: the TV, the kind (app, channel, source), the name (of the app, the channel or the source), the channel number, and who changed it.

The TV tells which app is in front: going from one app to another fires the trigger. For an HDMI source, the TV does not say which one: the name is the one Gladys chose, HDMI source otherwise.

No "TV turned on" or "TV turned off" trigger: the Power feature already triggers scenes, like any device.

Actions​

  • Open an app on the TV: by its name as on the TV (Netflix, youtube: case, accents and spaces do not matter). Output: the app opened.
  • Choose a TV source: TV or HDMI 1 to HDMI 4. Output: the source chosen.
  • Set the Ambilight: a style (Follow video · Standard, Lounge light · Hot lava…), a fixed colour (typed as #FF8800, the last one when empty), or off. A style the TV does not have is refused. Output: the style applied.
  • Send a remote control key: Home, Back, arrows, OK, Sources, volume, channel, playback, colors, digits, Ambilight…, one to ten times. Output: the presses sent.

The first two need an Android TV, and turn the TV on first when needed. With several TVs, choose the TV in the action. The Power, Volume, Channel and Ambilight features are in the usual Control a device action.

Scene ideas​

  • Movie night: at 9 pm on Fridays, Open an app on the TV Netflix, Set the Ambilight to Follow video · Immersive, dim the living room lights.
  • Netflix opened: trigger TV: app, channel or source changed, now on screen App, name Netflix: close the shutters.
  • Goodnight: at 11 pm, Set the Ambilight to a fixed colour #FF6A00, then turn the Power of the TV off a few minutes later.
  • Leaving home: in the "everyone left" scene, turn the Power of the TVs off.

Troubleshooting​

  • "Not reached yet: turn the TV on once": the TV never answered. Check its address and turn it on.
  • "Not paired yet": an Android TV needs the pairing: Show a pairing code on the TV, then Confirm the pairing code.
  • "Pairing refused by the TV: pair it again": the pairing was removed on the TV (a reset, a new firmware). Pair it again the same way.
  • "Wrong code": type the 4 digits shown, again. "The code has expired": show a new one, and confirm it within 30 seconds.
  • "No Philips TV API at this address": another device answers there.
  • "TV from before 2016 (JointSpace 1)": these older models are not supported.
  • The TV does not turn on: turn on Switch on with Wi-Fi (WoWLAN) or Switch on with Chromecast on the TV, and keep Wake-on-LAN on; the packet does not cross routers or VLANs.
  • Search for TVs finds nothing: the TV must be on, on the same network; type its address instead.
  • An HDMI source does not switch: the HDMI addresses are those of the 2019+ models; on older Android TVs, use the Sources key.
  • The logs of the integration (Configuration tab) say what each TV answers; no pairing key is ever written there.

Limits​

  • Developed without the hardware: the behaviors come from ha-philipsjs, pylips and their real answers, not from a real TV.
  • Philips TVs with the JointSpace API 6: Android TV and Google TV models from 2016, Saphi models. The models before 2016 (JointSpace 1) are not supported.
  • Sources and apps: Android TVs only. The TV does not say which HDMI input is on screen.
  • Ambilight: the styles of the TV menus and a fixed colour; the per-pixel colours and the brightness of the Ambilight are not driven.
  • Channels: those of the TV channel lists, read once a day.
  • Everything stays on your local network: no cloud, no Philips account. The integration only talks to the TVs you configured, and asks the Gladys core for Wake-on-LAN packets and SSDP searches.
  • Not affiliated with Philips or TP Vision. Philips and Ambilight are trademarks of Koninklijke Philips N.V.

Configuration settings​

These are the settings Philips TV asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your Philips TVsectionNoPhilips Android TV or Google TV (2016 and later), or Saphi. Turn the TV on, run "Search for TVs" below or type its address, and save. An Android TV is then paired once, with the two pairing actions below. Up to three TVs.
AddressstringNoIP address of the TV. Give it a fixed address in your router.
NamestringNoName of the device in Gladys. Empty: Philips and the model.
Second TV (optional)sectionNoSame fields, for another Philips TV.
AddressstringNoIP address of the TV. Give it a fixed address in your router.
NamestringNoName of the device in Gladys. Empty: Philips and the model.
Third TV (optional)sectionNoSame fields, for another Philips TV.
AddressstringNoIP address of the TV. Give it a fixed address in your router.
NamestringNoName of the device in Gladys. Empty: Philips and the model.
OptionssectionNo
Wake-on-LANbooleanNoWakes a TV whose network sleeps when it is off (Gladys sends the packet).
Refresh intervalselectNoHow often the TVs are read.
Language of the feature namesselectNoNames given to the features when a device is added, and texts of the lists and scene events.

How to install Philips TV in Gladys​

  1. In Gladys, open Integrations: Philips TV appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-philips-tv:1.0.3), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-philips-tv.

Philips TV requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Philips TV is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂