HTML page

I?ve created a simple HTML page to control a device. When I click either link, the controller returns XML. Now I need to add logic to process the result of the request. Am I correct to assume that if a job number is returned, the task was completed? If the URL is incorrect, ?ERROR: Invalid service/action/device? is returned. Should I query the device for the status? Is there documentation that lists return codes/text for URLs?

wuT2w*

Hi,

Have you looked at the wiki pages? There is a section on how to build your own GUI which may help you [url=http://wiki.micasaverde.com/index.php/UI_Simple]http://wiki.micasaverde.com/index.php/UI_Simple[/url].

Ignore the bit about connecting remotely as that is obsolete. Also the local url should read http://[vera ip]/port_3480/… The :3480 use as shown in the wiki will be blocked in a future release for security reasons.

Cheers Rene

I did look at that page, but it describes a complete user interface (user authentication, for example) written in C++. Much more than I need. I did dig a little deeper into the .zip ([url=http://wiki.micasaverde.com/index.php/UI_Simple_Sample]http://wiki.micasaverde.com/index.php/UI_Simple_Sample[/url]) and may be able to use some of the code as at least pseudocode.

A rewrite. No error checking. Next version to check device status and use two images to appear to toggle on/off.

My goal is to create an interface to run on Raspberry Pi.

<!DOCTYPE html>
<html>
<body>

<h1>Lights</h1>
<h2>Office</h2>

<button type="button" onclick="SendAction(1)"><img src="lighton.png"></button>
<button type="button" onclick="SendAction(0)"><img src="lightoff.png"></button>

<p id="msg"></p>

<script>
function SendAction(NewState) {
  var xhttp=new XMLHttpRequest();
  URL="http://192.168.1.20:3480/data_request?id=action&output_format=xml&DeviceNum=6&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue="+NewState;
  xhttp.open("POST",URL,true);
  xhttp.send();
  /*Use the following to update elements on the page. Currently displays Vera job #.
  xhttp.onreadystatechange = function() {
  if (this.readyState == 4 && this.status == 200) {
  document.getElementById("msg").innerHTML = this.responseText;
  }
  };*/
}
</script>

</body>
</html>

Hi,

Have you looked at ALTUI with openLuup as that gives you just that? Add the Virtual Panel plugin you can design a panel just as you like it.

But, I can imagine you want to build your own as I also like a level of control I can make my self using LUA code rather then using PLEG, Workflows or what ever.

For future compatibility you have to change your URL to http://192.168.1.20/port_3480

Have fun.

Cheers Rene

I have AltUI app installed. I do not see the Virtual Panel listed as an app. Are you referring to the AltUI Panels menu?

I originally started out repurposing a Samsung Android tablet to become a wall-mounted display of weather, radar, and z-wave devices (via ImperHome). It does work well, but has problems. Mostly the lack of security and battery drain even connected to AC power.

(For the tablet, I used the apps MyRadar, Weather Station, Caffeine, ImperHome, and Tasker.)

Hi,

This is the Virtual Panel plugin [url=http://forum.micasaverde.com/index.php/topic,31128.375.html]http://forum.micasaverde.com/index.php/topic,31128.375.html[/url].

ALTUI indeed has a custom panel option too.

Cheers Rene