This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Get result through ask
SentientSwarm
Member
in Developers
So I finally got a homey and started playing with it this week.
Currently I'm playing with the speech api to attempt a simple dialog between Homey and the user. The triggers work and Homey responds, but when I use the ask method to ask a question and expect a result the result comes back empty.
Currently I'm playing with the speech api to attempt a simple dialog between Homey and the user. The triggers work and Homey responds, but when I use the ask method to ask a question and expect a result the result comes back empty.
speech.ask('What is the airspeed of a swallow?', function (e, r) {When running I hear the Homey ask the question, the ring turn yellow which seems to respond to my voice. But the log message is actually "Answer: ' '." no matter what I say in what any language. Am I missing something?
Homey.log("Answer: '" + r + "'.");
});
Comments
Homey.manager('speech-input').on('speech', function( speech, callback ) { speech.ask('What is your name?', function( err, result ) { if( err ) return Homey.error(err); // result is the transcript of the user, in this case it might be `Mike` }); });
if r is empty then it means that e should be filled with some data. And also what does r return when you log it this way? Is it just an empty string or [Object] ?
And now the result is:
The empty line appears to be the direct log statement.
Gives: So it seems the result is really an empty string and there is no err value. Any ideas?