惟家論壇掛了只好重新寫一篇
依照你自己習慣將下列script放到你習慣的yaml裏面
個人習慣放packages裏面
以下為基本指令
script:
sonytv_hdmi1:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Hdmi1
sonytv_hdmi2:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Hdmi2
sonytv_hdmi3:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Hdmi3
sonytv_hdmi4:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Hdmi4
sonytv_confirm:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Confirm
sonytv_exit:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Exit
sonytv_right:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Right
sonytv_left:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Left
sonytv_up:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Up
sonytv_down:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Down
sonytv_num1:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num1
sonytv_num2:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num2
sonytv_num3:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num3
sonytv_num4:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num4
sonytv_num5:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num5
sonytv_num6:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num6
sonytv_num7:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num7
sonytv_num8:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num8
sonytv_num9:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num9
sonytv_num0:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Num0
sonytv_home:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Home
sonytv_input:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
command: Input
以下為針對app使用的部分
sonytv_youtube:
sequence:
- service: media_player.play_media
target:
entity_id: media_player.sony_bravia_tv
data:
media_content_id: "YouTube"
media_content_type: "app"
sonytv_netflix:
sequence:
- service: media_player.play_media
target:
entity_id: media_player.sony_bravia_tv
data:
media_content_id: "Netflix"
media_content_type: "app"
sonytv_disney:
sequence:
- service: media_player.play_media
target:
entity_id: media_player.sony_bravia_tv
data:
media_content_id: "Disney+"
media_content_type: "app"
sonytv_kodi:
sequence:
- service: media_player.play_media
target:
entity_id: media_player.sony_bravia_tv
data:
media_content_id: "Kodi"
media_content_type: "app"
以下為選台切換用
sonytv_50:
sequence:
- service: remote.send_command
data:
entity_id: remote.sony_bravia_tv
delay_secs: 0.5
command:
- Num5
- Num0
- Confirm
記得修改entity_id
以上希望能幫到需要的朋友