Issue with a report last values are Zero

155 views
Skip to first unread message

Hyrules

unread,
May 6, 2020, 11:16:55 AM5/6/20
to weewx-user
I have a report that generates results for the last 2 days in data. The report is scheduled to run every 15 minutes with a custom report_timing. Report is execting properly but the last value of the report is always zero

    [[HydroMeteoReport]]
        skin
= hydrometeo
        enable
= true
        HTML_ROOT
= /var/www/html/weewx/hydrometeo
        report_timing
= */15 * * * *

Weather station archive interval is 5 minutes.

Example :

06/05/20  7:45a    5.8    6.0    5.4    59   -1.5   1.1    NW   0.27   1.6    NW    5.8    5.8    3.9 1015.45  0.00   0.0    14.3     0.0   19.3    46    7.4   19.3   8.72 1.2087      0    7     99.9   15
06/05/20  8:00a    6.6    7.1    6.1    56   -1.5   0.0   N/A   0.00   0.0   N/A    6.6    6.6    4.7 1015.46  0.00   0.0    14.3     0.0   19.4    46    7.4   19.4   8.72 1.2084      0    7     97.9   15
06/05/20  8:15a    7.8    8.1    7.4    54   -1.0   0.0   N/A   0.00   0.0   N/A    7.8    7.8    5.8 1015.45  0.00   0.0    14.3     0.0   19.4    45    7.3   19.4   8.62 1.2081      0    7     99.9   15
06/05/20  8:30a    8.0    8.3    7.8    52   -1.2   2.7   WNW   0.67   4.8   WNW    8.0    8.0    6.1 1015.39  0.00   0.0    14.3     0.0   19.6    45    7.4   19.6   8.56 1.2073      0    7     99.9   15
06/05/20  8:45a    8.2    8.6    7.8    50   -1.5   2.7     E   0.67   3.2     W    8.2    8.2    6.3 1015.33  0.00   0.0    14.3     0.0   19.9    45    7.6   19.9   8.56 1.2061      0    7     99.9   15
06/05/20  9:00a    9.0    9.1    8.8    48   -1.6   2.1    NE   0.54   3.2   ENE    9.0    9.0    7.0 1015.31  0.00   0.0    14.3     0.0   19.9    45    7.6   19.9   8.56 1.2061      0    7     98.9   15
06/05/20  9:15a    9.1    9.3    9.0    48   -1.4   1.1    NE   0.27   1.6   ENE    9.1    9.1    7.2 1015.14  0.00   0.0    14.3     0.0   20.1    44    7.6   20.1   8.45 1.2051      0    7     98.9   15
06/05/20  9:30a    9.9   10.0    9.8    46   -1.2   0.5   NNE   0.13   1.6   NNE    9.9    9.9    8.0 1015.02  0.00   0.0    14.3     0.0   20.0    44    7.4   20.0   8.40 1.2053      0    7     98.9   15
06/05/20  9:45a    9.7    9.7    9.6    46   -1.4   0.0   N/A   0.00   0.0   N/A    9.7    9.7    7.7 1014.99  0.00   0.0    14.3     0.0   20.0    44    7.4   20.0   8.40 1.2053      0    7     99.9   15
06/05/20 10:00a    9.8    9.8    9.8    45   -1.6   0.5     E   0.13   1.6     E    9.8    9.8    7.9 1014.77  0.00   0.0    14.3     0.0   20.0    44    7.4   20.0   8.40 1.2050      0    7     99.9   15
06/05/20 10:15a   10.0   10.2    9.8    45   -1.5   0.0   N/A   0.00   0.0   N/A   10.0   10.0    8.1 1014.66  0.00   0.0    14.3     0.0   20.0    44    7.4   20.0   8.40 1.2049      0    7     99.9   15
06/05/20 10:30a   10.1   10.3    9.9    43   -1.8   2.7   WNW   0.67   3.2    NW   10.1   10.1    8.2 1014.57  0.00   0.0    14.3     0.0   20.0    44    7.4   20.0   8.40 1.2048      0    7     99.9   15
06/05/20 10:45a    0.0    0.0    0.0   0.0    0.0   0.0   N/A   0.00   0.0   N/A    0.0    0.0    0.0     N/A  0.00   0.0    14.3     0.0    0.0   N/A    0.0    0.0   0.00 0.0000      0    7      0.0   15

