mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Automation example to change a source on LG TV (#35628)
* Automation example to change a source on LG TV It's not completely clear from the docs what method to use to launch TV apps although they are listed in the sources after the integration is completed. This simple method works pretty well on my TV. * Update webostv.markdown Add source list example * Update source/_integrations/webostv.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update source/_integrations/webostv.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update source/_integrations/webostv.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * tiny tweaks * Update source/_integrations/webostv.markdown * Update source/_integrations/webostv.markdown * Update source/_integrations/webostv.markdown * Update source/_integrations/webostv.markdown --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
9bdd235152
commit
169f3c51bc
@ -67,6 +67,43 @@ Any other [actions](/docs/automation/action/) to power on the device can be conf
|
||||
|
||||
It is possible to select which sources will be available to the media player. When the TV is powered on press the **CONFIGURE** button in the {% term integration %} card and select the sources to enable. If you don't select any source the media player will offer all of the sources of the TV.
|
||||
|
||||
### Switching source with automation
|
||||
|
||||
Imagine you want your LG TV to automatically switch to a specific source when it turns on. Below is a simple automation example that launches `YouTube` after the TV is switched on.
|
||||
It leverages `select_source` action from the [Media player](/integrations/media_player/) integration to launch a specific app installed on your LG TV.
|
||||
|
||||
To find available sources for your TV
|
||||
|
||||
1. Go to {% my developer_states title="**Developer Tools** > **States**" %}.
|
||||
2. Find your TV's media_player entity.
|
||||
3. Look for the `source_list` attribute which contains all available sources.
|
||||
|
||||
{% tip %}
|
||||
Source list example: `source_list: ARD Mediathek, Apps, HDMI 1, Home Dashboard, JBL Bar 1300, Media Player, Netflix, Prime Video, Public Value, Spotify - Music and Podcasts, Timer, Web Browser, YouTube, ZDFmediathek`
|
||||
{% endtip %}
|
||||
|
||||
The automation can be created entirely through the Home Assistant UI. When setting it up, you'll only need to manually enter the source name (for example, "YouTube") in the action configuration. Below is the YAML code generated as a result:
|
||||
|
||||
```yml
|
||||
alias: Switch TV source to YouTube by Default
|
||||
description: 'Regardless if started from TV remote or via wake-on-lan, the TV will switch to YouTube right after it is on'
|
||||
triggers:
|
||||
- device_id: <TV DEVICE ID>
|
||||
domain: media_player
|
||||
entity_id: <TV MEDIA PLAYER ENTITY ID>
|
||||
type: turned_on
|
||||
trigger: device
|
||||
conditions: []
|
||||
actions:
|
||||
- action: media_player.select_source
|
||||
metadata: {}
|
||||
data:
|
||||
source: YouTube
|
||||
target:
|
||||
device_id: <TV DEVICE ID>
|
||||
mode: single
|
||||
```
|
||||
|
||||
## Change channel through play_media action
|
||||
|
||||
The `play_media` action can be used in a script to switch to the specified TV channel. It selects the best matching channel according to the `media_content_id` parameter:
|
||||
|
Loading…
x
Reference in New Issue
Block a user