Simple thought here. Tried search engine with no love. Lots of info on sending html commands to vera to control stuff. Works great.
What I am trying to do is put up a web page that is pretty and simple to control scenes from a tablet. When I program a button on the web page with a URL it executes the URL great. The problem is it then goes to a web page with status info or sometimes an error.
How do I call a command through a web link or html without leaving the web page that I am on?
I still think the easiest solution - no Ajax, no JavaScript, just pure HTML - is to target the returned output of the link to a hidden iframe.
To be more explicit, and at its very simplest, the following code will present a link called TOGGLE which toggles a light switch, but doesn’t lose the page:
Of course, to be a bit more sophisticated, the link can be styled in any way you like (shapes and colours and mouseover, …)
As a plus, this code will work with the page served from anywhere on your LAN, not just from the Vera in question.
It’s what I use on old iPods and iPads to provide a really simple interface.
Thanks for all of the great suggestions. I found this code: I changed ajax_info.txt to my http request and it works. Now I need to figure out how to make better looking buttons and retreive the response.
Question: how do you trigger the pure html approach? Ideally my end goal would be to have a picture (.jpg) be my trigger (button). Then I can make a pretty web page to front end the requests.
I’m liking the js method. How do I pass a scene number to the script from the html call? In this example I would like to make 25 a variable that I can pass to the script. I would then like to make the script a “.js” file and call it from any page I want and just pass the scene number. I have tried putting it into the () and then putting a variable name in the () in the script name and replacing the 25 with the variable name outside the quotes but that doesn’t seem to work. What am I missing? This should be simple shouldn’t it?