LG tv integration and automation

Hi.
Newcomer to HA here so…

Well, i´ve set up HA on a Raspberry Pi 3B connected over wifi to my router.
My LG TV (2020 Oled model, CX) is also connected to the same wifi.
On my first run of HA, the tv was detected by the system automatically and for pairing displayed a code number on the tv for completing the pairing. I´m not sure 100%, but i swear that it was displayed as as “Device” on the list.

Then, i must fresh install the HA (because some errors on the UI, empty tabs and other annoying things).
Case is, now my tv is not detected anymore automatically. Researching takes me to manually add WebOS integration, succesfully. But now, when pairing, my tv only displayed a message box to accept a “TV REMOTE” as a controller. And also, my tv it only shows as media player under the Entities tab, but nothing on the Devices tab.
I´ve searched a lot and it seems the only integration possible was the one ive made manually editing the config file on the second installation, so i can´t explain the autointegration on the first (maybe i´m wrong about this, but i´m 100 percent sure about the pairing code displayed on my tv, so something is different there).

I´m trying to add an automation to dim my hue lights when Netflix is playing something, but it seems the Entities does not have automation posibitliies, only Devices has it, but as ive said, can´t add my tv as a Device.

Hope my post is not so much confusing and someone points me on the right direction here.
Thanks in advance.

Of course you can automate without it being added as a device.

If you install the HomeKit Controller integration, and it’s enabled on your TV, it will pop up under auto configure (my experience with 2019 C9). You are in the right track, once you get the entity working, it should give you quite a few services, including exposing the source that is playing. The power on control is tricky, but I got it working with the Wake On LAN feature in HA. If you need more help, just ask.

Hi.
I don´t tried with homekit, but…
this what i´ve done for testing, just a simple thing (Turn on my hue light when i open Netflix on the tv)

alias: Netflix
description: ''
trigger:
  - platform: state
    entity_id: media_player.lg_oled_cx55
    attribute: source
    from: "Netflix"
condition: []
action:
  - type: turn_on
    device_id: b8635ece78d25adfa7308148d9dd7b34
    entity_id: light.hue_white_lamp_1
    domain: light
    brightness_pct: 80
    flash: long
mode: single

But it does nothing when i select Netflix app on my tv. I see on the dashboard card for my tv how the source is changed from LiveTv to Netflix, but nothing happens.
Checked the action assigned and it´s ok.
Tried also without the " on the Netflix name, but nothing there.

What i´m doing wrong ???

Well, i succedded on my test by adding “from: Live Tv” and “to: Netflix”. So now when i press the Netflix button on my remote it does the trick.
Now i want to modify that to only happens when i play something…
I guess it has to be an “state” but i tried with “media.play” or “play” and does nothing…

How can that be done ?

What does states page in dev tools say when netflix is playing?

I cant see it right now but ive checked that earlier and, from my memory, seems theres nothing related about player state.

I have done some more playing and investigating, including reading the source code.

  • The state is either on or off, there is no “playing” or “idle”
  • There seems to ne nothing to distinguish between playing or not
  • There may be a change in entity_picture on playing, but I haven’t really been able to figure that out.

Well, then it will be impossible to do what I want I’m afraid.
If you figure out any workaround please let me know.
And thanks so much for your help!

I haven’t tried the homekit integration yet.

It seems Homekit integration have the same options for my TV.
Maybe it’s not implemented on the webOS api available, but I don’t know how to check that.