LGTV turned_on automation runs when switching apps

Recently, I updated my HA OS, and my LGTV automation has been behaving differently.

Prior to the update, my automation would start on YouTube TV when the TV was turned on, and everything worked great for a long while. After the update, when I switch to any app like Disney+, Netflix, or Plex, the app starts to load, but once it gets to a certain point, YouTube TV takes back control.

I noticed in HA that the automation I have set up to trigger when turned_on is firing when I switch to any app, which causes it to switch back to YouTube TV. Any idea if this is a new bug or some new behavior I need to account for in my configuration?

My automation is as follows:

alias: Start YouTube TV On Boot (Living Room)
description: ""
trigger:
  - platform: device
    device_id: 9904bce1d038d31bd05488eb44186f2a
    domain: media_player
    entity_id: e6133d1c35aa029f629edae8af7e41d8
    type: turned_on
condition: []
action:
  - service: webostv.command
    data:
      command: system.launcher/launch
      payload:
        id: youtube.leanback.ytv.v1
      entity_id: media_player.living_room_tv
mode: single

Try changing the trigger to:

trigger:
  - platform: state
    entity_id: e6133d1c35aa029f629edae8af7e41d8 # replace this with the entity id
    from: 'off'
    to: 'on'

FYI: Why and how to avoid device_ids in automations and scripts

Thank you, this did the trick. Thanks for the pointer on why to avoid device_ids as well!