Skip to content
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

音箱播放状态不更新 #887

Closed
chikehe opened this issue Nov 18, 2022 · 6 comments
Closed

音箱播放状态不更新 #887

chikehe opened this issue Nov 18, 2022 · 6 comments

Comments

@chikehe
Copy link

chikehe commented Nov 18, 2022

小爱音箱pro,通过非HA操作音箱播放或停止,playing-state没有变化;用HA控制时能够正常获得状态。尝试手动更新get_properties返回 code: -704030013

@al-one
Copy link
Owner

al-one commented Nov 23, 2022

请提供不同状态下的实体属性

@chikehe
Copy link
Author

chikehe commented Nov 23, 2022

播放状态:

volume_level: 0.18
is_volume_muted: false
media_content_id: '1800921121226227747'
media_content_type: MUSIC
media_duration: 159
media_position: 97
media_title: 绝句
media_artist: 李昕融
media_album_name: 跟着昕融唱诗词 (全三册)
repeat: all
model: xiaomi.wifispeaker.lx06
lan_ip: 192.168.1.4
mac_address: 8C:DE:F9:97:D4:35
entity_class: MiotMediaPlayerEntity
home_room: shelkunchik的家 new
miot_type: urn:miot-spec-v2:device:speaker:0000A015:xiaomi-lx06:2
attribution: Support TTS through service
intelligent_speaker.sleep_mode: false
intelligent_speaker.audio_id: '1800921121226227747'
microphone.mute: false
speaker.volume: 18
speaker.mute: false
state_updater: cloud
xiaoai_id: 76295aed-ba88-4d28-99c4-f61557290fbc
sub_entities:
  - conversation
device_class: speaker
entity_picture: >-
  /api/media_player_proxy/media_player.xiaomi_lx06_d435_play_control?token=8c87fbed714064861fdd21d996b2434a9bca81dd7dd5cbb87580bfa81a3d328d&cache=3003ae9aa96f54de
friendly_name: 客厅音箱 Play Control
supported_features: 17469

播放暂停状态:

volume_level: 0.18
is_volume_muted: true
media_content_id: '1800921121226227747'
media_content_type: MUSIC
media_duration: 159
media_position: 126
media_title: 绝句
media_artist: 李昕融
media_album_name: 跟着昕融唱诗词 (全三册)
repeat: all
model: xiaomi.wifispeaker.lx06
lan_ip: 192.168.1.4
mac_address: 8C:DE:F9:97:D4:35
entity_class: MiotMediaPlayerEntity
home_room: shelkunchik的家 new
miot_type: urn:miot-spec-v2:device:speaker:0000A015:xiaomi-lx06:2
attribution: Support TTS through service
intelligent_speaker.sleep_mode: false
intelligent_speaker.audio_id: '1800921121226227747'
microphone.mute: false
speaker.volume: 18
speaker.mute: true
state_updater: cloud
xiaoai_id: 76295aed-ba88-4d28-99c4-f61557290fbc
sub_entities:
  - conversation
device_class: speaker
entity_picture: >-
  /api/media_player_proxy/media_player.xiaomi_lx06_d435_play_control?token=8c87fbed714064861fdd21d996b2434a9bca81dd7dd5cbb87580bfa81a3d328d&cache=3003ae9aa96f54de
friendly_name: 客厅音箱 Play Control
supported_features: 17469

两个状态下HA返回的state都是idle

@al-one
Copy link
Owner

al-one commented Nov 23, 2022

xiaomi miot xiaoai spec

由于该设备的playing-state属性没有读取权限,导致没有获取到播放状态。
建议尝试添加下面的自定义选项

# configuration.yaml
xiaomi_miot:
  device_customizes:
    xiaomi.wifispeaker.lx06:
      miot_type: urn:miot-spec-v2:device:speaker:0000A015:xiaomi-lx06:1

@chikehe
Copy link
Author

chikehe commented Nov 23, 2022

仍然无法获取播放状态
image

@al-one
Copy link
Owner

al-one commented Nov 23, 2022

可以看到playing_state属性返回报错-704030013 Property is not readable,看来该设备在小米云端的miot规格已经切换为urn:miot-spec-v2:device:speaker:0000A015:xiaomi-lx06:2,该版本的规格中playing_state属性不可读取。
我将在后续版本通过小爱的接口获取播放状态来修复此问题。

@al-one
Copy link
Owner

al-one commented Dec 13, 2022

请更新至master分支后尝试。

@al-one al-one closed this as completed Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants