<div dir="ltr">anyways off to have lunch @ my parents... will be home late afternoon/evening<div><br></div><div>everything is ready to go.. except for the import to emoncms part</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-30 9:54 GMT+02:00 Bo Herrmannsen <span dir="ltr"><<a href="mailto:bo.herrmannsen@gmail.com" target="_blank">bo.herrmannsen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">oki.... was going to use the java stuff but i know you are busy as hell and might not have time for this...<div><br></div><div>when is it most fitting that i start to pester you about it?</div><div><br></div><div>the format emoncms like are:</div><div><br></div><div><span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:13px;font-family:'Source Code Pro';color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">$url = 'http://********/emoncms/api/post?apikey=*******&node=$id&json={Temp:' . $temp . ',Light:' . $light . ',?:' . $gid . '}';</span></p><div><span style="font-size:13px;font-family:'Source Code Pro';color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></div><div><span style="font-size:13px;font-family:'Source Code Pro';color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">i have set node id to be same id as the units... makes it easy to know where the stats comes from... the above is just a crude example.... you can add as many variables you want</span></div></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-30 9:50 GMT+02:00 Damon Hart-Davis <span dir="ltr"><<a href="mailto:dhd@exnet.com" target="_blank">dhd@exnet.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Java server-side code parses the current format(s) as-is. If you change anything, especially the leading character, you will not be able to use any of that stuff. Plus of course you’ll be on your own maintaining your own code!<br>
<br>
Please note that the first character on each output line indicates the format of the rest of the line as things stand.<br>
<br>
Rgds<br>
<br>
Damon<br>
<br>
<br>
> On 30 May 2015, at 08:43, Bo Herrmannsen <<a href="mailto:bo.herrmannsen@gmail.com" target="_blank">bo.herrmannsen@gmail.com</a>> wrote:<br>
><br>
> something like this format is what i was trying to get:<br>
><br>
> ID:TEMP:LIGHT:VALVE:BATTERY<br>
><br>
> 2015-05-30 9:38 GMT+02:00 Damon Hart-Davis <<a href="mailto:dhd@exnet.com" target="_blank">dhd@exnet.com</a>>:<br>
><br>
> > On 30 May 2015, at 07:31, Bo Herrmannsen <<a href="mailto:bo.herrmannsen@gmail.com" target="_blank">bo.herrmannsen@gmail.com</a>> wrote:<br>
> ><br>
> > btw in what file are the non json output nade up? have an idea i want to try<br>
><br>
> They are converted to ASCII in Control.cpp for now, but those messages are populated from a structure, and have a particular on-wire format.<br>
><br>
> Rgds<br>
><br>
> Damon<br>
><br>
><br>
><br>
> // Look for binary-format message.<br>
> FullStatsMessageCore_t stats;<br>
> getLastCoreStats(&stats);<br>
> if(stats.containsID)<br>
> {<br>
> // Dump (remote) stats field '@<hexnodeID>;TnnCh[P;]'<br>
> // where the T field shows temperature in C with a hex digit after the binary point indicated by C<br>
> // and the optional P field indicates low power.<br>
> serialPrintAndFlush(LINE_START_CHAR_RSTATS);<br>
> serialPrintAndFlush((((uint16_t)stats.id0) << 8) | stats.id1, HEX);<br>
> if(stats.containsTempAndPower)<br>
> {<br>
> serialPrintAndFlush(F(";T"));<br>
> serialPrintAndFlush(stats.tempAndPower.tempC16 >> 4, DEC);<br>
> serialPrintAndFlush('C');<br>
> serialPrintAndFlush(stats.tempAndPower.tempC16 & 0xf, HEX);<br>
> if(stats.tempAndPower.powerLow) { serialPrintAndFlush(F(";P")); } // Insert power-low field if needed.<br>
> }<br>
> if(stats.containsAmbL)<br>
> {<br>
> serialPrintAndFlush(F(";L"));<br>
> serialPrintAndFlush(stats.ambL);<br>
> }<br>
> if(0 != stats.occ)<br>
> {<br>
> serialPrintAndFlush(F(";O"));<br>
> serialPrintAndFlush(stats.occ);<br>
> }<br>
> serialPrintlnAndFlush();<br>
> }<br>
> _______________________________________________<br>
> OpenTRV-dev mailing list<br>
> <a href="mailto:OpenTRV-dev@lists.opentrv.org.uk" target="_blank">OpenTRV-dev@lists.opentrv.org.uk</a><br>
> <a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
><br>
> _______________________________________________<br>
> OpenTRV-dev mailing list<br>
> <a href="mailto:OpenTRV-dev@lists.opentrv.org.uk" target="_blank">OpenTRV-dev@lists.opentrv.org.uk</a><br>
> <a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
<br>
_______________________________________________<br>
OpenTRV-dev mailing list<br>
<a href="mailto:OpenTRV-dev@lists.opentrv.org.uk" target="_blank">OpenTRV-dev@lists.opentrv.org.uk</a><br>
<a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div>