Page 2 of 3
Laatste versie plugin
Posted: Sun May 31, 2009 9:11 pm
by Rene
Bastiaan,
Asl je charts.aspx kopieert en in de kopie de volgende regels vervangt:
Code: Select all
// Sending request
xmlHttp.open("GET", sChart + ".aspx", true);
xmlHttp.send(null);
}
</script>
<div style="width:100px;height:500px;float:left;" id="menu">
<br />
<a href="#" style="text-decoration:none;" onclick="DrawChart('Total',null,false,300000)">Total usage</a><br />
<a href="#" style="text-decoration:none;" onclick="DrawChart('Actual',null,false,10000)">Actual usage</a><br />
</div>
door:
Code: Select all
// Sending request
xmlHttp.open("GET", sChart + ".aspx", true);
xmlHttp.send(null);
}
DrawChart('Actual',null,false,10000)
</script>
Dan kan je door een link naar deze nieuwe file te maken direct een overzicht van de actuele waarden op het scherm toveren.
Rene.
Laatste versie plugin
Posted: Mon Jun 01, 2009 10:40 am
by Bastiaan
@ Enver:
Ik vind de kaarten juist geweldig overzichtelijk

Heb jij in je status scherm de plugwise modules onder lokatie laten staan of gegroepeerd in bv een Plugwise lokatie waardoor je alles in 1x ziet?
@Rene:
Geweldig en bedankt! Werkt als een trein. Vraag me alleen af waar die vertraging vandaan komt. Als ik het via de origenele link start staat het binnen 3 seconden op het scherm.
Als ik de nieuwe file gebruik dan duurt het onder IE8 heel erg lang, iets van 5-7 seconden.
Op de Mac is het verschil kleiner.
IE8 geeft links onder ook aan "error on page" maar laat het wel goed zien.
Even het hele blokje wat aangepast is inclusief wat extra regels erboven en onder:
Code: Select all
/* Add timestamp of last update */
var d = new Date();
document.getElementById("LastUpdated").innerHTML = "Last update: " + d.toLocaleString();
}
}
}
// Sending request
xmlHttp.open("GET", sChart + ".aspx", true);
xmlHttp.send(null);
}
DrawChart('Actual',null,false,10000)
</script>
<div style="width:700px;height:500px;float:left" id="VisifireChart">
</div>
Laatste versie plugin
Posted: Mon Jun 01, 2009 12:04 pm
by TANE
Ik heb de tweede locatie in HS gebruikt voor verdeling.
Plugwise locatie wordt van uit plugwise doorgegeven..ook makkelijk bij het zoeken.

Laatste versie plugin
Posted: Mon Jun 01, 2009 1:17 pm
by Rene
Het type aanduiding van de plugwise modules begint met plugwise. Dus als je in het statusscherm sorteert op device type, dan heb je alle plugwise modules onder elkaar staan.
Rene.
Laatste versie plugin
Posted: Mon Sep 14, 2009 8:43 pm
by aeh
Is het mogelijk om het totaal opgenomen vermogen weer te geven in HS.
Laatste versie plugin
Posted: Mon Sep 14, 2009 9:11 pm
by Rene
Ja, dat zit in al in de plugin. Je moet dan in het configuratie menu de optie: Use a special device to collect the total usage of all appliances, aanvinken.
Rene.
Laatste versie plugin
Posted: Mon Sep 14, 2009 10:36 pm
by aeh
Het werkt, bedankt.
Laatste versie plugin
Posted: Mon Sep 14, 2009 11:26 pm
by Ruud
@Rene,
Ga je nog verder ontwikkelen aan de plugin?
Of wacht je dat plugwise een stabielere source uitleverd?
Gr Ruud
Laatste versie plugin
Posted: Mon Sep 14, 2009 11:32 pm
by Rene
Ik ga nog verder ontwikkelen maar de tijd ontbreekt me op het moment. Ik ben nu bezig met een plugin die een XML interface (via URL en XMLRPC) biedt om statussen etc. te ontsluiten en commando's te kunnen geven. Dit heb ik nodig voor de touchscreen interface die ik aan het ontwikkelen ben.
Rene.
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 12:09 am
by Louis
Zojuist heb ik de plugin geinstalleerd en geconfigureerd, het VisiFire deel nog niet.
Moeten er nu automatisch nieuwe devices in HS verschijnen, of hoe maak ik die zelf aan?
Tot nu toe gebruikte ik scripts als Plugwise.vb("Main","5;On") en DJ_Plugwise_6.vb("main","0") en bijbehorende zelf aangemaakte devices in HS. Moet ik die weggooien?
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 12:31 am
by Louis
Oplossing gevonden nog voordat mijn vorige post approved is.
De HS logfile meldde (heel vaak):
ERROR: Cannot query
http://localhost:8080/statistics.xml: Unexpected end of file has occurred. The following elements are not closed: moduleid, appliance, items. Line 59, position 47.
Die file zelf zei me niks, maar er stond voor de installatie al een statistics.xml file in diezelfde directory (waarschijnlijk i.v.m. een van de eerder gebruikte scripts).
Die oudere xml file (van 18-5-2009) teruggezet, HS herstart, en voila! nieuwe devices zichtbar, prachtig!
Het lijkt er dus op dat de statistics.xml file in de zip file (waarnaar in eerste post gelinkt wordt) niet klopt.
Ik heb geen iodee waar ik de wel werkende statistics.xml vandaan gehaald heb, maar ben blij dat het nu werkt.
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 1:02 am
by Rene
De statistics.xml die in de zip file zit moet werken. Je zou de eerste zijn waarbij deze niet werkt.
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 1:17 am
by Louis
Hmmm, nogmaals geprobeerd, met het zelfde resultaat.
Vreemd is ook dat beide files (die ik al had en die uit hspi_Plugwise-0.3.zip) korter zijn dan 59 regels...
het verschil is dit stukje, staat 'extra' in de file die ik al had en die bij mij goed werkt:
Code: Select all
if (.Module == null)
continue;
/if
if (.Room == null)
echo "No Room";
/if
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 8:41 pm
by Rene
These additional lines seem to be added by Plugwise in the latest versions of the Source. They modified the statistics.xml file part of my plugin package. The statistics.xml file included in the 0.3 package of my plugin, which is still working for me, looks as follows:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<items type="array">
<source>
<datetime><%=system.date%> <%=system.time%></datetime>
<version><%=Plugwise.Version%></version>
<versionxml>1.0</versionxml>
<language><%=Plugwise.Language%></language>
</source>
<% foreach Plugwise.Rooms %>
<%$room = .Name %>
<% foreach .Appliances %>
<%
$state=.StatusImageName.Replace("_locked","");
$state=$state.SubString($state.LastIndexOf("_")+1);
%>
<appliance>
<id><%=.Id%></id>
<name><%=.Name%></name>
<type><%=.TypeText%></type>
<image><%=Plugwise.ImagesPath%>32/<%=.StatusImageName%>.png</image>
<locked><%=.DoNotSwitchOff%></locked>
<realstate><%=$state%></realstate>
<powerstate><%=.PowerState%></powerstate>
<powerusage><%=Math.Round(.PowerUsage*100)%></powerusage>
<totalusage><%=Math.Round(.TotalUsage*100)%></totalusage>
<moduleid><%=.Module.Id%></moduleid>
<macaddr><%=.Module.MacAddress%></macaddr>
<moduletype><%=.Module.TypeText%></moduletype>
<room><%=$room%></room>
</appliance>
<% /foreach %>
<% /foreach %>
</items>
Re: Laatste versie plugin
Posted: Mon Jan 04, 2010 9:40 pm
by Louis
I experimented a bit more, and now I understand what the extra lines are good for and why the error occurs on a linenumber that is higher than the number of lines in statistics.xml. The extra lines prevent the problem which otherwise occurs with a device that is known by plugwise but has no plug(moduleid) assigned to it anymore.
Opening statistics.xml (without the extra lines) in a browser results in an error, but the source of that page shows the following bit at the END of the page (which is 59 lines long indeed).
<appliance>
<id>1</id>
<name>wifi</name>
<type>Modem/Router/Wifi</type>
<image>/pwimg/32/router_unknown.png</image>
<locked>False</locked>
<realstate>unknown</realstate>
<powerstate>unknown</powerstate>
<powerusage>0</powerusage>
<totalusage>1085</totalusage>
<moduleid>No current context for member 'Id'
By the way my plugwise version is "2.12 (20091224.0)".
I understand that I have to use the file with the extra lines in it, and that users without a "device that has no moduleid" will not encounter this problem. Am I the only one with this situation?