To configure channels on LG webOS TV, I use input_number and if - then conditions. Below is my working example of automation that switches channels. We have our own voice assistant Yandex Alice and I can switch channels with my voice. I call the channel number, and according to the conditions, the desired channel is put on TV.
alias: 'We switch TV channels through the voice assistant Alice'
description: ''
trigger:
- platform: state
entity_id: input_number.tv_channels
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.tv_bedroom
data:
media_content_type: channel
media_content_id: >
{% if is_state('input_number.tv_channels', '1.0') %} S 02
{% elif is_state('input_number.tv_channels', '2.0') %} S 03
{% elif is_state('input_number.tv_channels', '3.0') %} S 04
{% elif is_state('input_number.tv_channels', '4.0') %} S 05
{% elif is_state('input_number.tv_channels', '5.0') %} S 06
{% elif is_state('input_number.tv_channels', '6.0') %} S 07
{% elif is_state('input_number.tv_channels', '7.0') %} S 08
{% elif is_state('input_number.tv_channels', '8.0') %} S 09
{% elif is_state('input_number.tv_channels', '9.0') %} S 10
{% elif is_state('input_number.tv_channels', '10.0') %} C 06
{% elif is_state('input_number.tv_channels', '11.0') %} C 07
{% elif is_state('input_number.tv_channels', '12.0') %} C 08
{% elif is_state('input_number.tv_channels', '13.0') %} C 09
{% elif is_state('input_number.tv_channels', '14.0') %} C 10
{% elif is_state('input_number.tv_channels', '15.0') %} C 11
{% elif is_state('input_number.tv_channels', '16.0') %} C 12
{% elif is_state('input_number.tv_channels', '17.0') %} S 11
{% elif is_state('input_number.tv_channels', '18.0') %} S 12
{% elif is_state('input_number.tv_channels', '19.0') %} S 13
{% elif is_state('input_number.tv_channels', '20.0') %} S 14
{% elif is_state('input_number.tv_channels', '21.0') %} S 16
{% elif is_state('input_number.tv_channels', '22.0') %} S 17
{% elif is_state('input_number.tv_channels', '23.0') %} S 18
{% elif is_state('input_number.tv_channels', '24.0') %} S 19
{% elif is_state('input_number.tv_channels', '25.0') %} S 20
{% endif %}
mode: single
Текст на русском (Text in Russian)
Для настройки каналов на ТВ LG Web OS я использую input_number и условия если - то. Ниже мой рабочий пример автоматики который переключает каналы. У нас есть свой голосовой помощник яндекс алиса и я могу переключать каналы голосом. Называю номер канала, а согласно условиям выставляется на ТВ нужный канал.
alias: 'Переключаем ТВ каналы через голосовой помощник Алиса'
description: ''
trigger:
- platform: state
entity_id: input_number.tv_channels
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.tv_bedroom
data:
media_content_type: channel
media_content_id: >
{% if is_state('input_number.tv_channels', '1.0') %} S 02
{% elif is_state('input_number.tv_channels', '2.0') %} S 03
{% elif is_state('input_number.tv_channels', '3.0') %} S 04
{% elif is_state('input_number.tv_channels', '4.0') %} S 05
{% elif is_state('input_number.tv_channels', '5.0') %} S 06
{% elif is_state('input_number.tv_channels', '6.0') %} S 07
{% elif is_state('input_number.tv_channels', '7.0') %} S 08
{% elif is_state('input_number.tv_channels', '8.0') %} S 09
{% elif is_state('input_number.tv_channels', '9.0') %} S 10
{% elif is_state('input_number.tv_channels', '10.0') %} C 06
{% elif is_state('input_number.tv_channels', '11.0') %} C 07
{% elif is_state('input_number.tv_channels', '12.0') %} C 08
{% elif is_state('input_number.tv_channels', '13.0') %} C 09
{% elif is_state('input_number.tv_channels', '14.0') %} C 10
{% elif is_state('input_number.tv_channels', '15.0') %} C 11
{% elif is_state('input_number.tv_channels', '16.0') %} C 12
{% elif is_state('input_number.tv_channels', '17.0') %} S 11
{% elif is_state('input_number.tv_channels', '18.0') %} S 12
{% elif is_state('input_number.tv_channels', '19.0') %} S 13
{% elif is_state('input_number.tv_channels', '20.0') %} S 14
{% elif is_state('input_number.tv_channels', '21.0') %} S 16
{% elif is_state('input_number.tv_channels', '22.0') %} S 17
{% elif is_state('input_number.tv_channels', '23.0') %} S 18
{% elif is_state('input_number.tv_channels', '24.0') %} S 19
{% elif is_state('input_number.tv_channels', '25.0') %} S 20
{% endif %}
mode: single