Using the LG webOS source value to trigger events

Well, something if off; I get ‘source = NOS’ while I’m watching Netflix (funny enough the image shows the Netflix image)

@Tyfoon, I assume that everytime your tv is on it’ll show NOS as the source. If so it’s behaving as mine is doing.

On mine it was previously always showing HDMI3 till I repaired the HASS configuration and now it always shows “Notification”

Can’t this be related to this?

You legend @Tyfoon, this has resolved the issue and now the sources are listed correctly again.

This is great for me as there are significant differences in volume when I switch between input sources. I get HASS to set the LG TV’s volume depending on the input and avoid being blasted with sound between different inputs. The chromecast is the worst offender as it’s always comes on at 100% and i have to pair back the TV’s volume.

The format to use is as below:

media_player:
  - platform: webostv
    host: 192.168.0.10
    mac: C8:08:E9:99:99:1A
    name: Living Room TV
    filename: webostv.conf
    customize:
      sources:
        - livetv
        - youtube
        - makotv
        - netflix

You can see all the possible source names if you goto the WEBOS entity attributes within HASS. Just list the ones you need.

2 Likes

Hi all,

there’s a way to notice if Netfix (or plex or Prime Video) are really playing of we are just navigating through libraries.

My goal is to dim light when movies starts (like at the cinema) and not when I open the app.

Thank you in advance!

1 Like

No one has the same need as me?

I was thinking of implementing this when I noticed that it is always playing. Even in the menu’s.

Did you ever solved it.

Nope :frowning:

I think it is not possible

It is possible to execute custom functions or whatever you want, if you override the existing LG Netcast component. If your LG TV is pre 2012 (like 2011) you can follow my tutorial how to do it. There is a function that is called when you switch the source. In that function you can write your own code to be executed along with the original code. :slight_smile: I overrided the function that switches the source, to switch to channels and populated the sources dropdown with the fav channels. :slight_smile:

I just attempted to use this code and the sensor says the source is unknown. Did something change in LG TVs WebOS that would allow this to work 2 years later?

Which code is not working? Everything should works well. I have 2 WebOS TVs at home and they are working fine. And what is that sensor that says the source is unknown? You mean the selected input source, the dropdown on the more-info?

Let’s say I press pause on the TV with my remote, then go check on the HA Frontend it always states (Playing) no matter what I try

State will always be playing because the TV is on.

I was wondering the same, state does update correctly when TV is controlled from HA interface, but not when controlled from TV remote (then the state will just remain either idle or playing, depending on the last action triggered via HA interface). This way, the TV state is useless for triggering events (except when you exclusively use the HA interface to control the TV). Has anyone got this working properly?

All the information shown on the HA interface depends on the response of the TV of the ‘give me your state’ request sent to the TV. Not everything can be pulled out of the TV. This is why we can’t get all info needed to figure out if and what is happening on the TV. I haven’t read the documentation of WebOS 2 and 3 for full WEB API abilities, I just modified the existing platform to fit my needs of changing channels, not only inputs. But I think it might not be possible to show if it is paused. Because, I know that if you’re playing LiveTV, and press ‘pause’ on the remote, it starts playing the record from the ‘time machine’ on the hard drive, which is separate input, and it recognize it like playing media. This is why it shows state ‘playing’. I’ll read the API docs, and if it is possible, I’ll make it showing the correct state. :slight_smile:

1 Like

I’ve been digging into this as well, and haven’t come up with anything. Was anybody else successful in pulling pause state from the TV, or maybe even the current media timestamp?

Hi Guy’s

Just picking up with HASS again. I really would like to be able to dim lights when tv media is starting to play and brighten when paused (with remote).

For now it seems WebOS doesn’t “tell” hass media is paused (with remote). Is there anyone who can think of a workaround?

As i type this hits me as possible solution: (remote) hit mute HASS will pause media and brighten lights and unmute visa versa… (not the prettiest but, better then nothing)
I will try this myself tonight unless someone is faster and/or know this won’t work :slight_smile:

I found a workaround for the pause/play dim/brighten issue.
Basically, i’ve added mute/unmute to the automation. When i hit mute on the remote the sound mutes, player pauses en lights are brightened, unmute works the other way around.

Please note I didn’t yet found time to thoroughly test and it’s already isn’t flawless (delay) and still need to find a solution when first start movie… but maybe you guys find this helpful…

1 Like

Encountering the same issue, also have the idea of using mute as a workaround.
Can’t figure out the settings for the automation.
Do you have an example?