Re: [weewx-user] Re: Error since upgrade from 3.9.2 to 4.0.0

2020-05-13 Thread gjr80

On Thursday, 14 May 2020 08:17:07 UTC+10, Tom Keffer wrote:
>
> Yes, that could do it. I'm surprised that worked in V3.9. Use this instead
>
> $day.rain.sum.nolabel("%.2f","0.0")
>

Been thinking about this too as it puzzled me. I note there are a number of 
$hour tags in the template. I have found that $hour tags can be susceptible 
to returning (seemingly) unexpected None values if you are missing a full 
(top of the hour to top of the hour) of data in the day concerned. I am 
wondering that since the 0.0 is the value used if the tag is None, perhaps 
it was an $hour tag that threw the error, the 0.0 in a $day tag will sit 
there quite happily until the $day tag returns a None and there is probably 
less chance of this happening, the changeover from 3.9.2 to 4.0.0 could 
easily have resulted in an hour devoid of data. Also, since the error is 
non-fatal if it did show up under 3.9.2 it would be easily missed unless 
your are paying attention to the logs.

Gary

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/defb1234-6f22-4f3a-aa9c-ff4ffb757bbf%40googlegroups.com.


Re: [weewx-user] Re: Error since upgrade from 3.9.2 to 4.0.0

2020-05-13 Thread Tom Keffer
Commit 09e64e5

guards
against this in the future.

On Wed, May 13, 2020 at 3:16 PM Tom Keffer  wrote:

> Yes, that could do it. I'm surprised that worked in V3.9. Use this instead
>
> $day.rain.sum.nolabel("%.2f","0.0")
>
>
>
> On Wed, May 13, 2020 at 1:39 PM Russell van vlack 
> wrote:
>
>> Is it a line like this that's causing the issue?  Not necessarily that
>> line in particular, but as an example. Just thinking from my small
>> programming background and seeing the comment on "float".
>>
>> $day.rain.sum.nolabel("%.2f",0.0)
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/89e2f17f-e7aa-4fc0-a7cb-ba923400b293%40googlegroups.com
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEB%2BnT88CLaRx21YQDyX78Lw9_1tkjP8BuummgBsMvPdkw%40mail.gmail.com.


Re: [weewx-user] Re: Error since upgrade from 3.9.2 to 4.0.0

2020-05-13 Thread Tom Keffer
Yes, that could do it. I'm surprised that worked in V3.9. Use this instead

$day.rain.sum.nolabel("%.2f","0.0")



On Wed, May 13, 2020 at 1:39 PM Russell van vlack 
wrote:

> Is it a line like this that's causing the issue?  Not necessarily that
> line in particular, but as an example. Just thinking from my small
> programming background and seeing the comment on "float".
>
> $day.rain.sum.nolabel("%.2f",0.0)
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/89e2f17f-e7aa-4fc0-a7cb-ba923400b293%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECbfz3tu3A2x4-2o1uNkE4xvwK6GUdSewmfoyV4eWu6Eg%40mail.gmail.com.


[weewx-user] Re: Error since upgrade from 3.9.2 to 4.0.0

2020-05-13 Thread Russell van vlack
Is it a line like this that's causing the issue?  Not necessarily that line 
in particular, but as an example. Just thinking from my small programming 
background and seeing the comment on "float".

$day.rain.sum.nolabel("%.2f",0.0)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/89e2f17f-e7aa-4fc0-a7cb-ba923400b293%40googlegroups.com.


[weewx-user] Re: Error since upgrade from 3.9.2 to 4.0.0

