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]

RE: Advice of best xAP structure for OWL Electricity Monitor



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

Kevin

Thanks for the response. I'd assumed BSC was pretty rigid in the fields it
=
should contain but it sounds like your saying that they are just the
minimu=
m required fields  and that I can add any others that I choose. In which
ca=
se I'd probably go for discrete fields for each value in ASCII rather than
=
hex;

{
v=3D12
hop=3D1
uid=3DFF111136
class=3DxAPBSC.event
source=3DMJW.U-Mon.MW_Laptop:36
}
input.state
{
state=3Don
level =3D50/500
displaytext=3D 0.5 Amps
volts =3D 230
Amps=3D 0.5
Amps=3Dmin=3D0.4
Amps_max=3D0.6
KWh =3D1.18
KWh_min =3D 1
KWh_max=3D1.2
KWh_cost=3D11.47
Time=3D20110404120555
}


=D8  One thing you should change for the BSC schema  is to create an
endpoi=
nt (sub address) and don't use the main application address

OK, I was thinking that I may use the sub device for the actual OWL
transmi=
tter device id. I currently only have one device (id=3D36) but I suppose
it=
is possible that I may add a second transmitter and has one on the lightin=
g circuit and one for the sockets.


=D8  Remember BSC is a two way schema so you must receive and respond
(with=
a xapBSC.info) to a xAPBSC.query message targeted at your endpoint (and an=
y wildcarded variant of it's address).

Ahh yes.. I did know that but had tempoarily forgotten :)


=D8  You could also create several BSC reporting end nodes for the same
inf=
o (KWHr) but over the different periods you wish to use eg a 2 minute node
=
with the peak or average consumption.  A little untidy but workable.

source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.peak
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.average
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.peak
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.average

Would each of those end nodes have a heart beat or would that be just the
t=
op level device node, and would each end node have to send its own info
mes=
sage every 60 seconds ?



=D8   I'll add MJW to the list of xAP vendor ID's.

Thanks.

Marcus

From: xap_automation@xxxxxxx [mailto:xap_automation@xxxxxxx=
] On Behalf Of Kevin Hawkins
Sent: 02 April 2011 00:57
To: xap_automation@xxxxxxx
Subject: Re: [xap_automation] Advice of best xAP structure for OWL
Electric=
ity Monitor



Hi Marcus....

First of all how and what you present is really your choice so the enco=
ded data and displaytext=3D is fine if that's how you want to do it.   You
=
could of course split it across several endpoints as well if you prefer.

Although not very tidy you could add your own parameters within the BSC =
message should you wish , perhaps presenting your extra information as
data=
=3D or even a series of parameters, or as you say you can create your own
s=
chema to present more info in one message. The latter is perhaps better.

I wouldn't worry too much about the packet length as you have a lot of =
headway in a UDP packet, you can even delimit decimal values if you wish 
t=
ext=3D1,2,3,45,666  but I'm thinking it maybe better to present each as an
=
individual parameter  in the body.

Amps=3D1.23
Volts=3D235
etc


One thing you should change for the BSC schema  is to create an endpoint=
(sub address) and don't use the main application address (which ends in 00=
).  So change the end digit of the UID and create a sub address ..
somethin=
g like..

UID=3DFF111101
source=3DMJW.U-Mon.MW_Laptop:KWHr

Now if you later want to add more info presented in different BSC message=
s you can just create more sub addresses and change the UID.

