-
-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hass-xiaomi-miot ❤️ mini-media-player #250
Labels
Comments
再分享一个模仿群友 @muxiachuixue 制作的小米/Redmi电视卡片。
type: vertical-stack
cards:
# 显示小米电视屏幕截图
- type: custom:button-card
entity: media_player.xiaomi_tv_xxxx # 换成你的小米电视实体ID
size: 100%
show_name: false
show_icon: false
show_entity_picture: true
styles:
grid:
- margin: '-4% 0'
state:
- id: no_screen
operator: template
value: |
[[[
let off = entity.state == 'off'
return off || !entity.attributes['6095_state']
]]]
entity_picture: | # 电视关闭时显示其他图片
https://source.unsplash.com/random/1600x900
# 播放器及遥控按钮等
- type: custom:mini-media-player
entity: media_player.xiaomi_tv_xxxx # 换成你的小米电视实体ID
hide:
icon: true
tts:
platform: service
data:
message_field: text
service: xiaomi_miot.intelligent_speaker
service_data:
execute: true # 小米电视只支持语音命令 且不可静默执行
shortcuts:
columns: 4 # 四列按钮
buttons:
- type: service
icon: mdi:home
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: home
- type: service
icon: mdi:arrow-up
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: up
- type: service
icon: mdi:menu
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: menu
- type: service
icon: mdi:home-assistant
id: xiaomi_miot.intelligent_speaker
data:
entity_id: media_player.xiaomi_tv_xxxx
text: 打开米家
execute: true
- type: service
icon: mdi:arrow-left
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: left
- type: service
icon: mdi:play-circle
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: enter
- type: service
icon: mdi:arrow-right
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: right
- type: service
icon: mdi:television-play
id: xiaomi_miot.intelligent_speaker
data:
entity_id: media_player.xiaoai_entity_id # 使用小爱打开电视
text: 打开客厅小米电视
execute: true
- type: service
icon: mdi:cog
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_app_current
option: 电视设置 - com.xiaomi.mitv.settings
- type: service
icon: mdi:arrow-down
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: down
- type: service
icon: mdi:backspace
id: select.select_option
data:
entity_id: select.xiaomi_tv_xxxx_keycodes
option: back
- type: service
icon: mdi:television-off
id: xiaomi_miot.intelligent_speaker
data:
entity_id: media_player.xiaomi_tv_xxxx
text: 关闭屏幕
execute: true
- type: custom:mini-media-player
entity: media_player.xiaomi_tv_xxxx # 小米电视实体ID
hide:
icon: true
tts:
platform: service
data:
message_field: text
service: xiaomi_miot.intelligent_speaker
service_data:
entity_id: media_player.xiaoai_entity_id # 小爱音箱实体ID
execute: true # 执行语音命令
silent: true # 静默执行
- type: custom:button-card
entity: media_player.tv_entity_id
size: 100%
show_name: false
show_icon: false
show_entity_picture: true
styles:
grid:
- margin: '-4% 0'
state:
- id: state_off
value: off
entity_picture: | # 电视关闭时显示其他图片
https://source.unsplash.com/random/1600x900 |
Open
完美. |
完美 |
感谢大佬 |
select.xiaomi_tv_xxxx_app_current 请问这要替换? |
ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'let off = entity.state == 'off' return off || !entity.attributes['6095_state']' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mini-media-player
是一个优秀的播放器卡片,可以用于本插件接入HA的小爱音箱和小米电视。该卡片在 #569 中新增支持了使用任意服务TTS,可结合本插件TTS到小米音箱或执行语音命令(v1.15.0
及以上版本可用)。具体卡片配置如下:效果如下:

The text was updated successfully, but these errors were encountered: