Hello everyone,
I am using the Sense temperature and humidity sensor from Plugwise.
In the Plugwise Source program (v2.21) I can read these 2 values and they are nicely updated and displaye graphically
However when I want to access these 2 values from the webserver, the fields turn out to be empty.
Does any one have experience with these sensors?
The webscript I use is the following:
<%
$list=Plugwise.Modules
ForEach $list
%>
<% If $list[$_Index] != null %>
"<%=$list[$_Index].Name%>",
<%=$list[$_Index].LastSeenDate%>,
<% if ($list[$_Index].Name == "C....") || ($list[$_Index].Name == "C...")
%>
Temp = <% $list[$_Index].Temperature %>
Hum = <% $list[$_Index].Humidity %>
<%/If
%>
<%Else%>
,,,
<%/If
%>
<br>
<%
/Foreach
%>
accessing sensor values from Plugwise Sense
Re: accessing sensor values from Plugwise Sense
It is not yet supported in the webserver AFAIK.
Thought this was mentioned in the release notes of Source.
Thought this was mentioned in the release notes of Source.
Nico - Domotica in de Betuwe
Re: accessing sensor values from Plugwise Sense
It works as advertised for me with Source 2.21. I put it into some debugging XML with the following template code:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<modules>
<%
foreach Plugwise.Modules
%>
<module>
<appliance><%=.Appliance%></appliance>
<humidity><%=.Humidity%></humidity>
<lastCompletedLogIndex><%=.LastCompletedLogIndex%></lastCompletedLogIndex>
<lastSeenDate><%=.LastSeenDate%></lastSeenDate>
<lastSeenSeconds><%=.LastSeenSeconds%></lastSeenSeconds>
<macAddress><%=.MacAddress%></macAddress>
<name><%=.Name%></name>
<status><%=.Status%></status>
<temperature><%=.Temperature%></temperature>
</module>
<%
/foreach
%>
</modules>
Re: accessing sensor values from Plugwise Sense
For me too:
Code: Select all
<% foreach Plugwise.Modules %>
<% If (.Type == 5) %>
<sense>
<moduleid><%=.Id%></moduleid>
<macaddr><%=.MacAddress%></macaddr>
<typetext><%=.TypeText%></typetext>
<image><%=Plugwise.ImagesPath%>32/<%=.StatusImageName%>.png</image>
<online><%=.IsOnline%></online>
<lastseen><%=.LastSeenSeconds%></lastseen>
<humidity><%=.Humidity%></humidity>
<temperature><%=.Temperature%></temperature>
<firmwaredate><%=.FirmwareDate%></firmwaredate>
<firmwareversion><%=.FirmwareVersion%></firmwareversion>
<hardwareversion><%=.HardwareVersion%></hardwareversion>
</sense>
<% /if %>
<% /foreach %>
Rene.