[weewx-user] Re: Cydia pomonella

2017-09-23 Thread Andrew Milner
I got intrigued by this, but also got nowhere!!  NOAA reports report 
heating and cooling days, which I think are probably using a base 
temperature of 65F.  I cannot find however where the base temperature is 
set up, or even how the NOAA template manages to evaluate tags such as 
day.heatdegree.sum (or something like that) which I see being used in the 
template.

Baffled and also now eager for an explanation/better description from Tom 
and the gang.  I suspect however that if the base temperature could be 
set/adjusted a modified NOAA report would provide the detail you require.  
However, even then I do not see how one can graph a reading evaluated for 
the NOAA reports.  There must, surely, be a way - but like you, I remain 
baffled and awaiting someone else's input to this fascinating thread.



On Sunday, 24 September 2017 07:28:02 UTC+3, crh...@lacusveris.com wrote:

> That's codling moth, the worm in the apple.  I have a decade-old backyard 
> orchard and have built up a sustaining population of these buggers.  Next 
> year I'm going to get serious about hunting them down -- every one of them.
>
> To this end, I put up a new Ambient WS2095 weather station and installed 
> *weewx* on my Linux desktop, which does not run unattended.  So far, so 
> good.  I see nominal, continuous temp stats being logged.
>
> My goal this winter is to learn to graph cumulative degree days, which I 
> will use next summer to predict with uncanny accuracy (so they say) the 
> very day that most C. pomonella larva are hatching.  That is the day I will 
> attack.
>
> Now it occurs to me this is not an unreasonable or unusual goal.  I wonder 
> if anyone else has done this and can show me how without my having to 
> re-invent the wheel.
>
> I see hints in the *weewx* User's Guide that degree-day, degree_day, 
> degreeday, and heating-day calculations are possible, but these don't seem 
> to be implemented.  I'm guessing they may be implemented in the *xstats* 
> extension, but I'm not finding any such variable names there.  (I may not 
> be searching correctly or even searching in the right place.)
>
> Thanks for any suggestions.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Cydia pomonella

2017-09-23 Thread crhode
That's codling moth, the worm in the apple.  I have a decade-old backyard 
orchard and have built up a sustaining population of these buggers.  Next 
year I'm going to get serious about hunting them down -- every one of them.

To this end, I put up a new Ambient WS2095 weather station and installed 
*weewx* on my Linux desktop, which does not run unattended.  So far, so 
good.  I see nominal, continuous temp stats being logged.

My goal this winter is to learn to graph cumulative degree days, which I 
will use next summer to predict with uncanny accuracy (so they say) the 
very day that most C. pomonella larva are hatching.  That is the day I will 
attack.

Now it occurs to me this is not an unreasonable or unusual goal.  I wonder 
if anyone else has done this and can show me how without my having to 
re-invent the wheel.

I see hints in the *weewx* User's Guide that degree-day, degree_day, 
degreeday, and heating-day calculations are possible, but these don't seem 
to be implemented.  I'm guessing they may be implemented in the *xstats* 
extension, but I'm not finding any such variable names there.  (I may not 
be searching correctly or even searching in the right place.)

Thanks for any suggestions.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread Paul Oversmith
Thanks so much for the quick response.  I felt it was something I missed in 
the setup.
Changes made.  Need the next thunderstorm to make sure it is working.

Also thanks for the suggestion on LightningDistance.  I changed the field 
to REAL.

On Saturday, September 23, 2017 at 7:03:21 PM UTC-4, mwall wrote:
>
>
>
> On Saturday, September 23, 2017 at 5:40:05 PM UTC-4, Paul Oversmith wrote:
>>
>> I am having a real problem with the graph for lightning strikes using an 
>> Acurite 6045 lighting detector and the weewx-sdr driver.
>>
>> The total number of strikes and distance reports correctly, the strikes 
>> (delta) is not right (the strike are reported as .02 to .06 rather than an 
>> integer count, please see attached image).  
>> I have put monitors in the _calculate_delta(label, newtotal, oldtotal) 
>> routine and the values for newtotal and oldtotal are correct and show a 
>> difference of 1 when there is a strike.
>>
>> I tried several different setup options, but none fixed the situation.  I 
>> suspect it has something to do with the time frame and the averaging of 
>> strikes over an interval rather than just reporting the quality,
>>
>> But I am at a loss to see what I have setup incorrectly.
>>
>> Hope someone has a suggestion to fix the problem.
>>
>
> paul,
>
> thank you for the detailed problem description.  you need to set the 
> accumulator for the lightning database field.  as of weewx 3.7, you can do 
> this in the weewx configuration file, like this:
>
> [Accumulator]
>
> [[LightningStrikes]]
> extractor = sum
>
> [[LightningStrikesTotal]]
> extractor = sum
>
> you probably want 'REAL' instead of 'INTEGER' for the 'LightningDistance' 
> field (that will require re-creating the database, or manually modifying 
> the schema in sql)
>
> m
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread Clay Jackson
Ah, thanks for the clarification!   

