(4) Homeassistant language control

Source: Internet
Author: User

Chinese Course: https://www.hachina.io/docs/2073.html

English Web tutorial: https://www.home-assistant.io/components/conversation/

The session component allows you to talk to your home assistant. You can talk by pressing the microphone in the front end (only supported browsers (no iOS)) or by conversation/process using transcription text to invoke the service .

1 Practice

Adding in the configuration file

# allows issue voice commands from the frontend in enabled browsers# intent to generate components, matching syntax rules after generating corresponding intent conversation:  intents:    # Intent type (name), and corresponding syntax matching rules    Openlight:      -open {Item} Light      -turn {item} light on    closelight:      -close {Item} Light      -off {item} lamp  # Intent to execute component, Execute command intent_script:  # Intent Type (name)  openlight:    # Speech return    speech:      text: Opened {item }} lamp    # Execute action    :      service:light.turn_on      data_template:         entity_id: >          {% if item== "Bedroom"%}            light.test2_rgb_mqtt          {% endif%}    closelight:    speech:      text: Closed {{item}} light    Action:      service:light.turn_off      data_template:         entity_id: >          {% if item== "bedroom"%}            Light.test2_rgb_mqtt          {% endif%}

Restarting the Hass makes the configuration available

or directly reload the configuration

2 Call this service

Should have clicked on the Google browser under the Voice input button, press after what you said, but my voice has been shown no input

The second kind of test that calls this service directly

"Conversation.process Service"
The conversation component registers the service conversation.process in the system. The information format accepted by Conversation.process is:
{"text":"输入的自然语言"}

And then I'm going to go to Mqtt. The topic found on and off, perfect

Now to figure out, Google's web voice input why not

and mixed the sockets into the lights.

2 Extensions

(4) Homeassistant language control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.