Simulate start conversation - Making assist asks first

Hello everyone,

After weeks of testing and learning that the assist_satellite.start_conversation service does not work for Home Assistant Voice PE, I’ve found a way to set it up so that:

  1. A question is asked under a specific condition.
  2. Depending on the question asked, a “Yes” or “No” response will trigger an action.

This all begins by creating two input texts; in my case, input_text.si_o_no and input_text.intent_id. The first will be used to write the response, and the second provides a reference for what the response pertains to.

Next, we create a Custom Sentence and an Intent Script. In the Custom Sentence, we write affirmative phrases that are not normally used on their own like “yes”, “ok, fine”, etc. The Intent Script linked to the Custom Sentence does nothing more than write the value “Yes” on input_text.si_o_no, which can be later used in Node-RED or an automation.

Custom sentence:

language: "it"
intents:
  Answer:
    data:
      - sentences:
          - "Si."
          - "ok"
          - "va bene"
          - "perfetto"

Intent script

Answer:
    description: "set yes or no for automatic answer."
    action:
      - service: input_text.set_value
        data:
          entity_id: input_text.si_o_no
          value: "Si"

Once this is done, let’s move on to Node-RED.

As you can see, the automation follows this logic:

THE FIRST PART FORMULATES THE QUESTION BASED ON THE REQUEST AND PLACES AN ACTION ID ON input_text.id_intent

  1. Event state: triggering event (in my case, TV on).
  2. Other possible conditions.
  3. Action: input_text.set_value on input_text.id_intent, setting the message we want to use, in my case, “Cover.”
  4. Question: tts.cloud_say with what we want the satellite to ask us.
  5. Delay 20 sec, waiting for a response, then resets the value of input_text.id_intent to Unknown.

THE SECOND PART

When the user responds “OK Nabu, that’s fine,” the intent script will set the value “YES” on input_text.yes_or_no.

  1. We use event state to monitor if input_text.si_o_no changes to “yes” (Si in italian if you look the images)
  2. Current state to see what is written in input_text.id_intent.
  3. Switch node to determine which action to refer to.
  4. Each option corresponds to an action to be executed, after which it sets input_text.yes_or_no back to Unknown.

In this way, everything is scalable. There’s only one custom sentence that writes “Yes” on the input text, and then you can create as many scenarios as you want. Just make sure that the triggering condition of the tts question writes the action ID, so it can be utilized in the switch node.

4

Now, the automation you see in the photo works like this: if I turn on the TV and sit down on the sofa, once I’m seated, the STT (speech-to-text) kicks in asking, “Do you want me to close the blind?” (it will write ‘blind’ in input_text.id_intent). When I respond “OK Nabu, that’s fine,” ‘yes’ is written to input_text.yes_or_no and it’s linked via a switch node to the intent ID in input_text.id_intent. If ‘Yes’ is linked to an intent ID, the action will be executed and the values will be reset to Unknown. So, the sequence will be: turn on the TV, sit down on the sofa, I will be asked, “Do you want me to lower the blind?” I respond “OK Nabu, that’s fine,” and the blind lowers. If desired, another confirmation phrase can be added either with STT or using google_generative_ai_conversation.generate_content for a more colorful sentence.

Sorry for the Italian configuration on the foto.

If this has been helpful or if you have any other tips to improve and make this method more efficient, please let me know. I’m new to Home Assistant and have found it to be the best community I’ve ever seen.

JSON for Node red - just paste in : node red, import, and paste the JSON

I leve here my Json to import the flow in node red. the only thing you need is: Create the custom sentence and intent script like the guide, create 2 input text like i mention on the guide, set the parameters (input text set intent) on the swich node write the intent id you want that makes an action. You must select in every node the entity and the condition you want:

