Hello.
Here’s a basic question:
I’d like to use Luup code (Lua) to open an URL like http://www.example.com
How do I do that?
Some additional info: I have Imperihome running on an Android-tablet and I’d like to use the TTS in Imperihome so the tablet can give me voice acknowledgments when a scene is run.
[size=20pt]Update Oct 27, 2016:
Problem solved[/size]
Instead of reading trough the whole thread, here is a brief summary of the problem and it’s solution.
Mission:
When a scene is triggered, I’d like a device running Imperihome to say something using the TTS of that device.
Method:
The Imperihome app for Android comes with a web server that has to be enabled in the app settings. In my case, the device running Imperihome will be located at the local adress http://192.168.0.11:8081 (The IP is of course something else on your local network). So by opening a browser and typing that adress, I could reach my Imperihome web interface where I can make the Imperihome do some cool stuff, bu that is out of the scope for this thread.
By typing the URL below in a browser, the Imperihome device will say “Hello”:
http://192.168.0.11:8081/api/rest/speech/tts?text=Hello
In the Luup Wiki, you can use this piece of code to open an url:
local status, result = luup.inet.wget("http://www.example.com", 5)
So, in my Vera Edge, I tried the Luup code below, but it did not work. The code was sent successfully but Imperihome was silent.
local status, result = luup.inet.wget("http://192.168.0.11:8081/api/rest/speech/tts?text=Hello", 5)
Solution:
At the very end of the Luup code above, the figure 5 is some kind of timeout setting.
By changing that figure from 5 to 10 made it work!!!
So, by using the Luup code below, my Imperihome device said “hello”, just as expected.
local status, result = luup.inet.wget("http://192.168.0.11:8081/api/rest/speech/tts?text=Hello", 10)
I hope this helps anyone with a similar problem.
(Say thanks at the end of the thread if it helped you! )