Msg.payload unusable now for to create action node data field in nodered with latest edge tts v 0.7.2

sincce the update to the new HACS integration Microsoft Edge TTS v0.7.2.
I can not use a msg.payload to send tts text to an action node with edge tts

I did create in the version before a node in nodered:

Image

with makeMSG:

 msg.payload ={
    data: {
        message:'Nood Red is opnieuw opgestart'
    },
   };
return msg;

and do send this to an action node to speak.
and in the action node data field:

{
    "entity_id": [
        "media_player.google_home_overloop",
        "media_player.nest_zithoek"
    ]
}

I know I do need to change the entity_id now in media_player_entity_id
This is not possible anymore in the latest new version v0.7.2
Giving error:

name: "HomeAssistantError" message: "required key not provided @ data['message']" stack: string HomeAssistantError: required key not provided @ data['message'] at getErrorData (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:54:13) at inputErrorHandler (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:74:38) at ActionController._InputOutputController_preOnInput (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/common/controllers/InputOutputController.js:69:51)
Any ideas? Or is it just a bug?

I did return to v0.1.0

In the action node, do you have Block Input Overrides enabled?

I think it is more than that. That looks like the legacy (old) say action, the component was recently switched to the new speak action.

old

action: tts.google_translate_say
data:
  entity_id: media_player.kitchen
  message: "May the force be with you.

new

action: tts.speak
target:
  entity_id: tts.example
data:
  media_player_entity_id: media_player.kitchen
  message: "May the force be with you."

So to send in the new format would be something like.

{
    "action": "tts.speak",
    "target": {
        "entity_id": "tts.edge_tts"
    },
    "data": {
        "media_player_entity_id": [ "media_player.kitchen", "media_player.kitchen" ],
        "message": "May the force be with you."
    }
}

No.

My code:

[{"id":"560edfb0d17e914b","type":"api-call-service","z":"flow-edge-tts","name":"TTS Edge Speak","server":"dbc269b7ec5d8849","version":7,"debugenabled":false,"action":"tts.speak","floorId":[],"areaId":[],"deviceId":[],"entityId":["tts.edge_tts"],"labelId":[],"data":" \"media_player_entity_id\": [ \"media_player.google_home_overloop\", \"media_player.nest_zithoek\" ]}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"blockInputOverrides":false,"domain":"tts","service":"speak","x":690,"y":252,"wires":[[]]},{"id":"ac8b7f8f1fbf0e3a","type":"function","z":"flow-edge-tts","name":"makeMSG","func":"msg.payload ={\n data: {\n message: \"Dit is een test\"\n }\n};\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":506,"y":252,"wires":[["560edfb0d17e914b"]]},{"id":"21d1a4bbed30e2b3","type":"api-call-service","z":"flow-edge-tts","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":348,"y":252,"wires":[["560edfb0d17e914b"]]},{"id":"30d5d269fef5ea9b","type":"inject","z":"flow-edge-tts","name":"","props":[{"p":"volume","v":"0.4","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":202,"y":252,"wires":[["21d1a4bbed30e2b3"]]},{"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},{"id":"72b36798b6f8a559","type":"global-config","env":[],"modules":{"node-red-contrib-home-assistant-websocket":"0.79.4"}}]

Your right I know and I did change that also
If I do the totall message into the action node it is working. But I like to put the message separate from a function node

In your export, the first action node is connected to the second action node instead of the function node. Also, in your screenshot, the “data” field starts with {, but that opening brace is missing in the exported flow.

1 Like

What an unbelievable stupid mistake.
On my screen it showed:
image
So I didn’t see that node 2 was connected straight to node 4 and missing node 3.
It is working now. THANKS!!

It took me 2 days to find out :smiling_face:
My apologize.

1 Like