Sent from my iPhone
Clay Jackson


> On Sep 23, 2017, at 5:44 PM, mwall  wrote:
> 
>> On Saturday, September 23, 2017 at 7:11:55 PM UTC-4, Clay Jackson wrote:
>> I'm having the same issue - and just caught the FLOAT vs INTEGER problem.   
>> Don't understand the accumulator piece, shouldn't that be default?
> 
> the accumulator determines how values will be aggregated over time periods.  
> for example, observations such as rain are treated differently than 
> observations such as temperature.
> 
> when you add a new field to the database, you typically have to specify a few 
> things:
> 
> - the database type, e.g., 'INTEGER'
> - the unit group
> - the accumulator behavior
> 
> right now each of these is done in a different place - the type is in the 
> schema as python code (typically user/schema.py or user/extensions.py), the 
> unit group is in python code (typically user/extensions.py), and the 
> accumulator behavior is in weewx configuration file.
> 
> it might make sense to put all these things together, for example completely 
> in the weewx configuration file.
> 
> however, such a system has not yet been designed.
> 
> m
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] New location for custom generators

2017-09-23 Thread gjr80
Hi,

FWIW having seen your code I don't think you will have too many issues (if 
any at all). All of the skin.conf stuff is still very much the same as it 
was; besides you are only really feeding your generator with config 
settings (that your generator decodes) and calling your generator. True, 
there have been many changes to reportengine.py but most of this has been 
'further up the tree' in StdReportEngine (eg enhanced logging, better 
control of when reports are run etc), the running of the generators is 
still very much the same as it was previously.

Best to suck it and see, I don't think you will be too far off the mark.

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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread mwall
On Saturday, September 23, 2017 at 7:11:55 PM UTC-4, Clay Jackson wrote:
>
> I'm having the same issue - and just caught the FLOAT vs INTEGER problem. 
>   Don't understand the accumulator piece, shouldn't that be default?
>

the accumulator determines how values will be aggregated over time periods. 
 for example, observations such as rain are treated differently than 
observations such as temperature.

when you add a new field to the database, you typically have to specify a 
few things:

- the database type, e.g., 'INTEGER'
- the unit group
- the accumulator behavior

right now each of these is done in a different place - the type is in the 
schema as python code (typically user/schema.py or user/extensions.py), the 
unit group is in python code (typically user/extensions.py), and the 
accumulator behavior is in weewx configuration file.

it might make sense to put all these things together, for example 
completely in the weewx configuration file.

however, such a system has not yet been designed.

m

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread Clay Jackson
I'm having the same issue - and just caught the FLOAT vs INTEGER problem.   
Don't understand the accumulator piece, shouldn't that be default?

Sent from my iPhone
Clay Jackson