Those values are mixed kind of values. avg max min sum for rain. but mostly avg.

I was wondering if this might be a bug with weewx or a misunderstanding in my part. If I execute the report a few minutes later the value is populated.

Tom Keffer

unread,
May 6, 2020, 11:56:35 AM5/6/20
to weewx-user
I have no idea what I'm looking at, what time this report was run, what the report is, nor how to reproduce it. 

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/20d610d8-5ef6-4225-8f6a-808bc70e8650%40googlegroups.com.

Hyrules

unread,
May 6, 2020, 12:06:07 PM5/6/20
to weewx-user
You are right can read my mind :

Here is the report :

#errorCatcher Echo
#import weewx.uwxutils as utils
#import user.weathercalc as wc
#set $D="%d/%m/%y"
#set $Time="%I:%M%p"
#set $N50f="%5.0f"
#set $N51f="%5.1f"
#set $N52f="%5.2f"
#set $NONE0F="0"
#set $NONE1F="0.0"
#set $NA="N/A"
#set $NONE2F="0.00"
#set $NONE3F="0.000"
#def formatTime($raw):
#from datetime import datetime
#echo $datetime.fromtimestamp($raw).strftime("%-I:%M%p").lower().rstrip('m').rjust(6)
#end def
                 
Temp     Hi    Low   Out    Dew  Wind  Wind   Wind    Hi    Hi   Wind   Heat    THW                Rain    Heat    Cool    In     In    In     In     In   In Air  Wind  Wind    ISS   Arc.
 
