zachowj / node-red-contrib-home-assistant-websocket

Node-RED integration with Home Assistant
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/
MIT License
495 stars 91 forks source link

TTS not always working using action node #1625

Closed canedje closed 6 days ago

canedje commented 1 week ago

Describe the bug

Since the latest update of HA (2024.10) and latest update of node-red-contrib-home-assistant-websocket (0.73.0) TTS is not always working using the action node. Mostly it is working after a restart of NodeRed and after a while (an hour or so) no TTS thrue the speaker anymore. No error is given you can see that nodes are activated, but no sound. image I do need to restart or Nodered or HA. I'm using nodered and Home assistant as a Docker under unraid

To Reproduce

A node is triggered expecting to say something thrue a Google Nest or Google home. Nothing happening

Expected behavior

To hear the TTS message

Screenshots

No response

Example Flow

[{"id":"af1aa839026fa9ca","type":"link in","z":"81a9181cc0d24f1c","g":"2489fad592149e93","name":"TTS nest zithoek","links":["030080eb5f03d0b7","04c4746ef4323b05","05cffab25469b024","0a91be99b03d64b0","0d1b38d259ecdf04","0e564d78f96eb855","177df68975c82d58","18912b2babe132ab","1b39fcc5f8b707df","1d6eb41ae80da25e","256466d7cab0f34e","29d2904cbd89a4f3","2b44da353566cb98","2c390d24f2e20b8e","2c3d05331e6ad3db","2ef8a60c7a292201","3147ee7bda0fb205","31de5979023c0758","336eeaf8dc708b99","34048879e1442f82","345c2ff57851f445","4254238925d57bd3","4694b0ae6e926a81","48bac8c89e15a615","4baf281003edbe2c","4c680f7ec5f9b840","4df25bfec213447d","4eaf9440d3a59c84","504e083e7fd82765","514ae5450918c8bf","525715faa434cf77","53e2bbe3149ba2fb","5a864d762fa715ce","5ea158f6eddf5bd6","61df68fe2dbe6c93","654f18371fcd6540","675a6debdbb4c186","6a13e781c76c16b4","6a28563faf067200","6ce2cf84d848c945","6e2cf8725ab32489","706642b535b1dbd1","7089618673123515","72902ac9e3daef43","74f26a7e052a5ec6","76eb019399dc8e0d","7ab7e0c2a816292d","7c5ff2912ade2796","844ab92b626efdf5","88850cda978b6e6b","890a72ca54b60e36","897f8d93cb8d6c85","8a462802b73adc69","8a57d1801b327043","95d9d806cc55173d","99b8e23abe120dfe","9a7726dc1f9e548a","a0087fe4d70e3e1f","a181748d5b87c026","a7720c4e9ca5cf11","a81f12b3a87fdcd1","aa5147d354335aee","adcee19603f11515","b314be64e739f44a","b5f10956bfcaa3f6","b8645bbdc9ea2314","b99fbd1542e97b8e","bbbdb77a85d1965e","bf0b549b10fd384e","bf511a22196584c9","c2a29f9565b61003","c3510eef1ee48a32","cf6d07b41856974a","d0505d0affbda686","d1c4d1ccf32e21d3","db102572e266b067","db1f05e986ba11e7","de08853dfe394679","e3645a0b497aaa61","e39a885f232176c3","e5bf22ae82776e47","e848512ecda91e88","e979b252591ba26a","eefbc07cc8e371ce","efdb909a6e12a887","f20b254f33c084c4","f2f6b98cf059ae59","f520be0afb8b29a5","f6a6f478a9b22230","fbda15da13473fcc","fc5606ab6a5772b1","fca93c62c127653e","fcb98829ec7c0575","fd990d7aa9a060d2","fdde523442206bb0"],"x":55,"y":718,"wires":[["876aa4f1750f38d9"]]},{"id":"876aa4f1750f38d9","type":"api-call-service","z":"81a9181cc0d24f1c","g":"2489fad592149e93","name":"Volume","server":"dbc269b7ec5d8849","version":7,"debugenabled":false,"action":"media_player.volume_set","floorId":[],"areaId":[],"deviceId":[],"entityId":["media_player.nest_zithoek"],"labelId":[],"data":"{\"volume_level\":\"{{volume}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"media_player","service":"volume_set","x":168,"y":720,"wires":[["2a1d2d98df57417c"]]},{"id":"2a1d2d98df57417c","type":"function","z":"81a9181cc0d24f1c","g":"2489fad592149e93","name":"makeMSG","func":"msg.payload ={\n    data: {\n        message: msg.contentTTS\n        \n    }\n};\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":326,"y":718,"wires":[["eab01df5aaef2735"]]},{"id":"eab01df5aaef2735","type":"delay","z":"81a9181cc0d24f1c","g":"2489fad592149e93","name":"1 per 2S","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":486,"y":718,"wires":[["edd486053dda84d3"]]},{"id":"edd486053dda84d3","type":"stoptimer","z":"81a9181cc0d24f1c","g":"2489fad592149e93","duration":"0.5","units":"Second","payloadtype":"num","payloadval":"0","name":"0.5S","x":626,"y":720,"wires":[["e6b38128af2e4162"],[]]},{"id":"e6b38128af2e4162","type":"api-call-service","z":"81a9181cc0d24f1c","g":"2489fad592149e93","name":"TTS","server":"dbc269b7ec5d8849","version":7,"debugenabled":false,"action":"tts.edge_say","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\"entity_id\":\"media_player.nest_zithoek\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"tts","service":"edge_say","x":766,"y":720,"wires":[[]]},{"id":"dbc269b7ec5d8849","type":"server","name":"Home Assistant 1","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Environment Information

Version: 0.73.0

Home Assistant version: 2024.10.0 Companion version: 4.1.1

Node-RED version: 4.0.3 Docker: yes Add-on: no

Node.js version: v20.17.0 x64 linux OS: Linux 6.1.103-Unraid x64

Additional context

Using TTS to a Unifi camera speaker is totally not working using the same principle and type of nodes as the google Nest and gooogle home mediaplayers image

zachowj commented 1 week ago

If you check the Home Assistant repo, there are several reports of TTS not working in various ways. Does your example work when run directly from the Home Assistant Developer Tools?

canedje commented 6 days ago

Thanks for the answer. I did test Unifi, they did not working straight from HA I didn’t test the Google speakers yet (EDIT: I just did, they are working straight from the HA tool) At the moment TTS is still working for 12hrs now (except the unifi)

I do think the biggest problem is the update of HA itself, because before that it worked fine. I do now run 2024.10.1 and it is running ok for 12 hrs, maybe thats the solution for normal TTS, but Unifi still not working. So it looks like more a HA problem then a NodeRed problem

In my bug window I do see after Deploy (not knowing what it means): image

zachowj commented 6 days ago

Version 2024.10.1 reverted an update to pychromecast that was causing issues with casting. You can check the details here: https://github.com/home-assistant/core/pull/127555.

Regarding the deprecation notice, it's indicating that you're using an input override feature that will be removed in the future. Specifically, you're sending either msg.payload.domain or msg.payload.service to a node named "TTS." The new approach is to send msg.payload.action instead.

canedje commented 6 days ago

thanks again. I'm not aware using an input overwrite named msg.payload.domain or service.

Edit: I did find the problem: image