No - I do not think you can do arithmetic like that!!!!! The span goes from the current date, and it will return a max, min, average, sum - depending on what observation and aggregate you specify
You may be able to get more - but I do not think it will return more than a single value To get data for the previous year I believe you have to start doing Tom's method and actually write a search list extension to return the values you require. It all depends on precisely what you are trying to achieve, and why!! Old plots can be saved and inserted onto pages as required by the template engine, and reports can be run as and when required by using the cron task with a report date set as the parameter (see wee_reports documentation). You need to define exactly what you want and why and how often - and then either just provide the previous 365 day's data or whatever Also remember that the NOAA reports contain the monthly and annual data for previous months and years, and these are also not deleted by weewx. I generate my NOAA reports in html to make them look prettier when viewed through a browser - and the history page from the Bootstrap skin allows for a clear picture of temperatures and rain for previous months/years for comparison purposes - see http://cr.netflash.com.cy:61016/weewxweather/Bootstrap/history.html and http://dajda.net/history.html as examples On Thursday, 19 October 2017 06:07:14 UTC+3, Jesus Cea wrote: > On 18/10/17 16:08, Andrew Milner wrote: > > Or you can get the previous 365 days by using the $span with > > $year_delta=1 for a standard aggregation or max/min > > Great suggestion, Andrew. > > To obtain the data for the year before previous one, I could do > something like: > > $span($year_delta=2).rain - $span($year_delta=1).rain > > My question now is... How can I do basic arithmetic in the templates? > :-). I see some references like in > <https://github.com/weewx/weewx/blob/master/docs/customizing.htm#L1410> > but not a single example. > > Thanks!. > > -- > Jesús Cea Avión _/_/ _/_/_/ _/_/_/ > [email protected] <javascript:> - http://www.jcea.es/ _/_/ _/_/ _/_/ > _/_/ _/_/ > Twitter: @jcea _/_/ _/_/ _/_/_/_/_/ > jabber / [email protected] <javascript:> _/_/ _/_/ _/_/ > _/_/ _/_/ > "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ > "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ > "El amor es poner tu felicidad en la felicidad de otro" - Leibniz > > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
