- 积分
- 224
- 金钱
- 190
- 威望
- 0
- 贡献
- 0
- HASS币
- 10
中级会员
- 积分
- 224
- 金钱
- 190
- HASS币
- 10
|
本帖最后由 yg2366355538 于 2022-12-9 09:46 编辑
红色部分需要改成自己的服务器地址和小爱的entity_id
小爱ttsPOST
http://10.1.1.119:8123/api/services/xiaomi_miot/intelligent_speaker
{
"entity_id": "media_player.xiaomi_lx06_0de5_play_control",
"text": "需要关灯吗"
}
Request: http://10.1.1.119:8123/api/
Authorization: Bearer 你的令牌
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
唤醒小爱 有“叮”的声音 xiaomi_miot.xiaoai_wakeup 好像也能唤醒 但是没声音 无法判断
http://10.1.1.119:8123/api/services/xiaomi_miot/intelligent_speaker
POST
{
"entity_id": "media_player.xiaomi_lx06_0de5_play_control",
"text": "小爱同学",
"execute": true,
"silent": true
}
Request: http://10.1.1.119:8123/api/
Authorization: Bearer 你的令牌
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
小爱对话内容 调用这个获取小爱对话内容 一般是小爱回复后 才会更改
http://10.1.1.119:8123/api/states/sensor.xiaomi_lx06_0de5_conversation
GET
Request: http://10.1.1.119:8123/api/
Authorization: Bearer 你的令牌
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
返回内容:
{
"entity_id": "sensor.xiaomi_lx06_0de5_conversation",
"state": "关灯",
"attributes":
{
"entity_class": "XiaoaiConversationSensor",
"parent_entity_id": "media_player.xiaomi_lx06_0de5_play_control",
"content": "关灯",
"answers":
[
{
"type": "TTS",
"tts":
{
"text": "小事儿。"
}
}
],
"history":
[
"几点了",
"开灯"
],
"timestamp": "2022-12-09T08:37:18.849000+08:00",
"icon": "mdi:account-voice",
"friendly_name": "小爱 Play Control conversation",
"supported_features": 0
},
"last_changed": "2022-12-09T00:37:21.232815+00:00",
"last_updated": "2022-12-09T00:37:21.232815+00:00",
"context":
{
"id": "01GKT51DPG4772YTCBZAARCXG4",
"parent_id": null,
"user_id": null
}
}
|
|