The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Advice of best xAP structure for OWL Electricity Monitor


  • Subject: Advice of best xAP structure for OWL Electricity Monitor
  • From: Marcus Warrington <marcus.warrington@xxxxxxxxxx>
  • Date: Fri, 1 Apr 2011 15:32:07 +0000

--_000_38DB8F60848A594CBF1B5BE0732099781B173C52ex2MISCScom_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I've just knocked up a little program to extract the current electricity
us=
age (KWh/Amps) from a USB OWL Connect I purchased on Ebay.
I ended up paying about =A37 for the OWL Connect receiver , but apparently
=
Tesco were selling these off a few months ago for less than a fiver !

I've successfully retrieved the usage information in real time (every 6
sec=
onds) but am unsure of the best way or presenting this onto the xAP
network=
. Currently the program is obtaining the information and if its changed
the=
n sending the usage value in a "standard" BSC event format. If
nothing chan=
ged for 60seconds then its sends an info message. I'm using the xAP dll
fro=
m the mi4 website to handle the xAP side of things.

At the moment I'm encoding the usage as a "stream" in Hex format
in the "te=
xt" key, and presenting it in a human readable form in the displaytext
key.

e.g.

{
v=3D12
uid=3DFF111100
class=3DxAPBSC.event
source=3DMJW.U-Mon.MW_Laptop
}
input.state
{
State=3Don
text=3DDC1F447B1F41F4083
displaytext=3D 1.18 KWh (0.5 Amps)
}

The text encoding format I've chosen is hex encoded to keep the down the
si=
ze of the packet and consists of;

2 chars for supply voltage  (DC=3D220)
3 chars for Current usage in Amps (1F4 =3D 500 =3D /100 =3D .5amps)

>From these 2 pieces of information the client can calculate the KWh
usage.

The next 3 chars are for the currently defined electricity cost i.e. 47B =
=3D 1147 =3D 11.47pence per KWh
The next 3 are the minimum Amps used figure (still not sure exactly what
th=
e OWL is actually reporting with this)
The next 3 are the maximum Amps used figure (still not sure exactly what
th=
e OWL is actually reporting with this)
The next 2 chars are the Green House Gas figure (008)
And the final single character represents the trend,0=3Dunknown,
1=3Ddownwa=
rd,2=3Dneutral,3=3Dupward

I'm also thinking of implementing a custom packet structure instead of BSC
=
that will provide more information, such as the last two minutes worth of
f=
igures or even a query structure to allow a date range selection to be
retu=
rn (maybe then used for graphing etc?). I'm not sure if this would be
consi=
dered an abuse the xAP protocol, since its actually being used simply to
tr=
ansferring data from a database.

So the question is.... is what I'm doing OK or does anyone think I should
b=
e doing it differently either for efficiency or best practice reasons ?
I'm slightly unsure of the hex encoding since it would only be slightly
lon=
ger to encode in decimal but would be much easier for the client to handle
=
(i.e. no Hex to decimal conversion)

Also do I need to register "MJW" as an official xAP vendor name?


Regards

Marcus


--_000_38DB8F60848A594CBF1B5BE0732099781B173C52ex2MISCScom_
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable





<head>

<style type=3D"text/css">
<!--

/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}

div.photo-title=20
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;=20
}

div.attach-table div.attach-row {
clear: both;
}

div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}

p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}

div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}

div.attach-table div.attach-row div div span {
font-weight: normal;
}

