{"id":13865961,"url":"https://github.com/klattimer/LGWebOSRemote","last_synced_at":"2025-07-15T02:31:23.166Z","repository":{"id":41469372,"uuid":"91228157","full_name":"klattimer/LGWebOSRemote","owner":"klattimer","description":"Command line webOS remote for LGTVs","archived":false,"fork":false,"pushed_at":"2024-07-08T20:16:27.000Z","size":191,"stargazers_count":500,"open_issues_count":24,"forks_count":97,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-08-06T12:23:34.142Z","etag":null,"topics":["lg","python","python3","smart-tv","smarthome","webos","websockets"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klattimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"klattimer","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-05-14T07:50:14.000Z","updated_at":"2024-08-02T13:31:11.000Z","dependencies_parsed_at":"2024-01-05T20:50:26.046Z","dependency_job_id":"45b8b06d-96bf-4245-973d-455fe8cea089","html_url":"https://github.com/klattimer/LGWebOSRemote","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klattimer%2FLGWebOSRemote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klattimer%2FLGWebOSRemote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klattimer%2FLGWebOSRemote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klattimer%2FLGWebOSRemote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klattimer","download_url":"https://codeload.github.com/klattimer/LGWebOSRemote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226012173,"owners_count":17559629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lg","python","python3","smart-tv","smarthome","webos","websockets"],"created_at":"2024-08-05T12:00:42.164Z","updated_at":"2025-07-15T02:31:23.152Z","avatar_url":"https://github.com/klattimer.png","language":"Python","readme":"# LGWebOSRemote\nCommand line webOS remote for LGTVs. This tool uses a connection via websockets to port 3000 on newer LG TVs, there are other tools which use a restful connection to port 8080 however that port is closed on newer firmware versions.\n\n## A note from the developer\n\nMy LG TV is now so out of date that largely what is developed here is tested, improved and debugged by the community. As it goes my TV works fine and I'm not the kind of person to create more unnecessary electrical waste than I need to so as long as my current TV works, it's largely down to you guys.\n\nA big thanks for the contributions over the years too, lots of people have made lots of changes to this project over time, and it would only be as useful as it is with their help.\n\n\n## Supported models\n\n### Tested with\n\n  * 43LM6300PSB\n  * 24TL520S\n  * 43UN73003LC\n  * 43UJ630V-ZA\n  * 43UR78006LK\n  * 60UJ6300-UA\n  * HU80KG.AEU (CineBeam 4K)\n  * OLED48A2\n  * OLED55B7\n  * OLED55C9\n  * OLED55CX5LB\n  * OLED55CXAUA\n  * OLED55G29LA\n  * OLED65B9PUA\n  * OLED77CX9LA\n  * OLED77GX\n  * OLED48C1 (ssl)\n  * OLED42C2 (ssl)\n  * OLED48C2 (ssl)\n  * OLED83C4 (ssl)\n  * SK8500PLA\n  * SM9010PLA\n  * UF776V\n  * UF830V\n  * UH650V\n  * UU668V\n  * UJ6309\n  * UJ635V\n  * UJ6570\n  * UJ701V\n  * [please add more!]\n\nTested with python 3.9 on Debian Unstable.\nTested with python 3.10 on Windows 10/11\nTested with 3.10 on WSL (Ubuntu 20.04)\nTested with python 3.12 on macOS\n\n### Likely supports\n\nAll devices with firmware major version 4, product name \"webOSTV 2.0\"\n\n## Available Commands\n\tlgtv scan\n\tlgtv --ssl auth \u003chost\u003e MyTV\n\tlgtv setDefault MyTV\n\tlgtv --name MyTV --ssl audioStatus\n\tlgtv --name MyTV --ssl audioVolume\n\tlgtv --name MyTV --ssl closeAlert \u003calertId\u003e\n\tlgtv --name MyTV --ssl closeApp \u003cappid\u003e\n\tlgtv --name MyTV --ssl createAlert \u003cmessage\u003e \u003cbutton\u003e\n\tlgtv --name MyTV --ssl execute \u003ccommand\u003e\n\tlgtv --name MyTV --ssl getCursorSocket\n\tlgtv --name MyTV --ssl getForegroundAppInfo\n\tlgtv --name MyTV --ssl getPictureSettings\n\tlgtv --name MyTV --ssl getPowerState\n\tlgtv --name MyTV --ssl getSoundOutput\n\tlgtv --name MyTV --ssl getSystemInfo\n\tlgtv --name MyTV --ssl getTVChannel\n\tlgtv --name MyTV --ssl input3DOff\n\tlgtv --name MyTV --ssl input3DOn\n\tlgtv --name MyTV --ssl inputChannelDown\n\tlgtv --name MyTV --ssl inputChannelUp\n\tlgtv --name MyTV --ssl inputMediaFastForward\n\tlgtv --name MyTV --ssl inputMediaPause\n\tlgtv --name MyTV --ssl inputMediaPlay\n\tlgtv --name MyTV --ssl inputMediaRewind\n\tlgtv --name MyTV --ssl inputMediaStop\n\tlgtv --name MyTV --ssl listApps\n\tlgtv --name MyTV --ssl listLaunchPoints\n\tlgtv --name MyTV --ssl listChannels\n\tlgtv --name MyTV --ssl listInputs\n\tlgtv --name MyTV --ssl listServices\n\tlgtv --name MyTV --ssl mute \u003ctrue|false\u003e\n\tlgtv --name MyTV --ssl notification \u003cmessage\u003e\n\tlgtv --name MyTV --ssl notificationWithIcon \u003cmessage\u003e \u003curl\u003e\n\tlgtv --name MyTV --ssl off\n\tlgtv --name MyTV --ssl on\n\tlgtv --name MyTV --ssl openAppWithPayload \u003cpayload\u003e\n\tlgtv --name MyTV --ssl openBrowserAt \u003curl\u003e\n\tlgtv --name MyTV --ssl openYoutubeId \u003cvideoid\u003e\n\tlgtv --name MyTV --ssl openYoutubeURL \u003curl\u003e\n\tlgtv --name MyTV --ssl openYoutubeLegacyId \u003cvideoid\u003e\n\tlgtv --name MyTV --ssl openYoutubeLegacyURL \u003curl\u003e\n\tlgtv --name MyTV --ssl sendButton \u003cbutton\u003e\n\tlgtv --name MyTV --ssl serialise\n\tlgtv --name MyTV --ssl setDeviceInfo \u003cid\u003e \u003cicon\u003e \u003clabel\u003e\n            # Example: lgtv --name MyTV --ssl setDeviceInfo HDMI_2 hdmi.png \"My Input\".\n            # Purpose: force TV to disable so-called \"PC mode\" for inputs where the attached device incorrectly or undesiredly signals itself as \"PC\", eg. Raspberry Pi with LibreELEC.\n\tlgtv --name MyTV --ssl setInput \u003cinput_id\u003e\n\tlgtv --name MyTV --ssl setSoundOutput \u003ctv_speaker|external_optical|external_arc|external_speaker|lineout|headphone|tv_external_speaker|tv_speaker_headphone|bt_soundbar\u003e\n\tlgtv --name MyTV --ssl screenOff\n\tlgtv --name MyTV --ssl screenOn\n\tlgtv --name MyTV --ssl setTVChannel \u003cchannelId\u003e\n\tlgtv --name MyTV --ssl setVolume \u003clevel\u003e\n\tlgtv --name MyTV --ssl startApp \u003cappid\u003e\n\tlgtv --name MyTV --ssl swInfo\n\tlgtv --name MyTV --ssl volumeDown\n\tlgtv --name MyTV --ssl volumeUp\n\n## Install\n\nRequires wakeonlan, websocket for python (python3-websocket for python3), and getmac.\npython-pip (python3-pip for python3) and git are required for the installation process.\n\n    python -m venv lgtv-venv\n    source lgtv-venv/bin/activate\n    pip install git+https://github.com/klattimer/LGWebOSRemote\n\nTo install it system wide:\n\n\tsudo mkdir -p /opt\n\tsudo python -m venv /opt/lgtv-venv\n\tsource /opt/lgtv-venv/bin/activate\n\tsudo pip install git+https://github.com/klattimer/LGWebOSRemote\n\nor with [pipx](https://pipx.pypa.io/stable/):\n\n\tpipx install git+https://github.com/klattimer/LGWebOSRemote.git\n\n## Example usage\n    # Scan/Authenticate\n    $ lgtv scan\n    {\n        \"count\": 1,\n        \"list\": [\n            {\n                \"address\": \"192.168.1.31\",\n                \"model\": \"UF830V\",\n                \"uuid\": \"10f34f86-0664-f223-4b8f-d16a772d9baf\"\n            }\n        ],\n        \"result\": \"ok\"\n    }\n    $ lgtv --ssl auth 192.168.1.31 MyTV\n    # At this point the TV will request pairing, follow the instructions on screen\n\n    # Commands are basically\n    $ lgtv --name TVNAME --ssl COMMAND COMMAND_ARGS\n\n    $ lgtv --name MyTV --ssl on\n    $ lgtv --name MyTV --ssl off\n\n    # If you have the youtube plugin\n    $ lgtv --name MyTV --ssl openYoutubeURL https://www.youtube.com/watch?v=dQw4w9WgXcQ\n\n    # Otherwise, this works reasonably well\n    $ lgtv --name MyTV --ssl openBrowserAt https://www.youtube.com/tv#/watch?v=dQw4w9WgXcQ\n\n    # You can set the default TV so the `--name` argument can be skipped\n    $ lgtv setDefault MyTV\n\n## SSL\n\nStarting 25th of January 2023 LG has deprecated insecure ws connections, ssl is now required. Because of this, should you wish to use it on newer firmware devices you can append the argument \"ssl\" at the back. It connects to 3001 with wss. \n\n### Example\n```\n$ lgtv auth 192.168.1.31 MyTV\n$ lgtv --name MyTV --ssl off\n$ lgtv --name MyTV --ssl screenOff\n```\n\nsendButton args:\n['asterisk', 'back', 'blue', 'channel_down', 'channel_up', 'click', 'down', 'enter', 'exit', 'fast_forward', 'green', 'home', 'left', 'pause', 'play', 'red', 'rewind', 'right', 'stop', 'up', 'volume_down', 'volume_up', 'yellow']\n\n\n## Caveats\n\nYou need to auth with the TV before being able to use the on command as it requires the mac address.\n\n## TODO\n\nImplement the following features:\n\n\tcloseToast\n\tgetSystemSettings\n\n## Bugs\n\nI couldn't test youtube because it seems the app isn't installed and not available to download right now\nmaybe they're updating it?\n","funding_links":["https://patreon.com/klattimer"],"categories":["Platforms","Python"],"sub_categories":["LG webOS"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklattimer%2FLGWebOSRemote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklattimer%2FLGWebOSRemote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklattimer%2FLGWebOSRemote/lists"}