我按照这个官网文档试过了,在homekit里确实是电视设备,但只有开关,没有音量等其他按键
请教一下是什么问题?
media_player:
- platform: universal
name: Xgimi Z6X
unique_id: Xgimi Z6X
device_class: tv
state_template: >
{% if is_state("sensor.xgimi_state", "on") %}
on
{% else %}
off
{% endif %}
commands:
turn_on:
service: button.press
data: {}
target:
entity_id: button.xgimi_power_on_button
turn_off:
service: button.press
data: {}
target:
entity_id: button.xgimi_power_off_button
volume_up:
service: mqtt.publish
data: { payload: vol+ ,topic: homeassistant/remote/XGIMI}
volume_down:
service: mqtt.publish
data: { payload: vol- ,topic: homeassistant/remote/XGIMI}
volume_mute:
service: mqtt.publish
data: { payload: mute ,topic: homeassistant/remote/XGIMI}
media_play:
service: mqtt.publish
data: { payload: pause&play ,topic: homeassistant/remote/XGIMI}
media_pause:
service: mqtt.publish
data: { payload: pause&play ,topic: homeassistant/remote/XGIMI}
|