ManagerSpeechInput

Table of Contents

Methods

ask(text, opts, callbackopt)

Let Homey ask a question. There is a limit of 255 characters.

Permissions:
  • homey:manager:speech-input
  • homey:manager:speech-output
Parameters:
Name Type Attributes Description
text string

The sentence to say

opts Object
Name Type Attributes Description
session Object <optional>

The session of the speech. Leave empty to use Homey's built-in speaker

timeout number <optional>

Amount of seconds until the response has timed-out

callback function <optional>
Name Type Description
err Error
result string

The text of the answer

Returns:

Promise

confirm(text, opts, callbackopt)

Let Homey ask a Yes/No question. There is a limit of 255 characters.

Permissions:
  • homey:manager:speech-input
  • homey:manager:speech-output
Parameters:
Name Type Attributes Description
text string

The sentence to say

opts Object
Name Type Attributes Description
session Object <optional>

The session of the speech. Leave empty to use Homey's built-in speaker

timeout number <optional>

Amount of seconds until the response has timed-out

callback function <optional>
Name Type Description
err Error
result boolean

Indicating whether the user answered with yes (true) or no (false)

Returns:

Promise

Events

speechEval

This event is fired when a speech query has been received, and needs feedback.

Parameters:
Name Type Description
speech Object

Information about what the user said

Name Type Description
session string

The session where the speech command originated from

transcript string

The detected user thrase

matches Object

a dynamically generated tree containing all the matched Groups and Elements

words Array

An array of Objects, where each Object contains the word's properties

Name Type Description
word string

The word

posTag string

The part-of-speech tag assigned to the word, using universal dependencies tagset

chunks Object

lists any chunks starting at this word. Stuctured the same as the Object in speech.chunks[]

locations Object

lists any locations starting at this word. Stuctured the same as the Object in speech.locations[]

times Object

lists any times starting at this word. Stuctured the same as the Object in speech.times[]

devices Object

lists any device mentions starting at this word. Stuctured the same as the Object in speech.devices[]

chunks Array

An array of detected noun phrases and verb phrases

Name Type Description
transcript string

The chunk text

startWord number

The index of the words array where the chunk starts

endWord number

The index of the words array where the chunk ends

type string

The chunk type - either NP (Noun Phrase) or VP (Verb Phrase)

locations Array

An array of detected references to a location

Name Type Description
transcript string

The location name

startWord number

The index of the words array where the location starts

endWord number

The index of the words array where the location ends

times Array

An array of detected time references

Name Type Description
transcript string

The time text

startWord number

The index of the words array where the time mention starts

endWord number

The index of the words array where the time mention ends

time Object

The chunk type - either NP (Noun Phrase) or VP (Verb Phrase)

Name Type Description
second number

Seconds. False if no reference to a specific second was made

minute number

Minutes. False if no reference to a specific minute was made

hour number

Hour of the day. False if no reference to a specific hour was made

fuzzyHour boolean

Indicates whether there is uncertainty about a time being am or pm. True if there is uncertainty, false if the part of day was indicated

day number

Day of the month. False if no reference to a specific day was made

month number

Month number. 0 is january. False if no reference to a specific month was made

year number

Year. False if no reference to a specific year was made

devices Array

An array of Device instances which match the device parameters specified in app.json

allZones string

A structured phrase which can be used to provide user feedback about the detected Zone names. Format: "in the {zone_name}(, {zone_name})*( and the {zone_name})?"

callback genericCallbackFunction

A truthy response is used to indicate that your App can process this transcript. The returned value will be passed on to the onSpeechMatch event

speechMatch

Parameters:
Name Type Description
speech Object

Information about what the user said

Name Type Description
session string

The session where the speech command originated from

transcript string

The detected user thrase

matches Object

a dynamically generated tree containing all the matched Groups and Elements

words Array

An array of Objects, where each Object contains the word's properties

Name Type Description
word string

The word

posTag string

The part-of-speech tag assigned to the word, using universal dependencies tagset

chunks Object

lists any chunks starting at this word. Stuctured the same as the Object in speech.chunks[]

locations Object

lists any locations starting at this word. Stuctured the same as the Object in speech.locations[]

times Object

lists any times starting at this word. Stuctured the same as the Object in speech.times[]

devices Object

lists any device mentions starting at this word. Stuctured the same as the Object in speech.devices[]

chunks Array

An array of detected noun phrases and verb phrases

Name Type Description
transcript string

The chunk text

startWord number

The index of the words array where the chunk starts

endWord number

The index of the words array where the chunk ends

type string

The chunk type - either NP (Noun Phrase) or VP (Verb Phrase)

locations Array

An array of detected references to a location

Name Type Description
transcript string

The location name

startWord number

The index of the words array where the location starts

endWord number

The index of the words array where the location ends

times Array

An array of detected time references

Name Type Description
transcript string

The time text

startWord number

The index of the words array where the time mention starts

endWord number

The index of the words array where the time mention ends

time Object

The chunk type - either NP (Noun Phrase) or VP (Verb Phrase)

Name Type Description
second number

Seconds. False if no reference to a specific second was made

minute number

Minutes. False if no reference to a specific minute was made

hour number

Hour of the day. False if no reference to a specific hour was made

fuzzyHour boolean

Indicates whether there is uncertainty about a time being am or pm. True if there is uncertainty, false if the part of day was indicated

day number

Day of the month. False if no reference to a specific day was made

month number

Month number. 0 is january. False if no reference to a specific month was made

year number

Year. False if no reference to a specific year was made

devices Array

An array of Device instances which match the device parameters specified in app.json

allZones string

A structured phrase which can be used to provide user feedback about the detected Zone names. Format: "in the {zone_name}(, {zone_name})*( and the {zone_name})?"

say ManagerSpeechOutput#say

A shorthand method to say something, with the correct session

ask ManagerSpeechInput#ask

A shorthand method to ask a question, with the correct session

confirm ManagerSpeechInput#confirm

A shorthand method to ask a Yes/No question, with the correct session

onSpeechData *

The result from speechEval