Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New LG TV's have keycode in IP Control #2

Closed
rbcet opened this issue Sep 5, 2020 · 8 comments
Closed

New LG TV's have keycode in IP Control #2

rbcet opened this issue Sep 5, 2020 · 8 comments

Comments

@rbcet
Copy link

rbcet commented Sep 5, 2020

Telnet closes itself after connection, probably because the new keycode thing.

There is another project https://github.com/WesSouza/lgtv-ip-control,

can we implement this logic into this project?

@bentemple
Copy link
Owner

bentemple commented Nov 30, 2020

@rbcetin you willing to help me test some stuff? I don't have an LG tv, so hard for me to verify if something is working.

@rbcet
Copy link
Author

rbcet commented Dec 2, 2020

Yep I can help you

@sorryusernameisalreadytaken
Copy link

sorryusernameisalreadytaken commented Jul 8, 2021

@rbcetin you willing to help me test some stuff? I don't have an LG tv, so hard for me to verify if something is working.
I guess the time for the LG integration was a bit short. Unfortunately, I can not establish a telnet connection, but find the project ingenious.

I have specially fetched the new ShiledTV remote 2019 (the one with the Netflix button) and only then discovered this git here.
This allows me to define the menu button. One option of the Shield for this is to switch through the HDMI channels. I don't understand why nvidia can't have more IR codes trained. VOL+- works fine on my Onkyo even when the Shield is off.

Nice work @bentemple

I would be happy to contribute my knowledge here but am now not so the Android code professional :D
Is this the last change to this topic?
fe63899

If I hadn't found this git here, I probably would have tried this and then addressed my HomeAssistant (HTTP POST/GET) and run individual commands on the TV:
https://f-droid.org/en/packages/io.github.sds100.keymapper/

The connection between HomeAssistant and LG is working fine:
https://www.home-assistant.io/integrations/webostv/
https://www.youtube.com/watch?v=LFr7JrVYe-A

@bentemple
Copy link
Owner

Yeah, I haven't done any more. seems like it would almost be more universal to forward commands from the shield to homeassistant, and let home assistant control the TV? obviously my setup doesn't support the latest LG tvs and I haven't gotten around to fixing it, but home assistant is pretty universal, so if we just invoke home assistant commands from "tiles" on the nvidia shield UI that would probably be quite easy to get working and pretty useful...

@bentemple
Copy link
Owner

bentemple commented Jul 18, 2024

OK, so I was able to use the same integration with my home assistant setup. So I'll be creating a configuration / updating the code in the coming days or weeks to connect to home assistant.

I'm sure you've moved on from this, but if you're still interested, the update is coming :)

HA is far more universal, so I figure by supporting it, people can leverage this to control a lot more things much more easily.

Then you can just add an event driven automation and do whatever you want in HA.

Here's what my automation basically looks like:

 id: '1721312106762'
  alias: Nvidia Shield Input Source Controller
  description: ''
  trigger:
  - platform: event
    event_type: nvidia_shield_tv_request
    event_data: {}
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "playstation" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Playstation 4
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "shield" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Nvidia Shield
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "nintendo_switch" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Nintendo Switch
  mode: single

Note: I have renamed my HDMI inputs to Nintendo Switch. If you haven't done that, it'll probably just be HDMI-1 or something.

@sorryusernameisalreadytaken

OK, so I was able to use the same integration with my home assistant setup. So I'll be creating a configuration / updating the code in the coming days or weeks to connect to home assistant.

I'm sure you've moved on from this, but if you're still interested, the update is coming :)

HA is far more universal, so I figure by supporting it, people can leverage this to control a lot more things much more easily.

Then you can just add an event driven automation and do whatever you want in HA.

Here's what my automation basically looks like:

 id: '1721312106762'
  alias: Nvidia Shield Input Source Controller
  description: ''
  trigger:
  - platform: event
    event_type: nvidia_shield_tv_request
    event_data: {}
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "playstation" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Playstation 4
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "shield" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Nvidia Shield
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "nintendo_switch" }}'
      sequence:
      - service: media_player.select_source
        target:
          device_id: 82320ac14909b682c69011be87520f89
        data:
          source: Nintendo Switch
  mode: single

Note: I have renamed my HDMI inputs to Nintendo Switch. If you haven't done that, it'll probably just be HDMI-1 or something.

This is amazing!

That will perhaps let me create Netflix icons to open the LG-Netflix app from any android TV.

@bentemple
Copy link
Owner

Yay :) I'll get you more info, and an updated readme + the code changes and everything hopefully this weekend

It's super easy since ultimately just a curl request

@bentemple
Copy link
Owner

bentemple commented Jul 20, 2024

I have added support for home assistant. With the HA LG WebOS TV integration, you should now be able to set this up to control your TV. see HomeAssistantSetup.md for more details.

Feel free to reopen this issue or open a new issue if you run into any issues with the setup. Eventually I plan to add the ability to configure the app with an on-device file, so you don't have to setup Android Studio and your build environment just to install the basic apps and use them as they're setup now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants