This component is based on the TTS service of Microsoft Edge browser, no need to apply for app_key.
Download and copy
custom_components/edge_ttsfolder tocustom_componentsfolder in your HomeAssistant config folder
# Auto install via terminal shell wget -O - https://hacs.vip/get | DOMAIN=edge_tts REPO_PATH=hasscc/hass-edge-tts ARCHIVE_TAG=main bash -[UI: config - integrations - add integration - Microsoft Edge TTS ]
add integration
config option
entity
call service

style/styledegree/role/contourare no longer supported (#8).
action: tts.speak target: entity_id: tts.edge_tts data: media_player_entity_id: media_player.your_player_entity_id message: Hello language: zh-CN-XiaoyiNeural # Language or voice (Optional)action: tts.speak target: entity_id: tts.edge_tts data: media_player_entity_id: media_player.your_player_entity_id message: ๅ่ก่ไธๅ่ก่็ฎ๏ผไธๅ่ก่ๅๅ่ก่็ฎ language: zh-CN cache: true options: voice: zh-CN-XiaoyiNeural rate: +0% volume: +10% preferred_format: mp3 # value is a file extension like wav, mp3, ogg, etccurl -X POST -H "Authorization: Bearer <ACCESS TOKEN>" \ -H "Content-Type: application/json" \ -d '{"engine_id": "tts.edge_tts", "message": "ๆฌข่ฟๅๅฎถ", "language": "zh-CN-XiaoyiNeural", "cache": true, "options": {"volume": "+10%"}}' \ http://homeassistant.local:8123/api/tts_get_urlcurl -o hello.mp3 'http://homeassistant.local:8123/api/tts_proxy/edge?rate=+20%&message=hello&token=<tts_token>'The
tts_tokencan be found in the tts entity attributes.