div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office"
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel"
xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint"
xmlns:a=3D"urn:schemas-microsoft-com:office=
:access"
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema"
xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher"
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t"
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet"
xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc"
xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www.w3.org/TR/REC-html40";
=
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/";
xmlns:rtc=3D"http://m=
icrosoft.com/officenet/conferencing" xmlns:D=3D"DAV:"
xmlns:Repl=3D"http://=
schemas.microsoft.com/repl/" xmlns:mt=3D"http://schemas.microsoft.com/share=
point/soap/meetings/" xmlns:x2=3D"http://schemas.microsoft.com/office/excel=
/2003/xml" xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd";
xmlns:ois=
=3D"http://schemas.microsoft.com/sharepoint/soap/ois/";
xmlns:dir=3D"http://=
schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds=3D"http://www.w3=
.org/2000/09/xmldsig#" xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint=
/dsp" xmlns:udc=3D"http://schemas.microsoft.com/data/udc";
xmlns:xsd=3D"http=
://www.w3.org/2001/XMLSchema" xmlns:sub=3D"http://schemas.microsoft.com/sha=
repoint/soap/2002/1/alerts/" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#"=
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/";
xmlns:sps=3D"http://=
schemas.microsoft.com/sharepoint/soap/" xmlns:xsi=3D"http://www.w3.org/2001=
/XMLSchema-instance" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile";
xmlns:udc=
p2p=3D"http://schemas.microsoft.com/data/udc/parttopart";
xmlns:wf=3D"http:/=
/schemas.microsoft.com/sharepoint/soap/workflow/"
xmlns:dsss=3D"http://sche=
mas.microsoft.com/office/2006/digsig-setup" xmlns:dssi=3D"http://schemas.mi=
crosoft.com/office/2006/digsig" xmlns:mdssi=3D"http://schemas.openxmlformat=
s.org/package/2006/digital-signature" xmlns:mver=3D"http://schemas.openxmlf=
ormats.org/markup-compatibility/2006" xmlns:m=3D"http://schemas.microsoft.c=
om/office/2004/12/omml" xmlns:mrels=3D"http://schemas.openxmlformats.org/pa=
ckage/2006/relationships" xmlns:spwp=3D"http://microsoft.com/sharepoint/web=
partpages" xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/services/20=
06/types" xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/services/200=
6/messages" xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/Sli=
deLibrary/" xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPortal=
Server/PublishedLinksService"
xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:=
st=3D"&#1;" xmlns=3D"http://www.w3.org/TR/REC-html40";>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html;
charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 12
(filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Tahoma","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026"
/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-GB" link=3D"blue"
vlink=3D"purple">


<!-- **begin egp html banner** -->

<br><br>

<!-- **end egp html banner** -->



<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">I&#8217;ve just knocked up a little
program to extract th=
e current electricity usage (KWh/Amps) from a USB OWL Connect I purchased
o=
n Ebay.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">I ended up paying about =A37 for the OWL
Connect receiver=
, but apparently Tesco were selling these off a few months ago for less th=
an a fiver !<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">I&#8217;ve successfully retrieved the
usage information i=
n real time (every 6 seconds) but am unsure of the best way or presenting
t=
his onto the xAP network. Currently the program is obtaining the
information and if its changed then sending the usage value in a
&#8220;st=
andard&#8221; BSC event format. If nothing changed for 60seconds then
its s=
ends an info message. I&#8217;m using the xAP dll from the mi4 website
to h=
andle the xAP side of things.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">At the moment I&#8217;m encoding the
usage as a &#8220;st=
ream&#8221; in Hex format in the &#8220;text&#8221; key, and
presenting it =
in a human readable form in the displaytext
key.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">e.g.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:5.0pt;margin-right:0cm;m=
argin-bottom:5.0pt;margin-left:0cm;text-autospace:none">
<span style=3D"font-size:12.0pt">{<br>
&nbsp;&nbsp; &nbsp;v=3D12 <br>
&nbsp;&nbsp;&nbsp;uid=3DFF111100 <br>
&nbsp;&nbsp;&nbsp;class=3DxAPBSC.event <br>
&nbsp;&nbsp;&nbsp;source=3DMJW.U-Mon.MW_Laptop <br>
} <br>
input.state<br>
{<br>
</span><span
style=3D"font-size:12.0pt">&nbsp;&nbsp;State=3Don<br>
&nbsp; &nbsp;text=3DDC1F447B1F41F4083<br>
&nbsp; displaytext=3D 1.18 KWh (0.5 Amps)<br>
} <br>
</span><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;=
"><br>
The text encoding format I&#8217;ve chosen is hex encoded to keep the
down =
the size of the packet and consists of;<br>
<br>
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">2 chars for supply voltage
&nbsp;(DC=3D220)<o:p></o:p></s=
pan></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">3 chars for Current usage in Amps (1F4 =3D
500 =3D /100 =
=3D .5amps)<br>
<br>
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">From these 2 pieces of information the client
can calcula=
te the KWh usage.<br>
<br>
The next 3 chars are for the currently defined electricity cost i.e. 47B =
=3D 1147 =3D 11.47pence per
KWh<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">The next 3 are the minimum Amps used figure
(still not su=
re exactly what the OWL is actually reporting with
this)<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">The next 3 are the maximum Amps used figure
(still not su=
re exactly what the OWL is actually reporting with
this)<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">The next 2 chars are the Green House Gas
figure (008)<o:p=
></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">And the final single character represents the
trend,0=3Du=
nknown,
1=3Ddownward,2=3Dneutral,3=3Dupward<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">I&#8217;m also thinking of implementing a
custom packet s=
tructure instead of BSC that will provide more information, such as the
las=
t two minutes worth of figures or even a query structure to allow
a date range selection to be return (maybe then used for graphing etc?). I=
&#8217;m not sure if this would be considered an abuse the xAP
protocol, si=
nce its actually being used simply to transferring data from a
database.<o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">So the question is&#8230;. is what
I&#8217;m doing OK or =
does anyone think I should be doing it differently either for efficiency
or=
best practice reasons ?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">I&#8217;m slightly unsure of the hex
encoding since it wo=
uld only be slightly longer to encode in decimal but would be much easier
f=
or the client to handle (i.e. no Hex to decimal conversion)<br>
<br>
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">Also do I need to register
&#8220;MJW&#8221; as an offici=
al xAP vendor name?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-family:&quot;Tahoma&quot;,&quot;=
sans-serif&quot;">Regards<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:&quot;Taho=
ma&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><b><span
style=3D"font-size:10.0pt;font-family:&quot=
;Arial&quot;,&quot;sans-serif&quot;;color:#548DD4">Marcus
</span></b><o:p></o:p></p>
<p
class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>




