SHOW:
|
|
- or go back to the newest paste.
1 | # https://Pastes.io | |
2 | wake_on_lan: | |
3 | ||
4 | switch: | |
5 | - platform: wake_on_lan | |
6 | mac: 'd8:14:df:98:fd:22' # TV | |
7 | turn_off: | |
8 | service: androidtv.adb_command # https://pastes.io/integrations/androidtv/ | |
9 | target: | |
10 | entity_id: media_player.android_tv_192_168_1_64 | |
11 | data: | |
12 | command: 'POWER' | |
13 | ||
14 | # option 1 | |
15 | # default settings | |
16 | # - не работает: изменение громкости (как ползунком, так и плюс-минус), выбор источников (hdmi1, hdmi2), переключение каналов | |
17 | # - работает: включение и выключение, выбор источников (youtube), mute, пауза | |
18 | ||
19 | # option 2 | |
20 | # media_player based | |
21 | # https://pastes.io/integrations/universal/ | |
22 | # - не работает: включение* (wake_on_lan было отключено), выключение, mute (failed to find service), выбор громкости ползунком, убавление громкости, выбор источника (hdmi1) | |
23 | # - работает: пауза, прибавление громкости, выбор источника (youtube) | |
24 | media_player: | |
25 | - platform: universal | |
26 | name: 'TV test' | |
27 | children: | |
28 | - media_player.android_tv_192_168_1_64 | |
29 | commands: | |
30 | turn_on: | |
31 | service: switch.turn_on | |
32 | data: {} | |
33 | target: | |
34 | entity_id: switch.wake_on_lan | |
35 | set_volume: | |
36 | service: media_player.set_volume | |
37 | target: | |
38 | entity_id: media_player.android_tv_192_168_1_64 | |
39 | volume_up: | |
40 | service: media_player.volume_up | |
41 | target: | |
42 | entity_id: media_player.android_tv_192_168_1_64 | |
43 | volume_down: | |
44 | service: media_player.volume_down | |
45 | target: | |
46 | entity_id: media_player.android_tv_192_168_1_64 | |
47 | volume_mute: | |
48 | service: media_player.mute_volume | |
49 | target: | |
50 | entity_id: media_player.android_tv_192_168_1_64 | |
51 | select_source: | |
52 | service: media_player.select_source | |
53 | target: | |
54 | entity_id: media_player.android_tv_192_168_1_64 | |
55 | media_pause: | |
56 | service: media_player.media_pause | |
57 | target: | |
58 | entity_id: media_player.android_tv_192_168_1_64 | |
59 | ||
60 | device_class: tv | |
61 | unique_id: 'tv_test' | |
62 | ||
63 | # option 3 | |
64 | # androidtv based | |
65 | # https://pastes.io/integrations/androidtv/ | |
66 | # https://github.com/home-assistant/core/blob/dev/homeassistant/components/androidtv/media_player.py | |
67 | # - не работает: ничего (нет сервисов androidtv.*, оказывается) | |
68 | # - работает: выключение | |
69 | media_player: | |
70 | - platform: universal | |
71 | name: 'TV test' | |
72 | children: | |
73 | - media_player.android_tv_192_168_1_64 | |
74 | commands: | |
75 | turn_on: | |
76 | service: switch.turn_on | |
77 | data: {} | |
78 | target: | |
79 | entity_id: switch.wake_on_lan | |
80 | set_volume: | |
81 | service: androidtv.set_volume_level | |
82 | target: | |
83 | entity_id: media_player.android_tv_192_168_1_64 | |
84 | volume_up: | |
85 | service: androidtv.volume_up | |
86 | target: | |
87 | entity_id: media_player.android_tv_192_168_1_64 | |
88 | volume_down: | |
89 | service: androidtv.volume_down | |
90 | target: | |
91 | entity_id: media_player.android_tv_192_168_1_64 | |
92 | volume_mute: | |
93 | service: androidtv.mute_volume | |
94 | target: | |
95 | entity_id: media_player.android_tv_192_168_1_64 | |
96 | select_source: | |
97 | service: androidtv.select_source | |
98 | target: | |
99 | entity_id: media_player.android_tv_192_168_1_64 | |
100 | media_pause: | |
101 | service: androidtv.media_pause | |
102 | target: | |
103 | entity_id: media_player.android_tv_192_168_1_64 | |
104 | device_class: tv | |
105 | unique_id: 'tv_test' | |
106 | ||
107 |