1.在HACS安裝Microsoft Edge TTS
2.在configuration.yaml新增以下文字,並重新啟動HA
tts:
- platform: edge_tts
language: zh-CN # Default language or voice (Optional)
3.先到Media \ Text to Speech \ Edge TTS 測試訊息
4.設定Node-Red TTS
[{"id":"04e98de49f7c87e7","type":"tab","label":"流程3","disabled":false,"info":"","env":[]},{"id":"22d845f946fbba59","type":"function","z":"04e98de49f7c87e7","name":"fn_Microsoft Edge TTS","func":"var message = \"Node-Red 測試 Microsoft Edge TTS\";\n\nmsg.payload_tts = {\n \"message\": message, \n \"cache\": true,\n \"options\": {\n \"volume\": \"+50%\",\n \"voice\": \"zh-TW-HsiaoChenNeural\",\n \"pitch\": \"+0Hz\",\n \"rate\": \"+0%\"\n }\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":180,"wires":[["260674572bc6aae4"]]},{"id":"260674572bc6aae4","type":"api-call-service","z":"04e98de49f7c87e7","name":"Homepod mini(客廳)","server":"b1fe2238.8c1ab","version":5,"debugenabled":false,"domain":"tts","service":"edge_tts_say","areaId":[],"deviceId":[],"entityId":["media_player.ke_ting"],"data":"msg.payload_tts","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":180,"wires":[[]]},{"id":"4ebce692818a0e1a","type":"inject","z":"04e98de49f7c87e7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":180,"wires":[["22d845f946fbba59"]]},{"id":"b1fe2238.8c1ab","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
參考文章
留言
張貼留言