It's actually quite simple to have Echo say something in response to a request.
In this example, I'm using a PHP script hosted on my website as the endpoint.
I would ask, "Alexa, open [the name of my skill]"
Then the PHP script will tell Alexa to say anything I want it to.
If you wanted to get the current temperature from your thermostat, you will need to know how to get that value. Once you have that value, the script will ask Alexa to speak it.
In a different example, I've demonstrated that Alexa can say anything you tell her to. This example is the Larry skill which asks Alexa to tell a dirty joke. It didn't work 100% at the time, but here's the video of it:
https://www.youtube.com/watch?v=HLj_p_NwBjY I found out that the reason why it didn't work correctly sometimes was because I had non-ASCII characters in some of the joke text.
<?
##### some code to get the current temperature
##### for example: $msg = "The current temperature is " . $value . " degrees.";
respond($msg);
function respond($jResponse)
{
header('Content-Type: application/json;charset=UTF-8');
$text = '{
"version" : "1.0",
"response" : {
"outputSpeech" : {
"type" : "PlainText",
"text" : "'.$jResponse.'"
},
"shouldEndSession" : '.$true.'
}
}';
// Response
header('Content-Length: ' . strlen($text));
echo $text;
exit;
}
?>
I just implemented one of the unofficial API's from github to have Alexa control my Nest thermostat. I'm now looking for a way for Alexa to tell me what the temperature currently is. So if I say "Alexa, what is the upstairs temperature", she would read the Nest temperature and speak "the temperature is seventy degrees".
I was thinking something could be done using the "Simon Says" feature. Anyone try anything like this?