[OpenTRV-dev] stats outs

Bo Herrmannsen bo.herrmannsen at gmail.com
Mon Jun 1 10:19:19 BST 2015


have removed 1 panel from my solar import script... 2 mins and i know if we
can do this

2015-06-01 11:10 GMT+02:00 Bo Herrmannsen <bo.herrmannsen at gmail.com>:

> let me check... i think we can send the data one at a time
>
> 2015-06-01 11:02 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
>
>> Hi Bo,
>>
>> Do you think it would be possible to send the values through one at a
>> time, even if I happen to get them in groups, ie send power then temp then
>> whatever as separate HTTP calls?
>>
>> Not massively efficient, but might get something working.
>>
>> And what names should those values have for your case?
>>
>> Rgds
>>
>> Damon
>>
>>
>> > On 31 May 2015, at 12:03, Bo Herrmannsen <bo.herrmannsen at gmail.com>
>> wrote:
>> >
>> > one small catch... the driver have to buffer the data until it has
>> everything.... or emoncms will timestamp everything wrong and insert 0
>> where it does not get data
>> >
>> >
>> >
>> > 2015-05-31 12:49 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
>> > Maybe I’ll have a little time later today, if you’re around, to sketch
>> out a OEM driver for the Java stuff and we could even try to get the Java
>> server running.
>> >
>> > Rgds
>> >
>> > Damon
>> >
>> > > On 30 May 2015, at 09:49, Bo Herrmannsen <bo.herrmannsen at gmail.com>
>> wrote:
>> > >
>> > > anyways off to have lunch @ my parents... will be home late
>> afternoon/evening
>> > >
>> > > everything is ready to go.. except for the import to emoncms part
>> > >
>> > > 2015-05-30 9:54 GMT+02:00 Bo Herrmannsen <bo.herrmannsen at gmail.com>:
>> > > oki.... was going to use the java stuff but i know you are busy as
>> hell and might not have time for this...
>> > >
>> > > when is it most fitting that i start to pester you about it?
>> > >
>> > > the format emoncms like are:
>> > >
>> > > $url = 'http://********/emoncms/api/post?apikey=*******&node=$id&json={Temp:'
>> . $temp . ',Light:' . $light . ',?:' . $gid . '}';
>> > >
>> > > 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
>> > >
>> > > 2015-05-30 9:50 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
>> > > 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!
>> > >
>> > > Please note that the first character on each output line indicates
>> the format of the rest of the line as things stand.
>> > >
>> > > Rgds
>> > >
>> > > Damon
>> > >
>> > >
>> > > > On 30 May 2015, at 08:43, Bo Herrmannsen <bo.herrmannsen at gmail.com>
>> wrote:
>> > > >
>> > > > something like this format is what i was trying to get:
>> > > >
>> > > > ID:TEMP:LIGHT:VALVE:BATTERY
>> > > >
>> > > > 2015-05-30 9:38 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
>> > > >
>> > > > > On 30 May 2015, at 07:31, Bo Herrmannsen <
>> bo.herrmannsen at gmail.com> wrote:
>> > > > >
>> > > > > btw in what file are the non json output nade up? have an idea i
>> want to try
>> > > >
>> > > > 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.
>> > > >
>> > > > Rgds
>> > > >
>> > > > Damon
>> > > >
>> > > >
>> > > >
>> > > >     // Look for binary-format message.
>> > > >     FullStatsMessageCore_t stats;
>> > > >     getLastCoreStats(&stats);
>> > > >     if(stats.containsID)
>> > > >       {
>> > > >       // Dump (remote) stats field '@<hexnodeID>;TnnCh[P;]'
>> > > >       // where the T field shows temperature in C with a hex digit
>> after the binary point indicated by C
>> > > >       // and the optional P field indicates low power.
>> > > >       serialPrintAndFlush(LINE_START_CHAR_RSTATS);
>> > > >       serialPrintAndFlush((((uint16_t)stats.id0) << 8) | stats.id1,
>> HEX);
>> > > >       if(stats.containsTempAndPower)
>> > > >         {
>> > > >         serialPrintAndFlush(F(";T"));
>> > > >         serialPrintAndFlush(stats.tempAndPower.tempC16 >> 4, DEC);
>> > > >         serialPrintAndFlush('C');
>> > > >         serialPrintAndFlush(stats.tempAndPower.tempC16 & 0xf, HEX);
>> > > >         if(stats.tempAndPower.powerLow) {
>> serialPrintAndFlush(F(";P")); } // Insert power-low field if needed.
>> > > >         }
>> > > >       if(stats.containsAmbL)
>> > > >         {
>> > > >         serialPrintAndFlush(F(";L"));
>> > > >         serialPrintAndFlush(stats.ambL);
>> > > >         }
>> > > >       if(0 != stats.occ)
>> > > >         {
>> > > >         serialPrintAndFlush(F(";O"));
>> > > >         serialPrintAndFlush(stats.occ);
>> > > >         }
>> > > >       serialPrintlnAndFlush();
>> > > >     }
>> > > > _______________________________________________
>> > > > OpenTRV-dev mailing list
>> > > > OpenTRV-dev at lists.opentrv.org.uk
>> > > > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> > > >
>> > > > _______________________________________________
>> > > > OpenTRV-dev mailing list
>> > > > OpenTRV-dev at lists.opentrv.org.uk
>> > > > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> > >
>> > > _______________________________________________
>> > > OpenTRV-dev mailing list
>> > > OpenTRV-dev at lists.opentrv.org.uk
>> > > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> > >
>> > >
>> > > _______________________________________________
>> > > OpenTRV-dev mailing list
>> > > OpenTRV-dev at lists.opentrv.org.uk
>> > > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> >
>> > _______________________________________________
>> > OpenTRV-dev mailing list
>> > OpenTRV-dev at lists.opentrv.org.uk
>> > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> >
>> > _______________________________________________
>> > OpenTRV-dev mailing list
>> > OpenTRV-dev at lists.opentrv.org.uk
>> > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>
>> _______________________________________________
>> OpenTRV-dev mailing list
>> OpenTRV-dev at lists.opentrv.org.uk
>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opentrv.org.uk/pipermail/opentrv-dev/attachments/20150601/5ff3ff40/attachment-0001.html>


More information about the OpenTRV-dev mailing list