Remember BSC is a two way schema so you must receive and respond (with a =
xapBSC.info) to a xAPBSC.query message targeted at your endpoint (and any
w=
ildcarded variant of it's address).

I note there is no hop=3D parameter in the header (it's mandatory) ,  but=
I'm thinking that might just be an omission in the posting

Using your own schema to create a way of querying a database is absolutel=
y allowable - you can use xAP just as you wish.  Actually this same
require=
ment comes up quite frequently in weather applications - high/low figures
o=
ver minute/hour/day/month/year etc.    Before you ask ...there is no
standa=
rd schema for this query approach.

You could also create several BSC reporting end nodes for the same info (=
KWHr) but over the different periods you wish to use eg a 2 minute node
wit=
h the peak or average consumption.  A little untidy but workable.

source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.peak
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.average
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.peak
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.average

I'll add MJW to the list of xAP vendor ID's.


Cheers Kevin

On 01/04/2011 16:32, Marcus Warrington wrote:

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_38DB8F60848A594CBF1B5BE0732099781B17B645ex2MISCScom_
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:m=3D"http://schema=
s.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html=
40">
<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#1E66AE;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#1E66AE;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
tt
{mso-style-priority:99;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.cat
{mso-style-name:cat;}
span.ct
{mso-style-name:ct;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.attach, li.attach, div.attach
{mso-style-name:attach;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:9.0pt;
font-family:"Arial","sans-serif";}
p.bold, li.bold, div.bold
{mso-style-name:bold;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:10.0pt;
font-family:"Arial","sans-serif";
font-weight:bold;}
p.green, li.green, div.green
{mso-style-name:green;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:#628C2A;}
p.replbq, li.replbq, div.replbq
{mso-style-name:replbq;
margin:3.0pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad, li.ad, div.ad
{mso-style-name:ad;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.underline, li.underline, div.underline
{mso-style-name:underline;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.yshortcuts
{mso-style-name:yshortcuts;}
p.ad1, li.ad1, div.ad1
{mso-style-name:ad1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad2, li.ad2, div.ad2
{mso-style-name:ad2;
mso-margin-top-alt:auto;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.underline1, li.underline1, div.underline1
{mso-style-name:underline1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";
text-decoration:underline;}
span.yshortcuts1
{mso-style-name:yshortcuts1;
font-family:"Verdana","sans-serif";
font-weight:bold;}
span.yshortcuts2
{mso-style-name:yshortcuts2;
font-family:"Verdana","sans-serif";
font-weight:normal;}
span.EmailStyle36
{mso-style-type:personal-reply;
font-family:"Tahoma","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:30111161;
mso-list-type:hybrid;
mso-list-template-ids:-1814238578 876661540 134807555 134807557 134807553 =
134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
{mso-level-start-at:28;
mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:12.0pt;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";
color:windowtext;}
@list l1
{mso-list-id:1122966611;
mso-list-template-ids:-945368796;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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 bgcolor=3D"white" lang=3D"EN-GB"
link=3D"#1E66AE" vlink=3D"#1E66AE">


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

<br><br>

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



<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D">Kevin<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks
for the response. I=
&#8217;d assumed BSC was pretty rigid in the fields it should contain
but i=
t sounds like your saying that they are just the minimum required
fields&nbsp; and that I can add any others that I choose. In which case
I&=
#8217;d probably go for discrete fields for each value in ASCII rather
than=
hex;<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoNormal">{<br>
&nbsp;&nbsp; v=3D12 <o:p></o:p></p>
<p class=3D"MsoNormal">hop=3D1<br>
&nbsp;&nbsp;&nbsp;uid=3DFF111136 <br>
&nbsp;&nbsp;&nbsp;class=3DxAPBSC.event <br>
&nbsp;&nbsp;&nbsp;source=3DMJW.U-Mon.MW_Laptop:36 <br>
} <br>
input.state<br>
{<br>
&nbsp;&nbsp;state=3Don<br>
&nbsp; level =3D50/500<br>
&nbsp; displaytext=3D 0.5 Amps<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp; volts =3D
230<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;Amps=3D 0.5<br>
&nbsp; Amps=3Dmin=3D0.4<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;
Amps_max=3D0.6<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp; KWh
=3D1.18<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp; KWh_min =3D
1<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;
KWh_max=3D1.2<o:p></o:p></p>
<p class=3D"MsoNormal"><span
style=3D"color:red">&nbsp; </span>KWh_cost=3D1=
1.47<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;
Time=3D20110404120555<br>
}<span
style=3D"font-size:11.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-=
serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo2"><![if !supportLists]><span
style=3D"font-family:Wingdings"><span s=
tyle=3D"mso-list:Ignore">=D8<span style=3D"font:7.0pt
&quot;Times New Roman=
&quot;">&nbsp;
</span></span></span><![endif]>One thing you should
change for the BSC sche=
ma&nbsp; is to create an endpoint (sub address) and don't use the main
appl=
ication address<span
style=3D"font-size:11.0pt;font-family:&quot;Tahoma&quo=
t;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<div>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D">OK,
I was t=
hinking that I may use the sub device for the actual OWL transmitter
device=
id. I currently only have one device (id=3D36) but I suppose
it is possible that I may add a second transmitter and has one on the ligh=
ting circuit and one for the
sockets.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo2"><![if !supportLists]><span
lang=3D"EN-US" style=3D"font-family:Win=
gdings"><span style=3D"mso-list:Ignore">=D8<span
style=3D"font:7.0pt &quot;=
Times New Roman&quot;">&nbsp;
</span></span></span><![endif]>Remember BSC is a
two way schema so you must=
receive and respond (with a xapBSC.info) to a xAPBSC.query message targete=
d at your endpoint (and any wildcarded variant of it's address).<span
lang=
=3D"EN-US"
style=3D"font-size:11.0pt;font-family:&quot;Tahoma&quot;,&quot;s=
ans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D">Ahh
yes.. I=
did know that but had tempoarily forgotten
</span><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-family:Wingdings=
;color:#1F497D">J</span><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font=
-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo2"><![if !supportLists]><span
lang=3D"EN-US" style=3D"font-family:Win=
gdings"><span style=3D"mso-list:Ignore">=D8<span
style=3D"font:7.0pt &quot;=
Times New Roman&quot;">&nbsp;
</span></span></span><![endif]>You could also
create several BSC reporting =
end nodes for the same info (KWHr) but over the different periods you wish
=
to use eg a 2 minute node with the peak or average consumption.&nbsp; A
lit=
tle untidy but workable.<br>
<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.peak<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.average<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.peak<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.average<span
lang=3D"EN-US" style=
=3D"font-size:11.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;=
color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D">Would
each =
of those end nodes have a heart beat or would that be just the top level
de=
vice node, and would each end node have to send its own info
message every 60 seconds ?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo2"><![if !supportLists]><span
lang=3D"EN-US" style=3D"font-family:Win=
gdings"><span style=3D"mso-list:Ignore">=D8<span
style=3D"font:7.0pt &quot;=
Times New Roman&quot;">&nbsp;
</span></span></span><![endif]>&nbsp;I'll add
MJW to the list of xAP vendor=
ID's.<span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-family:&quot;Taho=
ma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks.<o:p=
></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-size:11.0pt;font-=
family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"><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><span
style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,=
&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
</div>
<p class=3D"MsoNormal"><span
style=3D"font-size:11.0pt;font-family:&quot;Ta=
homa&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></=
p>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal"><b><span
lang=3D"EN-US" style=3D"font-size:10.0pt;fo=
nt-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span
=
lang=3D"EN-US"
style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&qu=
ot;sans-serif&quot;"> xap_automation@xxxxxxx [mailto:xap_automation=
@yahoogroups.com]
<b>On Behalf Of </b>Kevin Hawkins<br>
<b>Sent:</b> 02 April 2011 00:57<br>
<b>To:</b> xap_automation@xxxxxxx<br>
<b>Subject:</b> Re: [xap_automation] Advice of best xAP
structure for OWL E=
lectricity Monitor<o:p></o:p></span></p>
</div>
</div>
<p
class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">&nbsp;
<o:p></o:p></p>
<div id=3D"ygrp-mlmsg">
<div id=3D"ygrp-msg">
<div id=3D"ygrp-text">
<p>Hi Marcus.... <br>
<br>
&nbsp;&nbsp;&nbsp; First of all how and what you present is
really your cho=
ice so the encoded data and displaytext=3D is fine if that's how you want
t=
o do it.&nbsp;&nbsp; You could of course split it across several
endpoints =
as well if you prefer.<br>
<br>
&nbsp;&nbsp; Although not very tidy you could add your own
parameters withi=
n the BSC message should you wish , perhaps presenting your extra
informati=
on as data=3D or even a series of parameters, or as you say you can create
=
your own schema to present more info in one
message. The latter is perhaps better.<br>
<br>
&nbsp;&nbsp;&nbsp; I wouldn't worry too much about the packet
length as you=
have a lot of headway in a UDP packet, you can even delimit decimal values=
if you wish&nbsp; text=3D1,2,3,45,666&nbsp; but I'm thinking it
maybe bett=
er to present each as an individual parameter&nbsp; in the
body.<br>
<br>
Amps=3D1.23<br>
Volts=3D235<br>
etc<br>
<br>
<br>
&nbsp;&nbsp; One thing you should change for the BSC
schema&nbsp; is to cre=
ate an endpoint (sub address) and don't use the main application address
(w=
hich ends in 00).&nbsp; So change the end digit of the UID and create a
sub=
address .. something like..<br>
<br>
UID=3DFF111101<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr<br>
<br>
&nbsp; Now if you later want to add more info presented in different
BSC me=
ssages you can just create more sub addresses and change the UID.<br>
<br>
&nbsp; Remember BSC is a two way schema so you must receive and respond
(wi=
th a xapBSC.info) to a xAPBSC.query message targeted at your endpoint (and
=
any wildcarded variant of it's address).<br>
<br>
&nbsp; I note there is no hop=3D parameter in the header (it's
mandatory) ,=
&nbsp; but I'm thinking that might just be an omission in the
posting<br>
<br>
&nbsp; Using your own schema to create a way of querying a database is
abso=
lutely allowable - you can use xAP just as you wish.&nbsp; Actually
this sa=
me requirement comes up quite frequently in weather applications -
high/low=
figures over minute/hour/day/month/year etc.&nbsp;&nbsp;&nbsp;
Before you ask ...there is no standard schema for this query
approach.&nbs=
p;&nbsp; <br>
<br>
&nbsp; You could also create several BSC reporting end nodes for the
same i=
nfo (KWHr) but over the different periods you wish to use eg a 2 minute
nod=
e with the peak or average consumption.&nbsp; A little untidy but
workable.=
<br>
<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.peak<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.2min.average<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.peak<br>
source=3DMJW.U-Mon.MW_Laptop:KWHr.30min.average<br>
<br>
&nbsp;I'll add MJW to the list of xAP vendor ID's.<br>
<br>
<br>
&nbsp;&nbsp; Cheers Kevin<br>
<br>
&nbsp;On 01/04/2011 16:32, Marcus Warrington wrote:
<o:p></o:p></p>
<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt">
<p class=3D"MsoNormal">&nbsp;
<o:p></o:p></p>
<div id=3D"ygrp-text">
<div>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">I&#8217;ve just knocked up a little program to extract
the current=
electricity usage (KWh/Amps) from a USB OWL Connect I purchased on
Ebay.<o=
:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">I ended up paying about =A37 for the OWL Connect receiver
, but ap=
parently Tesco were selling these off a few months ago for less than a
five=
r !<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">I&#8217;ve successfully retrieved the usage
information in real ti=
me (every 6 seconds) 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 then sending the usage value =
in a &#8220;standard&#8221; BSC event format. If nothing changed
for 60seco=
nds then its sends an info message. I&#8217;m using the xAP dll from
the mi=
4 website to handle the xAP side of
things.<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">At the moment I&#8217;m encoding the usage as a
&#8220;stream&#822=
1; in Hex format in the &#8220;text&#8221; key, and presenting it
in a huma=
n readable form in the displaytext key.<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">e.g.<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">{<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>
&nbsp;&nbsp;State=3Don<br>
&nbsp; &nbsp;text=3DDC1F447B1F41F4083<br>
&nbsp; displaytext=3D 1.18 KWh (0.5 Amps)<br>
} <br>
<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>
<br>
<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">2 chars for supply voltage
&nbsp;(DC=3D220)<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">3 chars for Current usage in Amps (1F4 =3D 500 =3D /100
=3D .5amps=
)<br>
<br>
<br>
<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">From these 2 pieces of information the client can
calculate the KW=
h 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></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">The next 3 are the minimum Amps used figure (still not
sure exactl=
y what the OWL is actually reporting with
this)<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">The next 3 are the maximum Amps used figure (still not
sure exactl=
y what the OWL is actually reporting with
this)<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">The next 2 chars are the Green House Gas figure
(008)<o:p></o:p></=
p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">And the final single character represents the
trend,0=3Dunknown, 1=
=3Ddownward,2=3Dneutral,3=3Dupward<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">I&#8217;m also thinking of implementing a custom
packet structure =
instead of BSC that will provide more information, such as the last two
min=
utes 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
pro=
tocol, since its actually being used simply to transferring data from a
dat=
abase.<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">So the question is&#8230;. is what I&#8217;m doing
OK or does anyo=
ne think I should be doing it differently either for efficiency or best
pra=
ctice reasons ?<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">I&#8217;m slightly unsure of the hex encoding since it
would only =
be slightly longer to encode in decimal but would be much easier for the
cl=
ient to handle (i.e. no Hex to decimal conversion)<br>
<br>
<br>
<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">Also do I need to register &#8220;MJW&#8221; as an
official xAP ve=
ndor name?<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">Regards<o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span
lang=3D"EN-US">&nbsp;</span><o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><b><span
style=3D"font-size:10.0pt;color:#548DD4">Marcus
</span></b><o:p></o:p></p>
<p class=3D"MsoNormal"
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
</div>
</div>
</blockquote>
<p
class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span
style=3D"color:white"><o:p></o:p></span></p>
</div>
</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=3D4724/stime=3D1302016643" 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=
3oDMTJmMTNtczVzBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5=
BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzMDIwMTY2NDM-">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=
3oDMTJkOTVtaThkBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5=
BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMzAyMDE2NjQz">
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_38DB8F60848A594CBF1B5BE0732099781B17B645ex2MISCScom_--

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.