LG webOS Smart TV integration question

Hey All,

I enabled the LG webOS Smart TV integration.
I have the following automation to call down my daughter when she is in her room :slight_smile:
It starts fine, but once it has run it doesn’t turn on the TV anymore.
I then have to manually turn the TV on and off, after which the automation works again…once…
Can it be I’m forgetting something? Maybe there’s a session or connection still open that prevents it from firing again?

action:
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.tv_lynn_2
            state: 'on'
        sequence:
          - service: notify.tv_lynn
            data:
              message: Kom je naar Beneden?
    default:
      - service: webostv.command
        data:
          command: system/turnOn
          entity_id: media_player.tv_lynn_2
      - service: webostv.button
        data:
          entity_id: media_player.tv_lynn_2
          button: NETFLIX
      - service: notify.tv_lynn
        data:
          message: Kom je naar Beneden?
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
      - service: webostv.command
        data:
          entity_id: media_player.tv_lynn_2
          command: system/turnOff

You don’t use commands anymore, you use media player entity. Look at the docs it explains it there. You also need an extra automation for turning on, again it’s in the docs and several posts on here

Im pretty happy how my script turned out for changing to netflix. Maybe that could be some inspiration. Sets my lamp to decired scene. Then starts TV with WOL if its off and waits for TV to start before starting netflix.

alias: Netflix movie time
sequence:
  - service: scene.turn_on
    target:
      entity_id: scene.livingroom_netflix_time
    metadata: {}
  - if:
      - condition: device
        device_id: ee690fd127a1dc988c479c9ac56d85b8
        domain: media_player
        entity_id: 820ee57f999bf40bd428243fd38bdd96
        type: is_off
    then:
      - service: wake_on_lan.send_magic_packet
        data:
          mac: f8:b9:5a:b8:61:5e
          broadcast_address: 192.168.7.21
      - wait_for_trigger:
          - platform: device
            device_id: ee690fd127a1dc988c479c9ac56d85b8
            domain: media_player
            entity_id: 820ee57f999bf40bd428243fd38bdd96
            type: turned_on
  - service: webostv.button
    data:
      entity_id: media_player.lg_webos_tv_oled65cx6la
      button: NETFLIX
mode: single
icon: mdi:netflix