2020-05-13 Thread Russell van vlack
Looks like I ran up against a line limit.  Attached as plain text.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/c8288dfb-5933-462f-b1f9-d10f1e009269%40googlegroups.com.
{
  "detail": {
"timestamp": "$current.dateTime.format("%m/%d/%Y %H:%M")",
"station": "$station.location",
"lat": "$station.latitude[0] $station.latitude[1]' 
$station.latitude[2]",
"lon": "$station.longitude[0] $station.longitude[1]' 
$station.longitude[2]",
"el": "$station.altitude",
"hw": "$station.hardware",
"weev": "v$station.version",
"weeup": "$station.uptime",
"osup": "$station.os_uptime"
  },
  "almanac": {
#if $almanac.hasExtras
  #set $sun_altitude = $almanac.sun.alt
  #if $sun_altitude < 0
#set $sun_None="(Always down)"
  #else
#set $sun_None="(Always up)"
  #end if
  "hasextended": 1,
  "twilight": {
"start": "$almanac(horizon=-6).sun(use_center=1).rise",
"end": "$almanac(horizon=-6).sun(use_center=1).set"
  },
  "sun": {
"rise": "$almanac.sun.rise.string($sun_None)",
"transit": "$almanac.sun.transit",
"set": "$almanac.sun.set.string($sun_None)"
  },
  "moon": {
"rise": "$almanac.moon.rise",
"transit": "$almanac.moon.transit",
"set": "$almanac.moon.set",
"phase": "$almanac.moon_phase",
"full": "$almanac.moon_fullness",
"nextEvents": {
  "nextNew": "$almanac.next_new_moon.format("%m/%d/%Y %H:%M")",
  "nextFull": "$almanac.next_full_moon.format("%m/%d/%Y %H:%M")"
}
  },
  "other": {
"solstice": "$almanac.next_solstice.format("%m/%d/%Y %H:%M")",
"equinox": "$almanac.next_equinox.format("%m/%d/%Y %H:%M")",
"sun_alt": "$almanac.sun.alt",
"sun_az": "$almanac.sun.az",
"sun_size": "$almanac.sun.size",
"moon_alt": "$almanac.moon.alt",
"moon_az": "$almanac.moon.az",
"moon_size": "$almanac.moon.size",
"sun_moon_separation": "$almanac.separation(($almanac.sun.az, 
$almanac.sun.alt), ($almanac.moon.az, $almanac.moon.alt))"

  }
#else
  "hasextended": 0,
  "sun": {
"rise": "$almanac.sunrise",
"set": "$almanac.sunset"
  },
  "moon": {
"phase": "$almanac.moon_phase ($almanac.moon_fullness% full)"
  }
#end if
  },
  "current": {
"otemp": $current.outTemp.formatted,
"otemptest": $current.outTemp.format(None_string="'N/A'", add_label=False),
"otemptrend": $trend.outTemp.formatted,
"otemptrendtest": $trend.outTemp.format(None_string="'N/A'", 
add_label=False),
"ochill": $current.windchill.formatted,
"ochilltrend": $trend.windchill.formatted,
"oheat": $current.heatindex.formatted,
"oheattrend": $trend.heatindex.formatted,
"odew": $current.dewpoint.formatted,
"odewtrend": $trend.dewpoint.formatted,
"orh": $current.outHumidity.formatted,
"orhtrend": $trend.outHumidity.formatted,
"bar": $current.barometer.formatted,
"bartrend": $trend.barometer.formatted,
"wspeed": $current.windSpeed.formatted,
"wspeedtrend": $trend.windSpeed.formatted,
"wdeg": "$current.windDir.formatted",
"wdir": "$current.windDir.ordinal_compass",
"wgust": $current.windGust.formatted,
"wgusttrend": $trend.windGust.formatted,
"wgustdeg": "$current.windGustDir.formatted",
"wgustdir": "$current.windGustDir.ordinal_compass",
"rainrate": $current.rainRate.formatted,
"rainratetrend": $trend.rainRate.formatted,
#if $day.radiation.has_data
"sr": $current.radiation.formatted,
"srtrend": $trend.radiation.formatted,
#end if
"itemp": $current.inTemp.formatted,
"itemptrend": $trend.inTemp.formatted,
"irh": $current.inHumidity.formatted,
"irhtrend": $trend.inHumidity.formatted
  },
  "summary": {
"h1": {
  "otemp": [
{
  "v": $hour.outTemp.max.formatted,
  "t": "$hour.outTemp.maxtime.format("%H:%M")"
},{
  "v": $hour.outTemp.min.formatted,
  "t": "$hour.outTemp.mintime.format("%H:%M")"
},{
  "v": $hour.outTemp.avg.formatted
}
  ],
  "oheat": [
{
  "v": $hour.heatindex.max.formatted,
  "t": "$hour.heatindex.maxtime.format("%H:%M")"
},{
  "v": $hour.heatindex.min.formatted,
  "t": "$hour.heatindex.mintime.format("%H:%M")"
},{
  "v": $hour.heatindex.avg.formatted
}
  ],
  "ochill": [
{
  "v": $hour.windchill.max.formatted,
  "t": "$hour.windchill.maxtime.format("%H:%M")"
},{
  "v": $hour.windchill.min.formatted,
  "t": "$hour.windchill.mintime.format("%H:%M")"