feiyangderizi 发表于 2023-10-25 10:18:41

通过小爱音箱播放指定文字内容,支持会话模式及朗读模式

本帖最后由 feiyangderizi 于 2023-10-25 10:22 编辑

添加call service节点,配置直接参考图片:

设备这栏如果选择了对应的小爱音箱,则变成对话模式,如果只是想让小爱同学朗读文本内容,该项目不选择即可。

示例代码:
[
    {
      "id": "80caac2a895bfdcc",
      "type": "tab",
      "label": "流程 2",
      "disabled": false,
      "info": "",
      "env": []
    },
    {
      "id": "b699d47257a96868",
      "type": "api-call-service",
      "z": "80caac2a895bfdcc",
      "name": "播放声音",
      "server": "305758f6bca1fcf2",
      "version": 5,
      "debugenabled": true,
      "domain": "text",
      "service": "set_value",
      "areaId": [],
      "deviceId": [
            "f486b4d9c1944707af20"
      ],
      "entityId": [
            "text.xiaomi_lx04_edea_play_text"
      ],
      "data": "{\"value\":\"今天天气如何?\"}",
      "dataType": "json",
      "mergeContext": "",
      "mustacheAltTags": false,
      "outputProperties": [],
      "queue": "none",
      "x": 720,
      "y": 220,
      "wires": [
            []
      ]
    },
    {
      "id": "12b4cc8e0f758eeb",
      "type": "inject",
      "z": "80caac2a895bfdcc",
      "name": "",
      "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
      ],
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "topic": "",
      "payload": "",
      "payloadType": "date",
      "x": 470,
      "y": 220,
      "wires": [
            [
                "b699d47257a96868"
            ]
      ]
    },
    {
      "id": "305758f6bca1fcf2",
      "type": "server",
      "name": "Home Assistant",
      "version": 5,
      "addon": false,
      "rejectUnauthorizedCerts": true,
      "ha_boolean": "y|yes|true|on|home|open",
      "connectionDelay": true,
      "cacheJson": true,
      "heartbeat": false,
      "heartbeatInterval": "30",
      "areaSelector": "friendlyName",
      "deviceSelector": "id",
      "entitySelector": "id",
      "statusSeparator": ": ",
      "statusYear": "hidden",
      "statusMonth": "short",
      "statusDay": "numeric",
      "statusHourCycle": "default",
      "statusTimeFormat": "h:m",
      "enableGlobalContextStore": false
    }
]


mm9233 发表于 2023-11-8 23:30:53

学习一下

mobility 发表于 2023-11-9 10:03:38

请问 该买什么型号的音箱和如何接入HA呀? 抱歉本人小白

feiyangderizi 发表于 2023-11-10 08:12:04

我用的是小爱触屏音箱,如何接入的话,论坛里教程多翻翻:D

timeryzh 发表于 2023-12-11 15:26:40

很管用,谢谢分享

sanwangxiang 发表于 2023-12-24 20:13:19

感谢分享
页: [1]
查看完整版本: 通过小爱音箱播放指定文字内容,支持会话模式及朗读模式