[OpenTRV-dev] stats outs

Damon Hart-Davis dhd at exnet.com
Fri May 29 21:52:51 BST 2015


Don’t try and write a JSON parser by hand, there will be lots of free ones that you can use.

The JSON stats are in the form of a JSON object or map, ie a set of key-value pairs.  Most values are numeric, the ID is a string.

battery is in millivolts,
T temperature in 16ths of C, tT is target temperature in whole C
vC is *cumulative* movement, v is current valve position


> On 29 May 2015, at 21:40, Bo Herrmannsen <bo.herrmannsen at gmail.com> wrote:
> 
> oki, will try tomorrow.... for simplicity sake can you tell how i look for:
> 
> Battery -  I assume i go for B|mV and then the number that follows
> Temp - guess but T|C and then the number directly after C
> Valve Open - vC|% and the number before C ?
> Light - :350 ?
> 
> 2015-05-29 22:35 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
> If there are too many values to fit in one frame then available values are rotated through the output, attempting to show changed values as soon as possible.
> 
> You have to parse as a JSON map and pick out the values you want, when they are sent.
> 
> Rgds
> 
> Damon
> 
> 
> > On 29 May 2015, at 21:24, Bo Herrmannsen <bo.herrmannsen at gmail.com> wrote:
> >
> > hmm
> >
> > one of the nodes does not display the valve open all the time
> >
> > {"@":"0950","+":2,"B|mV":2771,"T|C16":350,"O":1}
> >
> >
> > then some lines later:
> >
> > {"@":"0950","+":1,"v|%":0,"tT|C":15,"vC|%":0}
> >
> >
> > are there a cartain way the JASON is build so i can make the script match?
> >
> > 2015-05-29 22:22 GMT+02:00 Damon Hart-Davis <dhd at exnet.com>:
> > Valve open % is only in the JSON stats (starting with ‘{‘), yes.
> >
> > Rgds
> >
> > Damon
> >
> >
> > > On 29 May 2015, at 20:39, Bo Herrmannsen <bo.herrmannsen at gmail.com> wrote:
> > >
> > > also i might tackle this the wrong way... i want to log also the valve open % and for that i need to look at the json data i get right?
> >
> > _______________________________________________
> > 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



More information about the OpenTRV-dev mailing list