Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://Pastes.io
- wake_on_lan:
- switch:
- - platform: wake_on_lan
- mac: 'd8:14:df:98:fd:22' # TV
- turn_off:
- service: androidtv.adb_command # https://pastes.io/integrations/androidtv/
- target:
- entity_id: media_player.android_tv_192_168_1_64
- data:
- command: 'POWER'
- # option 1
- # default settings
- # - не работает: изменение громкости (как ползунком, так и плюс-минус), выбор источников (hdmi1, hdmi2), переключение каналов
- # - работает: включение и выключение, выбор источников (youtube), mute, пауза
- # option 2
- # media_player based
- # https://pastes.io/integrations/universal/
- # - не работает: включение* (wake_on_lan было отключено), выключение, mute (failed to find service), выбор громкости ползунком, убавление громкости, выбор источника (hdmi1)
- # - работает: пауза, прибавление громкости, выбор источника (youtube)
- media_player:
- - platform: universal
- name: 'TV test'
- children:
- - media_player.android_tv_192_168_1_64
- commands:
- turn_on:
- service: switch.turn_on
- data: {}
- target:
- entity_id: switch.wake_on_lan
- set_volume:
- service: media_player.set_volume
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_up:
- service: media_player.volume_up
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_down:
- service: media_player.volume_down
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_mute:
- service: media_player.mute_volume
- target:
- entity_id: media_player.android_tv_192_168_1_64
- select_source:
- service: media_player.select_source
- target:
- entity_id: media_player.android_tv_192_168_1_64
- media_pause:
- service: media_player.media_pause
- target:
- entity_id: media_player.android_tv_192_168_1_64
- device_class: tv
- unique_id: 'tv_test'
- # option 3
- # androidtv based
- # https://pastes.io/integrations/androidtv/
- # https://github.com/home-assistant/core/blob/dev/homeassistant/components/androidtv/media_player.py
- # - не работает: ничего (нет сервисов androidtv.*, оказывается)
- # - работает: выключение
- media_player:
- - platform: universal
- name: 'TV test'
- children:
- - media_player.android_tv_192_168_1_64
- commands:
- turn_on:
- service: switch.turn_on
- data: {}
- target:
- entity_id: switch.wake_on_lan
- set_volume:
- service: androidtv.set_volume_level
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_up:
- service: androidtv.volume_up
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_down:
- service: androidtv.volume_down
- target:
- entity_id: media_player.android_tv_192_168_1_64
- volume_mute:
- service: androidtv.mute_volume
- target:
- entity_id: media_player.android_tv_192_168_1_64
- select_source:
- service: androidtv.select_source
- target:
- entity_id: media_player.android_tv_192_168_1_64
- media_pause:
- service: androidtv.media_pause
- target:
- entity_id: media_player.android_tv_192_168_1_64
- device_class: tv
- unique_id: 'tv_test'
Add Comment
Please, Sign In to add comment