Process conversation using MQTT payload

OK. First of all, I’m not sure how the new Intent Script should work.

I’m wondering is it possible for HA to perform certain action base on sentence in MQTT payload?

You see, I am able to use my PC (via Windows Speech Recognition) or Android (via Zanzito) as voice recognition service and they can publish what I said to an MQTT broker. For example, if I say “Turn on lights in bedroom”, both devices can publish “Turn on lights in bedroom” as payload to a topic such as “mydevice/voicecommand”.

Since HA can subscribe to that topic, can HA also process the payload as conversation input and perform whatever task it suppose to do? How do Conversation and Intent Script components work together?

intent_script is just another way to call an “automation”. If you can write what you want in the form or an automation, you can call it using intent_script. Right now, conversation component does not use intent_script, so they don’t work together, Hopefully, it will change in the future.

thanks for your reply.

Example of automation which is triggered by MQTT;

- alias: 'MQTT Voice Command'
  trigger:
    - platform: mqtt
      topic: benzanzito/voicecommand

What should I put in the action?

  action:
    - service: xxxx.xxxx
      data: xxxxx

or is it what I want to do is not yet supported?

I also notice there is a service call conversation.process in the service page. How do I use it? Any example of the service data that I should put in?

OK. I manage to make some progress. This is a working example of how to process conversation based on MQTT payload…

- alias: 'MQTT Voice Command'
  trigger:
    - platform: mqtt
      topic: benzanzito/voicecommand
  action:
    - service: conversation.process
      data_template:
        text: "{{trigger.payload}}"