LG webOS TV: Launching an application

Hi,

I have a 2023 LG webOS TV and I’m trying to configure a button on my HA dashboard that will allow me to launch an application on the TV, specifically the integrated screen saver.

I can achieve the same thing using a python application called bscpylgtv, but I’d like to switch to the HA integration instead.

So looking at the integration’s documentation I should be able to run a generic command on the TV using the webostv.command service.

The endpoint should be com.webos.applicationManager/launch and the application “id” to launch the screen saver is com.webos.app.screensaver.

I have tried several ways to configure a button in my HA dashboard, but I’m always getting errors indicating a wrong syntax for the endpoint’s argument (i.e. the application name to launch).

This is my current (failed) attempt:

show_icon: true
type: button
entity: input_button.tv_screensaver_activate
tap_action:
  action: perform-action
  perform_action: webostv.command
  data:
    entity_id: media_player.lg_oled_tv
    command: com.webos.applicationManager/launch
    payload:
      payload: com.webos.app.screensaver
  target: {}
hold_action:
  action: none

The (upper level) payload argument expects a dictionary, but I have no clue about the “key” to the value most likely being the application identifier.
It’s obviously not “payload” and also “target” does not work.

Any help getting this to work would be appreciated.

Sebastian

@sebk-666 The following action works on my TV, when launched using Developer Tools > Actions. I think the crucial point is the id key, which I found in LG’s webOS developer docs.

action: webostv.command
data:
  entity_id: media_player.tv
  command: com.webos.applicationManager/launch
  payload:
    id: com.webos.app.screensaver
1 Like

Thanks, that works!

1 Like