Im a 4th year student of communication and multimedia design at the HAN (Hogeschool van Arnhem en Nijmegen)in the Netherland.
Currently Im doing my Internship at a company called Logica. I have a assignment to design, develop and make a prototype of an interface that will make users aware of their power usages. Through the use of an avatar or digital representation that communicates with the user in an active manner (Emotions like sad, happy, encouraging ect) the user will be more aware of his energy usage. This avatar will have an positive influence on the energy consumption.
To make this system work I decided to buy a Plugwise Home Start Pakket. I received it last weekend and now I am experimenting with the web server. My goal is to create an .XML file that I can call upon in a Adobe Flash file.
Currently I am using the Example XML file that came with the software to look at some data. The only data I really need is the current power usage and the total power usage. To get this i emitted the example xml file to this:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<items type="array">
<% foreach Plugwise.Rooms %>
<%$room = .Name %>
<% foreach .Appliances %>
<%
if (.Module == null)
continue;
/if
if (.Room == null)
echo "No Room";
/if
$state=.StatusImageName.Replace("_locked","");
$state=$state.SubString($state.LastIndexOf("_")+1);
%>
<appliance>
<powerstate><%=.PowerState%></powerstate>
<powerusage><%=Math.Round(.PowerUsage*100)%></powerusage>
<totalusage><%=Math.Round(.TotalUsage*100)%></totalusage>
</appliance>
<% /foreach %>
<% /foreach %>
</items>
This is working great cause when i just called upon the example.xml file i got this:
<hr noshade size="1">
Code: Select all
<items type="array">
#8722;
<appliance>
<powerstate>on</powerstate>
<powerusage>8520</powerusage>
<totalusage>12</totalusage>
</appliance>
</items>
exactly the information i needed... But here i also encountered my problem..
The data doesn't seem to be realtime (in the sense that i can 'pull' it on request.. The data seems to be pushed every 2 minutes or so..
So my question:
Would it be possible to refresh the data of the current power usages everytime i call upon the xml data? Cause i want it to be realtime within my flash animation.
If so, how would i do this?
I notices that when using the source software i can press the refresh button on the bottom to get the realtime data.. Would something like this be possible in the webserver?
I hope someone can help me out