[{“id”:“d4a75fc04f1456c9”,“type”:“tab”,“label”:“Assis Ask 1st”,“disabled”:false,“info”:“”,“env”:},{“id”:“b57d70c477cae541”,“type”:“server-state-changed”,“z”:“d4a75fc04f1456c9”,“name”:“Event state”,“server”:“b5af624.e287ca”,“version”:6,“outputs”:1,“exposeAsEntityConfig”:“”,“entities”:{“entity”:,“substring”:,“regex”:},“outputInitially”:false,“stateType”:“str”,“ifState”:“”,“ifStateType”:“str”,“ifStateOperator”:“is”,“outputOnlyOnStateChange”:true,“for”:“5”,“forType”:“num”,“forUnits”:“seconds”,“ignorePrevStateNull”:false,“ignorePrevStateUnknown”:false,“ignorePrevStateUnavailable”:false,“ignoreCurrentStateUnknown”:false,“ignoreCurrentStateUnavailable”:false,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“”,“valueType”:“entityState”},{“property”:“data”,“propertyType”:“msg”,“value”:“”,“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:“”,“valueType”:“triggerId”}],“x”:80,“y”:140,“wires”:[[“ae74a22e6c611eb3”]]},{“id”:“ae74a22e6c611eb3”,“type”:“ha-wait-until”,“z”:“d4a75fc04f1456c9”,“name”:“More condition”,“server”:“b5af624.e287ca”,“version”:3,“outputs”:1,“entities”:{“entity”:,“substring”:,“regex”:},“property”:“state”,“comparator”:“is”,“value”:“on”,“valueType”:“str”,“timeout”:“0”,“timeoutType”:“num”,“timeoutUnits”:“seconds”,“checkCurrentState”:true,“blockInputOverrides”:true,“outputProperties”:,“x”:240,“y”:140,“wires”:[[“7101e1f5c249263a”]]},{“id”:“7101e1f5c249263a”,“type”:“api-call-service”,“z”:“d4a75fc04f1456c9”,“name”:“Set Id intent to "action"”,“server”:“b5af624.e287ca”,“version”:7,“debugenabled”:false,“action”:“input_text.set_value”,“floorId”:,“areaId”:,“deviceId”:,“entityId”:[“input_text.id_intent”],“labelId”:,“data”:“{ "value": "Your action" }”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“blockInputOverrides”:true,“domain”:“input_text”,“service”:“set_value”,“x”:450,“y”:140,“wires”:[[“17d1047c842ce192”]]},{“id”:“17d1047c842ce192”,“type”:“api-call-service”,“z”:“d4a75fc04f1456c9”,“name”:“Asking”,“server”:“b5af624.e287ca”,“version”:7,“debugenabled”:false,“action”:“tts.cloud_say”,“floorId”:,“areaId”:,“deviceId”:,“entityId”:,“labelId”:,“data”:“{ "cache": false, "entity_id": "YOUR ASSIST SATELLITE ENTITY", "message": "YOUR MESSAGE?" }”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“blockInputOverrides”:true,“domain”:“tts”,“service”:“cloud_say”,“x”:650,“y”:140,“wires”:[[“78c7c048c64a383e”]]},{“id”:“78c7c048c64a383e”,“type”:“delay”,“z”:“d4a75fc04f1456c9”,“name”:“”,“pauseType”:“delay”,“timeout”:“20”,“timeoutUnits”:“seconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“allowrate”:false,“outputs”:1,“x”:800,“y”:140,“wires”:[[“53a15d60ac6b5de0”]]},{“id”:“53a15d60ac6b5de0”,“type”:“api-call-service”,“z”:“d4a75fc04f1456c9”,“name”:“set intent id Unknow”,“server”:“b5af624.e287ca”,“version”:7,“debugenabled”:false,“action”:“input_text.set_value”,“floorId”:,“areaId”:,“deviceId”:,“entityId”:[“input_text.id_intent”],“labelId”:,“data”:“{ "value": "Unknow" }”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“blockInputOverrides”:true,“domain”:“input_text”,“service”:“set_value”,“x”:1000,“y”:140,“wires”:[]},{“id”:“ef327b5e8907ba1e”,“type”:“server-state-changed”,“z”:“d4a75fc04f1456c9”,“name”:“Answer: Yes”,“server”:“b5af624.e287ca”,“version”:6,“outputs”:2,“exposeAsEntityConfig”:“”,“entities”:{“entity”:[“input_text.si_o_no”],“substring”:,“regex”:},“outputInitially”:false,“stateType”:“str”,“ifState”:“Yes”,“ifStateType”:“str”,“ifStateOperator”:“is”,“outputOnlyOnStateChange”:true,“for”:“0”,“forType”:“num”,“forUnits”:“minutes”,“ignorePrevStateNull”:false,“ignorePrevStateUnknown”:false,“ignorePrevStateUnavailable”:false,“ignoreCurrentStateUnknown”:false,“ignoreCurrentStateUnavailable”:false,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“”,“valueType”:“entityState”},{“property”:“data”,“propertyType”:“msg”,“value”:“”,“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:“”,“valueType”:“triggerId”}],“x”:90,“y”:260,“wires”:[[“d5da104acd210f82”],]},{“id”:“d5da104acd210f82”,“type”:“api-current-state”,“z”:“d4a75fc04f1456c9”,“name”:“Intent”,“server”:“b5af624.e287ca”,“version”:3,“outputs”:1,“halt_if”:“”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“entity_id”:“input_text.id_intent”,“state_type”:“str”,“blockInputOverrides”:true,“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”:250,“y”:260,“wires”:[[“af3639fc836fe686”]]},{“id”:“af3639fc836fe686”,“type”:“switch”,“z”:“d4a75fc04f1456c9”,“name”:“Wich intent?”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“Cinema”,“vt”:“str”},{“t”:“eq”,“v”:“Your action”,“vt”:“str”},{“t”:“eq”,“v”:“”,“vt”:“str”},{“t”:“eq”,“v”:“”,“vt”:“str”},{“t”:“eq”,“v”:“”,“vt”:“str”},{“t”:“eq”,“v”:“”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:6,“x”:390,“y”:260,“wires”:[[“543c58125d20733c”],,,,,]},{“id”:“543c58125d20733c”,“type”:“api-call-service”,“z”:“d4a75fc04f1456c9”,“name”:“Set your action”,“server”:“b5af624.e287ca”,“version”:7,“debugenabled”:false,“action”:“”,“floorId”:,“areaId”:,“deviceId”:,“entityId”:,“labelId”:,“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“blockInputOverrides”:true,“domain”:“input_boolean”,“service”:“turn_on”,“x”:560,“y”:220,“wires”:[[“76bb78fef21b4d4b”]]},{“id”:“76bb78fef21b4d4b”,“type”:“api-call-service”,“z”:“d4a75fc04f1456c9”,“name”:“Set Answer to Unknow”,“server”:“b5af624.e287ca”,“version”:7,“debugenabled”:false,“action”:“input_text.set_value”,“floorId”:,“areaId”:,“deviceId”:,“entityId”:[“input_text.si_o_no”],“labelId”:,“data”:“{ "value": "Unknow" }”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“blockInputOverrides”:true,“domain”:“input_text”,“service”:“set_value”,“x”:760,“y”:220,“wires”:[]},{“id”:“e2e7c74b5f7bcf86”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“set condition”,“info”:“”,“x”:110,“y”:100,“wires”:},{“id”:“36e72903cdb523d4”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“name the intent id and set entity input_text.id_intent”,“info”:“”,“x”:450,“y”:40,“wires”:},{“id”:“552d3f9ff4558d96”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“write what you want assist ask”,“info”:“”,“x”:750,“y”:80,“wires”:},{“id”:“486a5a09c256b17a”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“set entity input_text.id_intent”,“info”:“”,“x”:1020,“y”:80,“wires”:},{“id”:“21af66e9b2302586”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“set entity input_text.answer”,“info”:“”,“x”:120,“y”:220,“wires”:},{“id”:“f8f0db2b973197f5”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“set entity input_text.id_intent”,“info”:“”,“x”:180,“y”:320,“wires”:},{“id”:“ee4f58a3df859332”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“write your intent. MUST BE = "YOUR ACTION"”,“info”:“”,“x”:500,“y”:360,“wires”:},{“id”:“fde7a16282086db9”,“type”:“comment”,“z”:“d4a75fc04f1456c9”,“name”:“set entity input_text.answer”,“info”:“”,“x”:780,“y”:260,“wires”:},{“id”:“b5af624.e287ca”,“type”:“server”,“name”:“Home Assistant”,“addon”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“”,“connectionDelay”:false,“cacheJson”:false,“heartbeat”:true,“heartbeatInterval”:“30”,“statusSeparator”:“”,“enableGlobalContextStore”:false}]

Hey there, is there any way you can post this flow in another way? Currently portions of it are replaced by this weird box, and they paste as blank spaces.

Also, as I’ve seen before with pasted code in forums, the quotion marks are replaced by “curly” versions. vs " which is easy enough to replace in a text editor, but still annoying lol