Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread gjr80
Yep, that is basically 'fileparse in a service'. You might want to bind to NEW_LOOP_PACKET rather than NEW_ARCHIVE_RECORD if you are using software record generation, that would give a 'truer' representation over an archive period. If you do then you need to change event.record to event.packet.

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Andrew Milner
just found that pond.py from the wiki does exactly what I need. Thanks for getting me past my mental block though On Friday, 11 August 2017 06:12:56 UTC+3, gjr80 wrote: > Of course, my mistake. Still easy enough, just a simple service run up > front in the process_services list to add your i

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread gjr80
Of course, my mistake. Still easy enough, just a simple service run up front in the process_services list to add your intemp to the loop packet as whatever field you want it to be stored in. The trickiest part will be making sure the units match the existing loop packet unit system. If using so

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Andrew Milner
Gary - I'll still be getting 90% of the data from the fine offset - so will need to use the fousb driver - just that there is an additional field for intemp sitting on the server to be added to the FO data somehow - at either the LOOP or the REC level - and I'll probably just use one of the exis

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread gjr80
> > Doh!! Helps to edit the correct file > Yes, have sufferred from this one myself on (a number of) occassion(s). What's the recommend3d way of adding data from a different source (my file) > into a REC?? > >From a file the best way would be to use the fileparse driver

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Andrew Milner
Doh!! Helps to edit the correct file Now I've got the right indoor temperature!! I'd moved my FineOffset console to a new position higher up the wall for better reception from the outdoor sensors, but the indoor temp was then 3 degrees too high as it's near the ceiling, so have had to res

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Andrew Milner
Gary Thanks for stepping in and letting Tom enjoy his break!! The missing $ was a posting typo. Blowed if I can work out why it refuses to work!! Andrew On Friday, 11 August 2017 05:08:34 UTC+3, gjr80 wrote: > Andrew, > > I know Tom has been enjoying the good weather... You are correct that

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread gjr80
Andrew, I know Tom has been enjoying the good weather... You are correct that each python line needs to start with #, "r" is the default so it will work with or without it. You will also need to put a $ in front of intemp, so something like: #set $fd = open("path to file", "r") #set $intemp =

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Andrew Milner
Tom I've got #set $fd = open("path to file", "r") #set intemp = $fd.readline() #$fd.close() should it work?? Not sure from your answer where # is needed and whether one just uses open or need to use open and specify the mode On Thursday, 10 August 2017 19:37:03 UTC+3, Tom Keffer wrote: > Su

Re: [weewx-user] add python code to template to read a file

2017-08-10 Thread Thomas Keffer
Super easy. #set $fd = open('myfile.txt) $fd.read() $fd.close() -tk On Thu, Aug 10, 2017 at 9:00 AM, Andrew Milner wrote: > I'm sure I can be done - but how?? I want to add some python code to a > template to read a data file when the html page is being created to > override a field currently