本帖最后由 ciasdmxhxjjpd@c 于 2022-6-23 07:24 编辑
RT,
1. sheild tv 一台,安装了iptv app。
2. scripts.yaml 脚本。
start_cctv13:
alias: CCTV News
icon: mdi:cctv
description: start cctv news by homekit
mode: queued
sequence:
- service: media_player.select_source
target:
entity_id: media_player.nvida_shiled_atv
data:
source: '!IPTV'
- service: media_player.select_source
target:
entity_id: media_player.nvida_shiled_atv
data:
source: IPTV
- service: androidtv.adb_command
data:
entity_id: media_player.nvida_shiled_atv
command: DOWN
- service: androidtv.adb_command
data:
entity_id: media_player.nvida_shiled_atv
command: DOWN
- service: androidtv.adb_command
data:
entity_id: media_player.nvida_shiled_atv
command: CENTER
max: 10
逻辑是先关闭iptv(如果是打开的),再 center 进入 app,按2次向下,再确定(根据自己节目的位置来调整顺序,如cctv1,是按2次向下,再按一次向右,依次类推)。
ha的日志。
问题:
能通过homekit控制选台,声音调整暂时实现比较难。
且不够智能。
探讨:
如果有款app,可以实现,比如:atv command + app 名 + iptv m3u链接,这样的话会更智能。
另,准备用 nodered 以流程的形式 把 script 里的脚本实现。用 nr 实现应该会更好一些。
|