Date    Time     Out   Temp   Temp   Hum    Pt. Speed   Dir    Run Speed   Dir  Chill  Index  Index   Bar    Rain  Rate    D-D     D-D    Temp   Hum    Dew   Heat    EMC Density  Samp   Tx   Recept  Int.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#for $_span in $last2days
$_span
.start.format($D) #slurp ## DATE
$self
.formatTime($_span.start.raw) #slurp ## TIME
$_span
.outTemp.avg.nolabel($N51f,$NONE1F).rjust(6) #slurp ## TEMP OUT
$_span
.outTemp.max.nolabel($N51f,$NONE1F).rjust(6) #slurp ## HI TEMP
$_span
.outTemp.min.nolabel($N51f,$NONE1F).rjust(6) #slurp ## LOW TEMP
$_span
.outHumidity.avg.nolabel($N50f,$NONE1F).rjust(5) #slurp ## OUT HUM
$_span
.dewpoint.avg.nolabel($N51f,$NONE1F).rjust(6) #slurp ## DEW PT.
$_span
.windSpeed.avg.nolabel($N51f,$NONE1F).rjust(5) #slurp ## WIND SPEED
$_span
.windDir.avg.ordinal_compass.format(None_string="---").rjust(5) #slurp ## WIND DIR
$_span
.windrun.sum.nolabel($N52f,$NONE2F).rjust(6) #slurp ## WIND RUN
$_span
.windSpeed.max.nolabel($N51f,$NONE1F).rjust(5) #slurp ## HI SPEED
$_span
.windDir.max.ordinal_compass.format(None_string="---").rjust(5) #slurp ## HI DIR
$_span
.windchill.avg.nolabel($N51f,$NONE1F).rjust(6) #slurp ## WIND CHILL
$_span
.heatindex.avg.nolabel($N51f,$NONE1F).rjust(6) #slurp ## HEAT INDEX
$wc
.CalculateTHWIndex($_span.heatIndex.avg.raw,$span.windSpeed.avg.raw).rjust(6) #slurp ## THW INDEX
$_span
.barometer.avg.nolabel($N52f).rjust(7) #slurp ## BAR
$_span
.rain.sum.nolabel($N52f,$NONE2F).rjust(5) #slurp ## RAIN
$_span
.rainRate.avg.nolabel($N51f,$NONE1F).rjust(5) #slurp ## RAIN RATE
$_span
.heatdeg.avg.nolabel($N51f,$NONE1F).rjust(7) #slurp ## HEAT D-D
$_span
.cooldeg.avg.nolabel($N51f,$NONE1F).rjust(7) #slurp ## COOL D-D
$_span
.inTemp.avg.nolabel($N51f,$NONE1F).rjust(6) #slurp ## IN TEMP
$_span
.inHumidity.avg.nolabel($N50f,$NA).rjust(5) #slurp ##IN HUM
$wc
.CalculateDewPoint($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN DEW
$wc
.CalculateHeatIndex($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN HEAT
$wc
.CalculateEMC($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN EMC
$wc
.CalculateAirDensity($_span.inTemp.avg.raw,$_span.pressure.avg.raw).rjust(6) #slurp ## IN AIR DENSITY
     
0 #slurp ## WIND SAMPLES
   
7 #slurp ## TRANSMITTER ID
$_span
.rxCheckPercent.last.nolabel($N51f,$NONE1F).rjust(8) #slurp ## IIS RECEPTION QUALITY
 
15 ## ARCHIVE INTERVAL
#end for

This is my python file that generates the $last2days :

from __future__ import with_statement
from importlib import reload

import datetime
import time
import calendar
import json
import os
import os.path
import syslog
import sys
import locale

import weewx
import weecfg
import configobj
import weedb
import weeutil.weeutil
import weewx.reportengine
import weewx.station
import weewx.units
import weewx.tags
import weewx.uwxutils

from collections import OrderedDict

from weewx.cheetahgenerator import SearchList
from weewx.tags import TimespanBinder
from weeutil.weeutil import to_bool, TimeSpan, to_int, archiveDaySpan, archiveWeekSpan, archiveMonthSpan, archiveYearSpan, startOfDay, timestamp_to_string, option_as_list
try:
   from weeutil.config import search_up
except:
   # Pass here because chances are we have an old version of weewx which will get caught below.
    pass
   
# Check weewx version. Many things like search_up, weeutil.weeutil.KeyDict (label_dict) are from 3.9
if weewx.__version__ < "3.9":
   raise weewx.UnsupportedFeature("weewx 3.9 and newer is required, found %s" % weewx.__version__)    

def logmsg(level, msg):
   syslog.syslog(level, 'Hydrometeo Extension: %s' % msg)

def logdbg(msg):
   logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
   logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
   logmsg(syslog.LOG_ERR, msg)

# Print version in syslog for easier troubleshooting
VERSION = "0.1"
loginf("version %s" % VERSION)

class ExtraStats(SearchList):
   def __init__(self, generator):
       SearchList.__init__(self, generator)

    def get_extension_list(self, timespan, db_lookup):

        alltime = TimespanBinder(timespan, db_lookup, formatter=self.generator.formatter, converter=self.generator.converter, skin_dict= self.generator.skin_dict)

        last2days = self.make_download_data(1, db_lookup)
       last7days = self.make_download_data(7, db_lookup)
       search_list_extension = {'last2days' : last2days,
                                'last7days' : last7days,
                                'alltime' : alltime}

        return [search_list_extension]

    def make_download_data(self, numberofdays, db_lookup):
       ts_end = datetime.datetime.now()
       ts_start = datetime.datetime.now() - datetime.timedelta(days=numberofdays)
       ts_start = ts_start.replace(hour=00, minute=15, second=00,microsecond=00)

        tsb = TimespanBinder(TimeSpan(time.mktime(ts_start.timetuple()), time.mktime(ts_end.timetuple())), db_lookup,formatter=self.generator.formatter, converter=self.generator.converter, skin_dict= self.generator.skin_dict)
       spans = tsb.spans(interval=900)
       return spans




To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
Message has been deleted

Tom Keffer

unread,
May 6, 2020, 12:27:49 PM5/6/20
to weewx-user
At first glance, I'd say this is an "off-by-one" problem, but there's way too much for me to debug. It's also as a screenshot, so I can't even look at it in an editor. Sorry.

I would suggest running it with a good debugger, or using lots of print() statements, to figure out where its getting its values.

This code generates last2days

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/973a62ae-07c2-4719-9a9f-a3a6fd790aea%40googlegroups.com.

hyr...@gmail.com

unread,
May 6, 2020, 12:32:31 PM5/6/20
to weewx...@googlegroups.com

Roger that. What would be the best way for me to debug this ? Do you have a setup to recommend. It’s been my main issue debugging this python in Weewx. Since my knowledge lacks in debugging a linux environment I`ve been looking mostly at the logs of weewx but surely you must have some kind of setup or debugger you can attach to the process and see variables and do a step by step ?

 

Thank.

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/MFnpwI8sGNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEDzDBetcyTH30OCjkSV1Y45_See0dDwxonf5gzBWh97qg%40mail.gmail.com.

Tom Keffer

unread,
May 6, 2020, 12:34:53 PM5/6/20
to weewx-user
Personally, I use PyCharm, but it's probably overkill for what you need. Just sprinkle print() statements in your code and make sure it's getting the values you think it should.

-tk

hyr...@gmail.com

unread,
May 6, 2020, 12:38:17 PM5/6/20
to weewx...@googlegroups.com

PyCharm why didn’t think of that IDE. I know jetbrains I`ve used their tools like Resharper for C#.

 

Thanks.

Tom Keffer

unread,
May 6, 2020, 12:39:38 PM5/6/20
to weewx-user
Then you should feel right at home. PyCharm is extremely powerful.

gjr80

unread,
May 6, 2020, 2:48:08 PM5/6/20
to weewx-user
Hi,

I would hazard a guess and say your issue is using datetime.datetime.now() in your search list extension. That time is being used as your stop/end time for the report and is (roughly) the time the report is run. This will be after the current (and last) record in the archive. So when the report is run anything in the last row that relies on the last record will be 0 or None.

I would try using timespan.stop instead. This will give you the actual timestamp if the last/current archive record as the end point.

I am always wary of using the current system time in a SLE.

But I could be wrong...

Gary

hyr...@gmail.com

unread,
May 6, 2020, 3:09:05 PM5/6/20
to weewx...@googlegroups.com
Interesting Gary. Makes a lot of sense. I will try that and let you know what happens. Thanks for your input

-----Original Message-----
From: weewx...@googlegroups.com <weewx...@googlegroups.com> On Behalf Of gjr80
Sent: May 6, 2020 14:48
To: weewx-user <weewx...@googlegroups.com>
Subject: Re: [weewx-user] Issue with a report last values are Zero

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/MFnpwI8sGNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/5c3a1c36-479e-4cb6-94eb-f8f0bf533e98%40googlegroups.com.

Hyrules

unread,
May 6, 2020, 7:48:55 PM5/6/20
to weewx-user
Indeed Gary was right. for example checked my last record was 1588808400 report wanted to show 1588808700 so over the last record on a record the indeed does not exists. Will fix that thanks again gentlemens for your input.


On Wednesday, May 6, 2020 at 3:09:05 PM UTC-4, Hyrules wrote:
Interesting Gary. Makes a lot of sense. I will try that and let you know what happens. Thanks for your input

-----Original Message-----
From: weewx...@googlegroups.com <weewx...@googlegroups.com> On Behalf Of gjr80
Sent: May 6, 2020 14:48
To: weewx-user <weewx...@googlegroups.com>
Subject: Re: [weewx-user] Issue with a report last values are Zero

Hi,

I would hazard a guess and say your issue is using datetime.datetime.now() in your search list extension. That time is being used as your stop/end time for the report and is (roughly) the time the report is run. This will be after the current (and last) record in the archive. So when the report is run anything in the last row that relies on the last record will be 0 or None.

I would try using timespan.stop instead. This will give you the actual timestamp if the last/current archive record as the end point.

I am always wary of using the current system time in a SLE.

But I could be wrong...

Gary

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/MFnpwI8sGNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Hyrules

unread,
May 7, 2020, 8:58:11 AM5/7/20
to weewx-user
When Weewx generates the reports the last archive in the database should be the time the report is generated right ? Well for the following case : Report generates every 15 minutes but the archive interval is 5. Trying to understand how weewx handle archives and reports.

Hyrules

unread,
May 7, 2020, 7:06:52 PM5/7/20
to weewx-user
There is definitely something I don't understand here. Run the report every 15 minutes with archive interval of 5 minutes the latest 15th minute value is not there when Weewx generates the report automatically. Check the database... archive value of the lastest 15 is there. If I run wee_report 1 minute later I get my line in my report. Print my timespan in the syslog or on screen, the timespan seems to be ok. For example if my timespan is from 00:15 today to 19:00 today I only get 00:15 to 18:45... in incremets of 15 minutes. I have added the skin and the python files if anyone should feel willing to try. I will continue on my side to try to find what is happening. The script is really not complicated. The skin folder should go in the skin folder and the user should go in weewx user folder. thanks.

skin.zip

gjr80

unread,
May 7, 2020, 10:46:11 PM5/7/20
to weewx-user
I have taken you skin/code and run under WeeWX v4/python2/simulator. I am not seeing anything unusual but then again I am not 100% certain on what it is that you are believe is not working. Perhaps you could illustrate with some (abbreviated) actual output captures?

Assuming the issue is the final row in downld02.txt and downld08.txt. The final few (abbreviated) rows from downld02.txt generated during the 1225 report cycle are:

08/05/20 11:45a    0.0    0.0    0.0   0.0    0.0   0.0
08/05/20 12:00p    0.3    0.4    0.3    80   -2.7   0.0
08/05/20 12:15p    0.1    0.2   -0.0    80   -2.9   0.0

After the 1230 report cycle it looked like:

08/05/20 11:45a    0.0    0.0    0.0   0.0    0.0   0.0
08/05/20 12:00p    0.3    0.4    0.3    80   -2.7   0.0
08/05/20 12:15p    0.1    0.2   -0.0    80   -2.9   0.0

and after the 1235 report cycle this:

08/05/20 11:45a    0.0    0.0    0.0   0.0    0.0   0.0
08/05/20 12:00p    0.3    0.4    0.3    80   -2.7   0.0
08/05/20 12:15p    0.1    0.2   -0.0    80   -2.9   0.0
08/05/20 12:30p   -0.1   -0.1   -0.1    80   -3.2   0.0

To me this is all expected output. The final 15 minute span on the 1225 and 1230 report cycles is from 1215-1230. In the 1235 report cycle the final span is from 1230-1245. The 1230 archive record belongs in 1215-1230 span so since you are printing the start date-time of the span as the first column of your report the 1225 and 1230 reports quite correctly have '08/05/20 12:15p' as the date-time for the last row. It is not until the 1235 report cycle that '08/05/20 12:30p' shows and its sole data point will be from the 1235 archive record.

As I said I am not certain what problem you are seeing but at present I do not see anything that is not correct.

Gary

Hyrules

unread,
May 8, 2020, 7:06:21 AM5/8/20
to weewx-user
Actually your input was just what I needed to figure it out Gary. Like you said I was using the start time when I wanted the end time. Thus instead of forcing things to start at 12:15 all I needed was to use the end time of the span instead.  With a span of 15 minutes, the end time of the span is the 12:15 when the days start a midnight for the first span and the closest 15th minute when outputting the last span. That way i'm always on time in the report with automatically generated reports.

Thanks again.

Hyrules

unread,
May 8, 2020, 2:33:17 PM5/8/20
to weewx-user
Oh an by the way : On the latest release page on the latest release itself on github instructions are pointing to the github page with the code and not the page itself.

mwall

unread,
May 8, 2020, 2:42:03 PM5/8/20
to weewx-user


On Friday, May 8, 2020 at 2:33:17 PM UTC-4, Hyrules wrote:
Oh an by the way : On the latest release page on the latest release itself on github instructions are pointing to the github page with the code and not the page itself.

i just fixed the release page on github.com.  links to the installation instructions now point to weewx.com, not to the htm files in the weewx distribution. 

Hyrules

unread,
May 10, 2020, 12:34:51 PM5/10/20
to weewx-user
Thanks.

More on the skin i'm working on :

I was reading the weewx customization guide and found I can specify the StringFormats of my units in my skin.conf. So technically when I generate a report with the cheetah engine in my skin the string should format itself to the format I have specified in the skin.conf file right ?

Because at the moment the formatting applied in my skin is the defaut one of the weewx.conf. Am I missing something here ?

Skin.conf :

[Unit]
   [[Groups]]
       group_altitude     = meter                # Options are 'foot' or 'meter'
       group_degree_day   = degree_C_day         # Options are 'degree_F_day' or 'degree_C_day'
       group_direction    = degree_compass
       group_distance     = km                   # Options are 'mile' or 'km'
       group_moisture     = centibar
       group_percent      = percent
       group_pressure     = hPa                  # Options are 'inHg', 'mmHg', 'mbar', or 'hPa'
       group_radiation    = watt_per_meter_squared
       group_rain         = mm                   # Options are 'inch', 'cm', or 'mm'
       group_rainrate     = mm_per_hour          # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
       group_speed        = km_per_hour          # Options are 'mile_per_hour', 'km_per_hour', 'knot', or 'meter_per_second'
       group_speed2       = km_per_hour2         # Options are 'mile_per_hour2', 'km_per_hour2', 'knot2', or 'meter_per_second2'
       group_temperature  = degree_C             # Options are 'degree_F' or 'degree_C'
       group_uv           = uv_index
       group_volt         = volt

    [[StringFormats]]
       NONE                = "---"
       degree_C            = %.2f
       percent             = %.1f
       km_per_hour         = %.1f
       km_per_hour2        = %.1f
       km                  = %.2f
       mm_per_hour         = %.1f
       mm                  = %.2f
       meter_per_second    = %.1f
       hPa                 = %.1f
       mile_per_hour       = %.1f

    [[Ordinates]]
       # The ordinal directions. The last one should be for no wind direction
       directions = N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, ---

[CheetahGenerator]
   encoding = utf8
   search_list_extensions = user.extrastats.ExtraStats

    [[NOAA_PRYR]]
       encoding = strict_ascii
       template = NOAAPRYR.TXT.tmpl

    [[NOAA_YR]]
       encoding = strict_ascii
       template = NOAAYR.TXT.tmpl

    [[NOAA_PRMO]]
       encoding = strict_ascii
       template = NOAAPRMO.TXT.tmpl

    [[NOAA_MO]]
       encoding = strict_ascii
       template = NOAAMO.TXT.tmpl

    [[Downld02]]
       template = downld02.txt.tmpl

    [[Downld08]]
       template = downld08.txt.tmpl

    [[Xml]]
       template = xml.xml.tmpl

    [[Current]]
       template = current.htm.tmpl

[Generators]
       # The list of generators that are to be run:
       generator_list = weewx.cheetahgenerator.CheetahGenerator, weewx.reportengine.FtpGenerator

Report :

#errorCatcher Echo
#import weewx.uwxutils as utils
#import user.weathercalc as wc
#set $D="%d/%m/%y"
#set $Time="%I:%M%p"
#def formatTime($raw):
#from datetime import datetime
#echo $datetime.fromtimestamp($raw).strftime("%-I:%M%p").lower().rstrip('m').rjust(6)
#end def
                 Temp     Hi    Low   Out    Dew  Wind  Wind   Wind    Hi    Hi   Wind   Heat    THW                Rain    Heat    Cool    In     In    In     In     In   In Air  Wind  Wind    ISS   Arc.
 Date    Time     Out   Temp   Temp   Hum    Pt. Speed   Dir    Run Speed   Dir  Chill  Index  Index   Bar    Rain  Rate    D-D     D-D    Temp   Hum    Dew   Heat    EMC Density  Samp   Tx   Recept  Int.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#for $_span in $last2days
$_span.end.format($D) #slurp ## DATE
$self.formatTime($_span.end.raw) #slurp ## TIME
$_span.outTemp.avg.format(add_label=False).rjust(6) #slurp ## TEMP OUT
$_span.outTemp.max.format(add_label=False).rjust(6) #slurp ## HI TEMP
$_span.outTemp.min.format(add_label=False).rjust(6) #slurp ## LOW TEMP
$_span.outHumidity.avg.format(add_label=False).rjust(5) #slurp ## OUT HUM
$_span.dewpoint.avg.format(add_label=False).rjust(6) #slurp ## DEW PT.
$_span.windSpeed.avg.format(format_string="%.1f",add_label=False).rjust(5) #slurp ## WIND SPEED
$_span.windDir.avg.ordinal_compass.rjust(5) #slurp ## WIND DIR
$_span.windrun.sum.format(add_label=False).rjust(6) #slurp ## WIND RUN
$_span.windSpeed.max.format(format_string="%.1f",add_label=False).rjust(5) #slurp ## HI SPEED
$_span.windDir.max.ordinal_compass.rjust(5) #slurp ## HI DIR
$_span.windchill.avg.format(add_label=False).rjust(6) #slurp ## WIND CHILL
$_span.heatindex.avg.format(add_label=False).rjust(6) #slurp ## HEAT INDEX
$wc.CalculateTHWIndex($_span.heatIndex.avg.raw,$span.windSpeed.avg.raw).rjust(6) #slurp ## THW INDEX
$_span.barometer.avg.format(add_label=False).rjust(7) #slurp ## BAR
$_span.rain.sum.format(add_label=False).rjust(5) #slurp ## RAIN
$_span.rainRate.avg.format(add_label=False).rjust(5) #slurp ## RAIN RATE
$_span.heatdeg.avg.format(add_label=False).rjust(7) #slurp ## HEAT D-D
$_span.cooldeg.avg.format(add_label=False).rjust(7) #slurp ## COOL D-D
$_span.inTemp.avg.format(add_label=False).rjust(6) #slurp ## IN TEMP
$_span.inHumidity.avg.format(add_label=False).rjust(5) #slurp ##IN HUM
$wc.CalculateDewPoint($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN DEW
$wc.CalculateHeatIndex($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN HEAT
$wc.CalculateEMC($_span.inTemp.avg.raw,$_span.inHumidity.avg.raw).rjust(6) #slurp ## IN EMC
$wc.CalculateAirDensity($_span.inTemp.avg.raw,$_span.barometer.avg.raw).rjust(6) #slurp ## IN AIR DENSITY
    0 #slurp ## WIND SAMPLES
  7 #slurp ## TRANSMITTER ID
$_span.rxCheckPercent.avg.format(format_string="%.1f",add_label=False).rjust(8) #slurp ## IIS RECEPTION QUALITY
 15 ## ARCHIVE INTERVAL
#end for

Output :

                  Temp     Hi    Low   Out    Dew  Wind  Wind   Wind    Hi    Hi   Wind   Heat    THW                Rain    Heat    Cool    In     In    In     In     In   In Air  Wind  Wind    ISS   Arc.
 
Date    Time     Out   Temp   Temp   Hum    Pt. Speed   Dir    Run Speed   Dir  Chill  Index  Index   Bar    Rain  Rate    D-D     D-D    Temp   Hum    Dew   Heat    EMC Density  Samp   Tx   Recept  Int.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

09/05/20 12:15a    1.2    1.2    1.1    55   -6.9   5.4    NW    1.3   6.4    NW    0.5    1.2   31.8  1008.1   0.0   0.0    16.6     0.0   19.9    45    7.6   19.9   8.56 1.2067      0    7     92.0   15
09/05/20 12:30a    1.1    1.1    1.1    53   -7.3   5.4    NW    1.3   6.4    NW    0.4    1.1   31.6  1008.2   0.0   0.0    16.6     0.0   19.8    45    7.5   19.8   8.56 1.2072      0    7     99.9   15
09/05/20 12:45a    0.9    1.0    0.9    53   -7.6   4.8    NW    1.2   4.8    NW    0.9    0.9   31.3  1008.2   0.0   0.0    16.6     0.0   19.8    45    7.5   19.8   8.56 1.2075      0    7     99.9   15
09/05/20  1:00a    0.8    0.8    0.8    53   -7.7   5.4    NW    1.3   6.4    NW    0.2    0.8   31.1  1008.2   0.0   0.0    16.6     0.0   19.7    45    7.5   19.7   8.56 1.2076      0    7     88.8   15
09/05/20  1:15a    0.8    0.8    0.8    52   -8.0   6.4    NW    1.6   6.4    NW   -1.3    0.8   31.0  1008.3   0.0   0.0    16.6     0.0   19.6    45    7.3   19.6   8.56 1.2082      0    7     99.9   15
09/05/20  1:30a    0.7    0.8    0.7    51   -8.2   6.4    NW    1.6   6.4    NW   -1.3    0.7   31.0  1008.4   0.0   0.0    16.6     0.0   19.5    45    7.3   19.5   8.57 1.2086      0    7     95.0   15
09/05/20  1:45a    0.6    0.7    0.6    51   -8.3   7.5    NW    1.9   8.0    NW   -1.8    0.6   30.8  1008.3   0.0   0.0    16.6     0.0   19.5    45    7.3   19.5   8.57 1.2086      0    7     86.2   15
09/05/20  2:00a    0.5    0.6    0.5    50   -8.7   8.6    NW    2.1   9.7    NW   -2.3    0.5   30.6  1008.4   0.0   0.0    16.6     0.0   19.5    45    7.2   19.5   8.57 1.2090      0    7     99.9   15
09/05/20  2:15a    0.4    0.4    0.3    50   -8.8   6.4    NW    1.6   8.0    NW   -1.2    0.4   30.3  1008.5   0.0   0.0    16.6     0.0   19.4    45    7.2   19.4   8.57 1.2093      0    7     99.6   15
09/05/20  2:30a    0.4    0.4    0.3    50   -8.8   8.6    NW    2.1   9.7    NW   -2.4    0.4   30.3  1008.5   0.0   0.0    16.6     0.0   19.3    45    7.1   19.3   8.57 1.2096      0    7     99.9   15
09/05/20  2:45a    0.3    0.3    0.2    51   -8.7   8.6    NW    2.1   9.7    NW   -2.6    0.3   30.1  1008.5   0.0   0.0    16.6     0.0   19.3    45    7.0   19.3   8.57 1.2098      0    7     99.9   15
09/05/20  3:00a    0.1    0.2   -0.1    52   -8.5   3.8    NW    0.9   6.4    NW   -0.7    0.1   29.7  1008.5   0.0   0.0    16.6     0.0   19.2    45    7.0   19.2   8.57 1.2100      0    7     99.2   15

Thanks.

Tom Keffer

unread,
May 10, 2020, 12:49:51 PM5/10/20
to weewx-user
You just didn't read the right section! 

Options in weewx.conf override options in skin.conf. See the section How options work in the Customizing Guide.

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9fb36d12-a36c-4e7d-93ba-1dc94bab233a%40googlegroups.com.

Hyrules

unread,
May 10, 2020, 1:17:07 PM5/10/20
to weewx-user
ok I understand now how this works thanks.
Reply all
Reply to author
Forward
0 new messages