<!-- **begin egp html banner** -->

<br>

=20=20=20=20
=20=20=20=20
<br>

<!-- **end egp html banner** -->


<div width=3D"1" style=3D"color: white; clear:
both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- **begin egp html banner** -->

<img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D9674343/grpspI=
d=3D1705007709/msgId=3D4721/stime=3D1301671931" width=3D"1"
height=3D"1"> <=
br>

<!-- **end egp html banner** -->

=20=20=20=20
<!-- **begin egp html banner** -->

<br>
<div style=3D"font-family: verdana; font-size: 77%; border-top: 1px
s=
olid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href=3D"http://groups.yahoo.com/group/xap_automation/join;_ylc=3DX=
3oDMTJmdHE4cmh0BF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5=
BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzMDE2NzE5MzE-">Change settings
via the W=
eb</a> (Yahoo! ID required) <br>
Change settings via email: <a href=3D"mailto:xap_automation-digest@ya=
hoogroups.com?subject=3DEmail Delivery: Digest">Switch delivery to
Daily Di=
gest</a>  <a href =3D "mailto:xap_automation-fullfeatured@xxxxxxx?=
subject=3DChange Delivery Format: Fully Featured">Switch to Fully
Featured<=
/a> <br>
<a href=3D"http://groups.yahoo.com/group/xap_automation;_ylc=3DX=
3oDMTJkaXZqdG1hBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5=
BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMzAxNjcxOTMx">
Visit Your Group=20
</a>
<a href=3D"http://docs.yahoo.com/info/terms/";>
Yahoo! Groups Terms of Use
</a>
<a href=3D"mailto:xap_automation-unsubscribe@xxxxxxx?subject=
=3DUnsubscribe">
Unsubscribe=20
</a>=20
<br>
</div>
<br>

<!-- **end egp html banner** -->


<div style=3D"color: white; clear:
both;"/>__,_._,___</div>
</body>
</html>

--_000_38DB8F60848A594CBF1B5BE0732099781B173C52ex2MISCScom_--

xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.