> On Sep 23, 2017, at 2:40 PM, Paul Oversmith  wrote:
> 
> I am having a real problem with the graph for lightning strikes using an 
> Acurite 6045 lighting detector and the weewx-sdr driver.
> 
> The total number of strikes and distance reports correctly, the strikes 
> (delta) is not right (the strike are reported as .02 to .06 rather than an 
> integer count, please see attached image).  
> I have put monitors in the _calculate_delta(label, newtotal, oldtotal) 
> routine and the values for newtotal and oldtotal are correct and show a 
> difference of 1 when there is a strike.
> 
> I tried several different setup options, but none fixed the situation.  I 
> suspect it has something to do with the time frame and the averaging of 
> strikes over an interval rather than just reporting the quality,
> 
> But I am at a loss to see what I have setup incorrectly.
> 
> Hope someone has a suggestion to fix the problem.
> 
> My setup:
> 
> Schemia:
> 
> # AcuRite Lightning 
>('OutTempBalcony', 'REAL'),
>('OutHumidityBalcony', 'REAL'),
>('LightningStrikes',   'INTEGER'),
>('LightningStrikesTotal',  'INTEGER'),
>('LightningDistance',  'INTEGER'),
> 
> Acurite.conf (a seperate instants and database; I also have a Davis Pro):
> 
> [SDR]
> driver = user.sdr
> cmd = /usr/local/bin/rtl_433 -q -U -F json -R40 -R41
> log_unknown_sensors = False
> log_unmapped_sensors = True
> 
> OutTempBalcony = temperature.E76F.AcuriteLightningPacket
> OutHumidityBalcony = humidity.E76F.AcuriteLightningPacket
> LightningStrikes = strikes.E76F.AcuriteLightningPacket
> LightningStrikesTotal = strikes_total.E76F.AcuriteLightningPacket
> LightningDistance = distance.E76F.AcuriteLightningPacket
> 
> [[deltas]]
> LightningStrikes = LightningStrikesTotal
> 
> Skin configuration [Image Generator]:
> 
> [[[dayLightningStrikes]]]
> LightningStrikes
>   plot_type = bar
>   color = 0x4242b4
>   label = Lightning Strikes
> [[[dayLightningDistance]]]
>   plot_type = bar
>   yscale =0, 50, 5
>   color = 0x4242b4
>   LightningDistance
>   Label = 'Storm Head Distance'
>   
> Skin.tmpl:
> 
> 
>   Lighting Strikes(Last Hour)
>   
> class='popup'>$hour($hours_ago=1).LightningStrikes.sum
>   
>   
>#if ($day.LightningStrikes.sum.formatted == "0")
>0
>0
>#else
>%p')'>$day.LightningStrikes.sum
>%p')'>$day.LightningDistance.min
> #end if
>   
>
> strikesmiles 
>   
>   Storm Head(Last Hour)
>   
> #if ($day.LightningStrikes.sum.formatted == "0")
> 0
>#else
>  class='popup'>$hour($hours_ago=1).LightningDistance.min
> #end if
>   
>   
>   miles
>   
>   Lighting StrikeCount
>   
> class='popup'>$current.LightningStrikesTotal
>   
>   Last StormHead Distance
>   
>  class='popup'>$current.LightningDistance.formatted
>   
>   miles
>  
> 
> Units.py:
> 
> bs_group_dict = ListOfDicts({"altitude"   : "group_altitude",
> 
>   "TempFreezer": "group_temperature",
>   "LightningStrikes"   : "group_count",
>   "LightningStrikesTotal"  : "group_count",
>   "LightningDistance"  : "group_distance",
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread mwall


On Saturday, September 23, 2017 at 5:40:05 PM UTC-4, Paul Oversmith wrote:
>
> I am having a real problem with the graph for lightning strikes using an 
> Acurite 6045 lighting detector and the weewx-sdr driver.
>
> The total number of strikes and distance reports correctly, the strikes 
> (delta) is not right (the strike are reported as .02 to .06 rather than an 
> integer count, please see attached image).  
> I have put monitors in the _calculate_delta(label, newtotal, oldtotal) 
> routine and the values for newtotal and oldtotal are correct and show a 
> difference of 1 when there is a strike.
>
> I tried several different setup options, but none fixed the situation.  I 
> suspect it has something to do with the time frame and the averaging of 
> strikes over an interval rather than just reporting the quality,
>
> But I am at a loss to see what I have setup incorrectly.
>
> Hope someone has a suggestion to fix the problem.
>

paul,

thank you for the detailed problem description.  you need to set the 
accumulator for the lightning database field.  as of weewx 3.7, you can do 
this in the weewx configuration file, like this:

[Accumulator]

[[LightningStrikes]]
extractor = sum

[[LightningStrikesTotal]]
extractor = sum

you probably want 'REAL' instead of 'INTEGER' for the 'LightningDistance' 
field (that will require re-creating the database, or manually modifying 
the schema in sql)

m

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Lightning Strikes on weewx-sdr Issue

2017-09-23 Thread Paul Oversmith
I am having a real problem with the graph for lightning strikes using an 
Acurite 6045 lighting detector and the weewx-sdr driver.

The total number of strikes and distance reports correctly, the strikes 
(delta) is not right (the strike are reported as .02 to .06 rather than an 
integer count, please see attached image).  
I have put monitors in the _calculate_delta(label, newtotal, oldtotal) 
routine and the values for newtotal and oldtotal are correct and show a 
difference of 1 when there is a strike.

I tried several different setup options, but none fixed the situation.  I 
suspect it has something to do with the time frame and the averaging of 
strikes over an interval rather than just reporting the quality,

But I am at a loss to see what I have setup incorrectly.

Hope someone has a suggestion to fix the problem.

My setup:

Schemia:

# AcuRite Lightning 
   ('OutTempBalcony', 'REAL'),
   ('OutHumidityBalcony', 'REAL'),
   ('LightningStrikes',   'INTEGER'),
   ('LightningStrikesTotal',  'INTEGER'),
   ('LightningDistance',  'INTEGER'),

Acurite.conf (a seperate instants and database; I also have a Davis Pro):

[SDR]
driver = user.sdr
cmd = /usr/local/bin/rtl_433 -q -U -F json -R40 -R41
log_unknown_sensors = False
log_unmapped_sensors = True

OutTempBalcony = temperature.E76F.AcuriteLightningPacket
OutHumidityBalcony = humidity.E76F.AcuriteLightningPacket
LightningStrikes = strikes.E76F.AcuriteLightningPacket
LightningStrikesTotal = strikes_total.E76F.AcuriteLightningPacket
LightningDistance = distance.E76F.AcuriteLightningPacket

[[deltas]]
LightningStrikes = LightningStrikesTotal

Skin configuration [Image Generator]:

[[[dayLightningStrikes]]]
LightningStrikes
  plot_type = bar
  color = 0x4242b4
  label = Lightning Strikes
[[[dayLightningDistance]]]
  plot_type = bar
  yscale =0, 50, 5
  color = 0x4242b4
  LightningDistance
  Label = 'Storm Head Distance'
  
Skin.tmpl:


  Lighting Strikes(Last Hour)
  
   $hour($hours_ago=1).LightningStrikes.sum
  
  
   #if ($day.LightningStrikes.sum.formatted == "0")
   0
   0
   #else
  $day.LightningStrikes.sum
  $day.LightningDistance.min
#end if
  
   
strikesmiles 
  
  Storm Head(Last Hour)
  
#if ($day.LightningStrikes.sum.formatted == "0")
0
   #else
$hour($hours_ago=1).LightningDistance.min
#end if
  
  
  miles
  
  Lighting StrikeCount
  
   $current.LightningStrikesTotal
  
  Last StormHead Distance
  
$current.LightningDistance.formatted
  
  miles
 

Units.py:

bs_group_dict = ListOfDicts({"altitude"   : "group_altitude",

  "TempFreezer": 
"group_temperature",
  "LightningStrikes"   : "group_count",
  "LightningStrikesTotal"  : "group_count",
  "LightningDistance"  : "group_distance",

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] New location for custom generators

2017-09-23 Thread Joe Percival
and, here is the original skin configuration file with urls, ports, and 
passwords redacted:


#   
   
#
#   
   
#
#  Snapshots SKIN CONFIGURATION 
FILE   #
#   
   
#
#   
   
#

#   
   
#
#Copyright (c) 2010 Joe Percival 
   #
#   
   
#
#  See the file LICENSE.txt for your full 
rights.  #
#   
   
#

#
#$Revision: 1 $
#$Author: jpercival $
#$Date: 2011-01-15  $
#

HTML_ROOT=public_html/snapshots
[Extras]
cam_lable_font_path = 
/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf
ptz_cam_lable_font_size = 25
fixed_cam_lable_font_size = 12
[[ptzcams]]
[[[ptzcamA]]]
preseturl=preseturl to access first camera presets
imgurl = url to access first camera images
presets
[ps1]
number = 2
caption = Snow Pole
snap = 1
[ps2]
number = 3
caption = Snow Pole Wide
snap = 1
 [ps3]
number = 4
caption = Kenshaw
snap = 1
[ps4]
number = 5
caption = Driveway
snap = 1
[ps5]
number = 6
caption = Weather Station
snap = 1
[[[ptzcamB]]]
preseturl=url to access 2nd camera presets
imgurl = url to access 2nd camera images
presets
[ps1]
number = 1
caption = Driveway to Street Wide
snap = 1
[ps2]
number = 2
caption = Driveway to Street Closer
snap = 1
 [ps3]
number = 3
caption = Driveway to Street Close
snap = 1
[ps4]
number = 4
caption = Lot Next Door
snap = 1
[ps5]
number = 5
caption = Back Yard
snap = 1
[ps6]
number = 6
caption = Side Yard
snap = 1

[[fixedcams]]
chanurl=another camera url
imgurl = another camera image url
[[[cameras]]]
#  cam1
#port = 0
#  cam2
#port = 1
#  cam3
#port = 2


#
# The list of generators that are to be run:
#
[Generators]
generator_list = weewx.cameragenerator.CameraGenerator
#weewx.filegenerator.FileGenerator, 
weewx.imagegenerator.ImageGenerator, weewx.reportengine.CopyGenerator


On Saturday, September 23, 2017 at 10:08:53 AM UTC-7, Joe Percival wrote:
>
> and here is the complete listing of the custom generator code:
>
> # -*- coding: utf-8 -*-
> import Image, ImageFont, ImageDraw, urllib, urllib2, time
> import os, weewx.reportengine
>
> #===
> #Class ImageGenerator
>
> #===
>
> class CameraGenerator(weewx.reportengine.ReportGenerator):
> """Class for managing the cam image generator."""
>
> def run(self):
># localpath  = 
> os.path.join(self.config_dict['Station']['WEEWX_ROOT'],self.skin_dict['HTML_ROOT'])
> fontpath = self.skin_dict['Extras']['cam_lable_font_path']
> ptzfontsize = 
> int(self.skin_dict['Extras']['ptz_cam_lable_font_size'])
> for ptzcam 

Re: [weewx-user] New location for custom generators

2017-09-23 Thread Joe Percival
and here is the complete listing of the custom generator code:

# -*- coding: utf-8 -*-
import Image, ImageFont, ImageDraw, urllib, urllib2, time
import os, weewx.reportengine
#===
#Class ImageGenerator
#===

class CameraGenerator(weewx.reportengine.ReportGenerator):
"""Class for managing the cam image generator."""

def run(self):
   # localpath  = 
os.path.join(self.config_dict['Station']['WEEWX_ROOT'],self.skin_dict['HTML_ROOT'])
fontpath = self.skin_dict['Extras']['cam_lable_font_path']
ptzfontsize = 
int(self.skin_dict['Extras']['ptz_cam_lable_font_size'])
for ptzcam in self.skin_dict['Extras']['ptzcams'].keys():
localpath = 
os.path.join(self.config_dict['Station']['WEEWX_ROOT'],self.skin_dict['HTML_ROOT'],ptzcam)
camdef = self.skin_dict['Extras']['ptzcams'][ptzcam]
preseturl=camdef['preseturl']
imgurl = camdef['imgurl']
for preset in camdef['presets'].keys():
psdef = camdef['presets'][preset]
psNum = int(psdef['number']) # API says add 256 to the 
preset number for the url
urlNum = psNum + 256
psCaption = psdef['caption']
psSnap = int(psdef['snap'])
moveurl = preseturl+str(urlNum) #the complete move to 
preset url
tries = 0
moved = False
while tries < 3:
tries += 1
try:
mov = urllib.urlopen(moveurl) #tell the camera to 
move to the preset location
if mov.read().find('OK')>-1:
moved = True
mov.close() #close the link
break
except:
print "Unexpected error moving camera:"
time.sleep(5.0)
if not moved:
mov.close() #close the link
continue
time.sleep(17.0) #wait for a few seconds for the camera to 
move
if psSnap==1: #if a snapshot is called for on the 
preset   
tries = 0
while tries < 3:
local = open(localpath+str(psNum) + '.jpg','wb') 
#open a file for the image
tries += 1
try:
local.write(urllib.urlopen(imgurl).read()) 
#download the snapshot image into the file
local.close()
except:
local.close()
os.remove(localpath+str(psNum) + '.jpg')
time.sleep(5.0)
continue
if os.path.getsize(localpath+str(psNum) + '.jpg')>0:
try:
outImage = 
Image.open(localpath+str(psNum)+'.jpg')
draw = ImageDraw.Draw(outImage)

font=ImageFont.truetype(fontpath,ptzfontsize)
timestr = time.strftime('%a, %m/%d/%y at 
%I:%M %p %Z',time.localtime(time.time()))
draw.rectangle([0,0,1280,30],(0,0,0,10))
draw.text((5,5),psCaption +' updated on 
'+timestr,font=font)
outImage.save(localpath+str(psNum)+'.jpg')
break
except:
print 'error with camera image and PIL'
os.remove(localpath+str(psNum) + '.jpg')
time.sleep(5.0)
continue
else:
if tries == 3:
os.remove(localpath+str(psNum) + '.jpg')
break
time.sleep(5.0)


chanurl = self.skin_dict['Extras']['fixedcams']['chanurl']
imgurl = self.skin_dict['Extras']['fixedcams']['imgurl']
localpath  = 
os.path.join(self.config_dict['Station']['WEEWX_ROOT'],self.skin_dict['HTML_ROOT'],'cam')
for fixedcam in 
self.skin_dict['Extras']['fixedcams']['cameras'].keys():
camdef = 
self.skin_dict['Extras']['fixedcams']['cameras'][fixedcam]
port=int(camdef['port'])
urlchan = chanurl+str(port)
tries = 0
while tries <= 3:
tries += 1
try:
chan = urllib.urlopen(urlchan)
break
except IOError as (errno, strerror):
print "I/O error({0}): 

Re: [weewx-user] New location for custom generators

2017-09-23 Thread Joe Percival
First, an explanation...
I'm adding a report that downloads images from webcams, manipulates them, 
and copies them to a local file.  An FTP report then sends them to a 
specific location on my remote web server.
The skin for this custom report includes a configuration file but does not 
use a template file.  The skin configuration file contains a set of 
parameters used by the custom generator to find, manipulate, and store the 
images locally.
The custom generator is a highly modified (like completely) version of the 
original ImageGenerator.

Here is what I have now and what I understand needs to change...

In the old weewx.conf:
[Reports]
[[CameraSnapshots]]
skin=snapshots

In the new weewx.conf:
[StdReport]
 [[CameraSnapshots]]
  skin=snapshots

In the old skins/snapshots/skin.conf:

[Generators]
generator_list = weewx.cameragenerator.CameraGenerator
#weewx.filegenerator.FileGenerator, 
weewx.imagegenerator.ImageGenerator, weewx.reportengine.CopyGenerator

In the new skins/snapshots/skin.conf:

[Generators]
generator_list = user.cameragenerator.CameraGenerator
#weewx.filegenerator.FileGenerator, 
weewx.imagegenerator.ImageGenerator, weewx.reportengine.CopyGenerator

in the old bin/weewx/cameragenerator.py:
import Image, ImageFont, ImageDraw, urllib, urllib2, time
import os, weewx.reportengine
#===
#Class CameraGenerator
#===

class CameraGenerator(weewx.reportengine.ReportGenerator):
"""Class for managing the cam image generator."""

In the new user/cameragenerator.py:
import Image, ImageFont, ImageDraw, urllib, urllib2, time
import os, weewx.reportengine
#===
#Class CameraGenerator
#===

class CameraGenerator(weewx.reportengine.ReportGenerator):
"""Class for managing the cam image generator."""

Is that the right place to start?
Thanks,
joe

On Friday, September 22, 2017 at 5:31:18 PM UTC-7, Tom Keffer wrote:
>
> It should go in bin/user.
>
> -tk
>
> On Fri, Sep 22, 2017 at 5:26 PM, Joe Percival  > wrote:
>
>> Actually the most important first question I have is regarding the custom 
>> generator location bin/weewx or do I need to move it to bin/user?
>>
>> --
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx not starting after reboot (manual intervention necessary)

2017-09-23 Thread Dave Harper


On Friday, September 22, 2017 at 11:42:32 PM UTC-5, Andrew Milner wrote:
>
> I think it has started when wifi network was up rather than Ethernet 
> network.  Did you set wait for network in raspi-config - which is the RPi 
> method of ensuring network is available while booting.
>
>>
>> Thanks for the suggestion - I was unaware of this option.  However, I 
tried it (independently from the suggestion Tom made) and for some reason 
it didn't work (which surprised me as it sounded like an obvious solution). 
 Looking at the syslog after the boot showed almost exactly the same 
situation as shown in the syslog1 file I attached in the original post - 
weewx still started up before networking was up.  After the boot I went 
back in to raspi-config and verified that it was set to wait and it was. 
 As for wifi, that is turned off.  The Pi is physically located next to the 
Vantage Pro2 console which already required wired Ethernet for uploading so 
I went wired for the Pi too.

Dave 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WeeWX, is daylight?

2017-09-23 Thread Thomas Keffer
No, there isn't, but it's a good idea.

I've opened Issue #276  to
discuss.

-tk

On Sat, Sep 23, 2017 at 4:43 AM, Antony K. 
wrote:

> Is there someway with an extra tag so the weeWX can return 1 if it is
> daylight or 0 if it is night using current time, sunrise and sunset?
>
> $current.isDaylight -> True or False.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx not starting after reboot (manual intervention necessary)

2017-09-23 Thread Dave Harper


On Friday, September 22, 2017 at 9:25:58 PM UTC-5, Tom Keffer wrote:
>
> Sorry. The WLIP logger is a common nickname for the Davis "WeatherLink IP 
> logger".  Like this 
> .
>
>
I'm officially embarrassed - apparently I was more tired last night than I 
realized. Before calling it a night I decided to Google "Vantage logger" 
and realized my mistake about the time your followup post arrived (and yes, 
that's what I have).  My first thought had been "Hmmm... must be some type 
of Linux logging tool I'm not familiar with".  Anyway, this morning I made 
the modification you suggested and it worked perfectly.  Upon reboot, the 
connection still could not be opened, however this time the error message 
was replaced with one that said it was waiting 60 seconds and would try 
again.  The second time around, it connected with no problems.  Many thanks 
for your help on resolving this.

Dave

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Wind Gust N/A

2017-09-23 Thread Thomas Keffer
Make sure you put ignore_zero_wind in the right location. Your
configuration file should look like:

[StdWXCalculate]

ignore_zero_wind = false
[[Calculations]]
.
.
.

Another option is that .format() can take an argument containing what you
want when the value is None. See the Customizing Guide
.

$current.windGust.format("%f", 0)

-tk

On Fri, Sep 22, 2017 at 10:54 PM, Nicolas Cazan 
wrote:

> Hello, I try to display in wewwx_pws the max burst between two recordings,
> so I use:
>
>
> $current.windGust.formatted
>
> This seems to work, but I'm trying to also get the direction of this burst
> so I use:
>
> $
> current.windGustDir.formatted
> $current.windGustDir.ordinal_
> compass
>
>
> Also it seems to work, except that sometimes windhel when returning a
> value like 25 km/h windheuredir returns N/A
>
> I already modified ignore_zero_wind = False, but still the same problem.
>
> then I circumvent this problem?
>
> thank you in advance
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Intermittent dew point data to Wunderground

2017-09-23 Thread mwall
On Friday, September 22, 2017 at 11:50:23 PM UTC-4, Patrick Boyle wrote:
>
> I should add I'm running weewx on a version of Slackware (unRAID) 
> installed via the python script. My station is an Acurite 5 in 1.
>
>>
>>
whoops!  i am a bit behind here (having some network issues). 

acurite stations emit partial packets - the R2 data contains outTemp and 
outHumidity.  so if the console has a dodgey connection to the sensor 
cluster, you will only see dewpoint when the R2 data gets to weewx.

do you ever see temperature and humidity but no dewpoint?

as gary pointed out, using rapidfire can introduce its own problems

m

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Radar images

2017-09-23 Thread zkab
I can't find any radar images - 
like https://radar.weather.gov/ridge/lite/N0R/AKQ_loop.gif - for my area, 
which is Stockholm, Sweden.
I tested with following (skin.conf) and it works OK:

radar_img = https://radar.weather.gov/ridge/lite/N0R/AKQ_loop.gif
radar_url = 
https://www.yr.no/nb/kart/radar/2-2704620/Sverige/Stockholm/Huddinge%20Kommun/Huddinge

So the problem is to find the radar_img for Stockholm ...

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] WeeWX, is daylight?

2017-09-23 Thread Antony K.
Is there someway with an extra tag so the weeWX can return 1 if it is 
daylight or 0 if it is night using current time, sunrise and sunset?

$current.isDaylight -> True or False.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Intermittent dew point data to Wunderground

2017-09-23 Thread mwall
On Friday, September 22, 2017 at 11:48:05 PM UTC-4, Patrick Boyle wrote:
>
>
> Hello, new weewx user here. Loving it so far. It's working perfecty with 
> one exception. When looking at my station on wunderground I see extremely 
> intermittent dew point data, as in there are hours of time between little 
> blips of data. However, looking at the console I can see a dew point value 
> being reported regularly. How should I go about troubleshooting this?
>

patrick,

what kind of weather station?

what version of weewx?

have you made any modifications to the StdWXCalculate section in the weewx 
configuration file?

m

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Bootstrap extra gauges problem

2017-09-23 Thread Antony K.
I want to add 2 more gauges to display Solar and UV radiation so I have 
inserted the following:

[[radiation]] 
minvalue = 0 
maxvalue = 1800 
majorstep = 50 
minorstep = 25
history = 24 
bins = 50

[[UV]] 
minvalue = 0 
maxvalue = 16 
majorstep = 5 
minorstep = 1
digitformat = %d
history = 24 
bins = 50


and the result is that the extra gauges are not created.

Isn't this strange?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Gauges resolution and quality

2017-09-23 Thread Antony K.
The problem was the anti-alias parameter, which didn't work with the 
fuzzy-archer version 2.2

I installed version 2.24 and everything is fine.


Thank you very much!

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Unable to disable logging?

2017-09-23 Thread Phil Green
Ok thanks Andrew. I did have a system lockup shortly before and had to restart 
the pi and was unsure whether this was causing problems. 
Normally I don’t look at the log as everything works ok. 
Thanks
Phil

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: One shot 'Daily Summaries' using php.

2017-09-23 Thread Glenn McKechnie
On 23 September 2017 at 09:59, Thomas Keffer  wrote:
[...]
> In any case, it was an early design decision not to entangle the HTML pages
> with database access. It requires colocation of the database and the
> webserver, which most people can't do.

Ah, good point.  I'd better make a note of that in the docs.

> Sorry to interrupt. Carry on!

Will do.  : - )


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Unable to disable logging?

2017-09-23 Thread Andrew Milner
Yes, that is not debug information - that is correct logging information of 
actions undertaken by weewx.

On Saturday, 23 September 2017 10:05:15 UTC+3, Phil Green wrote:
>
> This is what I am seeing every logging interval even though debug = 0
>
>  record 2017-09-23 08:00:00 BST (150615) to database 'weewx.sdb'
> Sep 23 08:00:15 Pi3-Weewx weewx[1616]: manager: Added record 2017-09-23 
> 08:00:00 BST (150615) to daily summary in 'weewx.sdb'
> Sep 23 08:00:17 Pi3-Weewx weewx[1616]: restx: Wunderground-PWS: Published 
> record 2017-09-23 08:00:00 BST (150615)
> Sep 23 08:00:19 Pi3-Weewx weewx[1616]: cheetahgenerator: Generated 14 
> files for report StandardReport in 2.03 seconds
> Sep 23 08:00:21 Pi3-Weewx weewx[1616]: imagegenerator: Generated 24 images 
> for StandardReport in 2.44 seconds
> Sep 23 08:00:21 Pi3-Weewx weewx[1616]: copygenerator: copied 0 files to 
> /var/www/html/weewx
>
> Is this normal?
> Regards 
> Phil
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Unable to disable logging?

2017-09-23 Thread Phil Green
This is what I am seeing every logging interval even though debug = 0

 record 2017-09-23 08:00:00 BST (150615) to database 'weewx.sdb'
Sep 23 08:00:15 Pi3-Weewx weewx[1616]: manager: Added record 2017-09-23 
08:00:00 BST (150615) to daily summary in 'weewx.sdb'
Sep 23 08:00:17 Pi3-Weewx weewx[1616]: restx: Wunderground-PWS: Published 
record 2017-09-23 08:00:00 BST (150615)
Sep 23 08:00:19 Pi3-Weewx weewx[1616]: cheetahgenerator: Generated 14 files for 
report StandardReport in 2.03 seconds
Sep 23 08:00:21 Pi3-Weewx weewx[1616]: imagegenerator: Generated 24 images for 
StandardReport in 2.44 seconds
Sep 23 08:00:21 Pi3-Weewx weewx[1616]: copygenerator: copied 0 files to 
/var/www/html/weewx

Is this normal?
Regards 
Phil

-- 
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.
For more options, visit https://groups.google.com/d/optout.