Pass msg.payload into conversation.process

I am just getting ahold of conversation.process and wondered how you can pass the msg.payload into the conversation. I created a simply flow here that would read a temperature sensor and spit back the temperature in a ‘witty’ way.

[{"id":"43daba42dc1073e0","type":"telegram receiver","z":"c018c05e16a1f1cf","name":"Receiver","bot":"4f4ec733844193d3","saveDataDir":"","filterCommands":true,"x":105,"y":125,"wires":[["0716b1cfd8c37767"],[]]},{"id":"97a5171027419807","type":"api-call-service","z":"c018c05e16a1f1cf","name":"Start conversation","server":"e46d2e3c.94c37","version":5,"debugenabled":false,"domain":"conversation","service":"process","areaId":[],"deviceId":[],"entityId":[],"data":"{\"text\":\"Turn all lights on\",\"language\":\"NL\",\"agent_id\":\"homeassistant\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"},{"property":"payload.chatId","propertyType":"msg","value":"originalMessage.chat.id","valueType":"msg"},{"property":"payload.type","propertyType":"msg","value":"message","valueType":"str"},{"property":"payload.content","propertyType":"msg","value":"payload.response.speech.plain.speech","valueType":"msg"}],"queue":"none","x":580,"y":125,"wires":[["4ca0611f1949a8de"]]},{"id":"0716b1cfd8c37767","type":"change","z":"c018c05e16a1f1cf","name":"Change payload","rules":[{"t":"set","p":"payload.text","pt":"msg","to":"payload.content","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":125,"wires":[["97a5171027419807"]]},{"id":"4a53450f543e0be1","type":"telegram sender","z":"c018c05e16a1f1cf","name":"Sender","bot":"4f4ec733844193d3","haserroroutput":false,"outputs":1,"x":1075,"y":125,"wires":[[]]},{"id":"4ca0611f1949a8de","type":"change","z":"c018c05e16a1f1cf","name":"Clean up message","rules":[{"t":"delete","p":"payload.response","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":125,"wires":[["4a53450f543e0be1"]]}]

However, it does not appear to grab the temperature (95), but instead just tells me the local temperature.

Tyring to help myself along on this one. I inserted a change node thinking I could insert the msg.payload into the data field of conversation.process. It appears conversation.process thinks I put nothing there:

[{"id":"676d375478e58509","type":"debug","z":"122694966b64ef3b","name":"View Response","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1020,"y":880,"wires":[]},{"id":"dbde479ebf59bae3","type":"api-call-service","z":"122694966b64ef3b","name":"","server":"6e751b1b.8f17c4","version":7,"debugenabled":false,"action":"conversation.process","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\"text\":\"{{msg.conversation}}\",\"language\":\"EN-US\",\"agent_id\":\"conversation.chatgpt\",\"conversation_id\":\"my_conversation_1\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"queue":"none","blockInputOverrides":true,"domain":"conversation","service":"process","x":780,"y":880,"wires":[["676d375478e58509"]]},{"id":"693932a5a1e8e382","type":"change","z":"122694966b64ef3b","name":"Format Query","rules":[{"t":"set","p":"conversation","pt":"msg","to":"\"The current temperature is \" & payload & \"°. Tell me this in a witty way in under 5 words.\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":800,"wires":[["dbde479ebf59bae3","0f667c280647ef65"]]},{"id":"af248b60e0e267d1","type":"api-current-state","z":"122694966b64ef3b","name":"Weather","server":"6e751b1b.8f17c4","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"hae.homeassistant_apple_sleeping_wrist_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":800,"wires":[["693932a5a1e8e382"]]},{"id":"0f667c280647ef65","type":"debug","z":"122694966b64ef3b","name":"View Response2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":760,"wires":[]},{"id":"e01e1f6372a37d91","type":"inject","z":"122694966b64ef3b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":800,"wires":[["af248b60e0e267d1"]]},{"id":"6e751b1b.8f17c4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

It seems there might be a communication issue. If you have any requests or questions, please share them!

I haven’t had time to setup much with assist but have you looked at the examples given in the sentence node documentation?

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/node/sentence.html