[weewx-user] Re: Version 4.0 is (finally) here!

2020-04-30 Thread Hyrules Hyrules
Working well here too thanks alot.

-- 
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/25c7e834-db65-4cbd-ab53-6a17c7b3448b%40googlegroups.com.


[weewx-user] Weatherlink files template

2020-02-09 Thread Hyrules Hyrules
Hi all,

I'm trying to replicate the old Weatherlink downld02.txt and downld08.txt. 
So far so go i've been able to replicate 90% of the information needed for 
the file.

The only thing missing are the following information. I was wondering if 
there is any way to get them in Weewx :

Wind Samples count
Wind Tx aka the transmitter channel
IIS Reception quality signal. Normally this is calculated with the wind 
samples from what I understand.
And last but not least the Archive Interval.

Any help would be appreciated.

Thank.




-- 
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/4164e5b7-f564-4b57-aadc-32fb5d28c2b4%40googlegroups.com.


[weewx-user] Re: templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
Actually it's quite easy for those who would like to do it here is the code 
for the search list extension. All I need is to remove the first spans in 
the list and voila. This gives me all spans in intervals of 15 minutes from 
2 days ago to closes quarter to now.

# BASED ON BELCHERTOWN PYTHON FILE START

from __future__ import with_statement
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__)   

reload(sys)
sys.setdefaultencoding("utf-8")

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 HydroMeteoStats(SearchList):
   def __init__(self, generator):
   SearchList.__init__(self, generator)

def get_extension_list(self, timespan, db_lookup):   
today = datetime.datetime.now()
   twodaysago = datetime.datetime.now() - datetime.timedelta(days=2)
   
   twodaysago = twodaysago.replace(hour=00, minute=00, second=00,
microsecond=00) #.strftime("%Y-%m-%d %H:%M:%S")
   
   tsb = TimespanBinder(TimeSpan(time.mktime(twodaysago.timetuple()), 
time.mktime(today.timetuple())), db_lookup,formatter=self.generator.formatter, 
converter=self.generator.converter)
   spans = tsb.spans(interval=900)
   last2days = spans

search_list_extension = {'last2days' : last2days}

return [search_list_extension]



On Saturday, February 1, 2020 at 12:42:45 PM UTC-5, Hyrules Hyrules wrote:
>
> Hi everyone,
>
> I was wondering if there is an actual way of doing this in the cheetah 
> templating engine.
>
> I would like to get the following information in my file :
>
> - last 2 days of archive
> - starting at midnight and 15 minutes
> - in intervals of 15 minutes
> - all through today closest to the quarter of the hour (eg if it's 12:47 
> -> 12:45, 1:24 -> 1:15)
>
> I'm not sure if it's possible using the pre-existing $span or $day 
> variables. I`ve been trying some stuff apparently unsucessfully. 
>
> Any input would be appreciated.
>
> Thanks.
>

-- 
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/7b7cbbca-2d25-493f-a77c-2169be26b6f4%40googlegroups.com.


Re: [weewx-user] templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
this is what I have at the moment. I'm getting close. Just need to process 
the data I get from the SQL.

-- 
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/28b79fa5-72a7-471d-85fa-9fd6418473b0%40googlegroups.com.
# BASED ON BELCHERTOWN PYTHON FILE START

from __future__ import with_statement
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__)   

reload(sys)
sys.setdefaultencoding("utf-8")

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 HydroMeteoStats(SearchList):
def __init__(self, generator):
SearchList.__init__(self, generator)

def get_extension_list(self, timespan, db_lookup):
		binding = self.generator.config_dict['StdReport'].get('data_binding', 'wx_binding')
		manager = self.generator.db_binder.get_manager(binding)  
		wx_manager = db_lookup()

		twodaysago = datetime.datetime.now() - datetime.timedelta(days=2)
		
		twodaysago = twodaysago.replace(hour=00, minute=15, second=00) #.strftime("%Y-%m-%d %H:%M:%S")
		loginf(twodaysago)
		last2days = wx_manager.genSql("SELECT * FROM archive WHERE (FROM_UNIXTIME(dateTime) >= '%s' AND FROM_UNIXTIME(dateTime) <= NOW()) AND MOD(MINUTE(FROM_UNIXTIME(dateTime)),15) = 0;" % twodaysago)

		search_list_extension = {'last2days' : last2days}

		return [search_list_extension]


Re: [weewx-user] templating with cheetah for last 2 days

2020-02-02 Thread Hyrules Hyrules
Basically that's what i`ve been trying to do since i`ve posted this 
message. I will see how I can implement that with python. I will try to 
create my own skin with some python functions.

I have been able to run a custom SQL on the weewx database and return 
exactly what I want (in a search list extension) but i have yet to 
transform that into something that the cheetah engine understand and 
think is a valuehelper in order for me to process in the engine. I'm not an 
expert in python but It's not really hard to learn and understand. I know a 
few programming languages myself.
In order to be able to use the value I will need to process each record to 
convert the value to the required units (eg : farenheit to celsius ) and 
the transform that to a ValueHelper.

Thanks for the tip

-- 
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/0d3cf814-6d6f-4281-8a09-4ae1e277abc2%40googlegroups.com.


[weewx-user] templating with cheetah for last 2 days

2020-02-01 Thread Hyrules Hyrules
Hi everyone,

I was wondering if there is an actual way of doing this in the cheetah 
templating engine.

I would like to get the following information in my file :

- last 2 days of archive
- starting at midnight and 15 minutes
- in intervals of 15 minutes
- all through today closest to the quarter of the hour (eg if it's 12:47 -> 
12:45, 1:24 -> 1:15)

I'm not sure if it's possible using the pre-existing $span or $day 
variables. I`ve been trying some stuff apparently unsucessfully. 

Any input would be appreciated.

Thanks.

-- 
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/2a33be30-0298-4634-8064-429ff27c2101%40googlegroups.com.


[weewx-user] Re: Windchill stored as heatindex

2019-10-14 Thread Hyrules Hyrules
Thanks Gary I hope to see 4.0 soon.

-- 
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/b40b5411-0bc6-4fc1-a4a4-a10ba77a9256%40googlegroups.com.


[weewx-user] Re: Windchill stored as heatindex

2019-10-13 Thread Hyrules Hyrules
well it's in the loop2 packet not the loop...

-- 
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/b6885347-8ca6-4fc9-9422-6016013aa629%40googlegroups.com.


[weewx-user] Re: Windchill stored as heatindex

2019-10-13 Thread Hyrules Hyrules
Or simpler is there a way for weewx to just take the value from the weather 
station as it is in the loop data ?


-- 
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/aaf94eb2-7deb-45be-9052-cc0eca434539%40googlegroups.com.


[weewx-user] Re: Windchill stored as heatindex

2019-10-13 Thread Hyrules Hyrules
Your are absolutely right. The value is indeed the outside temp. I know 
that the value are only really valid when they meet specific criteria but 
could it be possible to add an option in the future to still add them even 
if invalid in weewx.conf. I`m currently trying to move a template from 
weatherlink and the app still calculate the value even if bad. For the time 
being I will create a method in my template to calculate it as it is easy.

Thanks again Gary.

On Sunday, October 13, 2019 at 2:37:50 PM UTC-4, Hyrules Hyrules wrote:
>
> I have been reading about heat index and looking at the NOAA formula to 
> calculate the heatindex but it seems there is something wrong in the 
> archive table as it stores the heatindex as the windchill value. Is this a 
> bug ? I'm using a vantage pro 2 and MySQL to store data. Thanks.
>
>

-- 
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/9065579e-a18a-484d-a216-e3ff14bd8004%40googlegroups.com.


[weewx-user] Windchill stored as heatindex

2019-10-13 Thread Hyrules Hyrules
I have been reading about heat index and looking at the NOAA formula to 
calculate the heatindex but it seems there is something wrong in the 
archive table as it stores the heatindex as the windchill value. Is this a 
bug ? I'm using a vantage pro 2 and MySQL to store data. Thanks.

-- 
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/be14d034-0c44-423b-991b-600721d38ec2%40googlegroups.com.


[weewx-user] Re: filling hole in chart

2019-10-13 Thread Hyrules Hyrules
Noted thanks. 

-- 
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/2df259e9-07ae-4f35-b5c4-b9191b8aaabc%40googlegroups.com.


[weewx-user] Re: filling hole in chart

2019-10-12 Thread Hyrules Hyrules
hmmm after a second check there is indeed a hole in the data... does Weewx 
has some kind of catchup function to fetch data from that period in the 
logger ?

-- 
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/20fd0d6b-03ab-476c-bcb2-bf11c51c0748%40googlegroups.com.


[weewx-user] Re: filling hole in chart

2019-10-12 Thread Hyrules Hyrules
Thanks I'll try that. I`ve taken a few timestamps of that period and the 
data seems to be present.

-- 
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/d4d56a9b-2f41-4e52-a9cf-2a9dcd4163d6%40googlegroups.com.


[weewx-user] filling hole in chart

2019-10-12 Thread Hyrules Hyrules
Last tuesday there was a power outage at my house and ever since there is a 
hole in the charts of the Season skin.Whily there was the outage the 
program was obviously not running but weewx did catuch up the data for that 
time when power came back. What is the best way to regenerate the charts ?
I tried wee_reports with the config file and time stamp but it does not 
help. Is it possible at all ? 

thanks.

-- 
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/bec65477-9339-4bc5-89e3-3f25b1c1ed7d%40googlegroups.com.


Re: [weewx-user] Re: Best way to get available cheetah variables

2019-09-30 Thread Hyrules Hyrules
Got it thanks. 

-- 
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/c09af1c8-b76c-4a01-b3fa-6ef809f27978%40googlegroups.com.


[weewx-user] Re: Best way to get available cheetah variables

2019-09-30 Thread Hyrules Hyrules
How would I proceed in the command line with bash $variable ?

-- 
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/972145ed-35b8-4c2b-94e2-744299a6e980%40googlegroups.com.


[weewx-user] Re: Best way to get available cheetah variables

2019-09-28 Thread Hyrules Hyrules
as usual thanks Gary. I'm getting eager to see version 4.

-- 
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/b9f84940-1ea9-49e2-bd41-5388bd4b7715%40googlegroups.com.


[weewx-user] Re: Best way to get available cheetah variables

2019-09-27 Thread Hyrules Hyrules
Yes i have actually started doing exactly that. Thanks for the info and help

On Friday, September 27, 2019 at 6:47:41 PM UTC-4, Hyrules Hyrules wrote:
>
> Hi,
>
> I`ve been playing with the Cheetah generator and I have generated some 
> files with it without any real problem but my main question
> is what would be the best way to get the available variables in the report 
> generator ? I went through the documentation finding most of my answers but 
> some variables are not documented (understandable because each station is 
> different) so I was wondering if anybody has any insight 
> about this. Is my only option digging through the driver ?
>
> Thanks
>

-- 
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/1136cfcf-a3f0-4cc0-b377-8d759605e525%40googlegroups.com.


[weewx-user] Re: Best way to get available cheetah variables

2019-09-27 Thread Hyrules Hyrules
 Thanks but no. I`ve already went though all the documentation of weewx and 
some stuff is not really documented. For example : I have a Davis Vantage 
Pro 2 and the stormRain variable is proper to that station. So is the 
stormStart but I cannot get it to work if I use $current.stormStart the 
generator output ?'stormStart'? so either i'm not using it properly or 
there is a bug in the driver. The station has also a forecast variable 
which is forecastIcon but I have to guess the values of the forecast 
because it is a float number.

-- 
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/ae2a1917-dec3-494d-aec7-88f311b917b4%40googlegroups.com.


[weewx-user] Best way to get available cheetah variables

2019-09-27 Thread Hyrules Hyrules
Hi,

I`ve been playing with the Cheetah generator and I have generated some 
files with it without any real problem but my main question
is what would be the best way to get the available variables in the report 
generator ? I went through the documentation finding most of my answers but 
some variables are not documented (understandable because each station is 
different) so I was wondering if anybody has any insight 
about this. Is my only option digging through the driver ?

Thanks

-- 
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/e5d62b4d-7657-4251-bb94-7b6ce31d6403%40googlegroups.com.


[weewx-user] Re: Importing from cumulus give a python error

2019-09-23 Thread Hyrules Hyrules


Yep it seems to be working fine. Tried it with a dryrun and no more errors. 
Thanks again for the help.

I'm glad I have discovered weewx. Currently toying with the Cheetah 
generator to reproduce some files I need.

On Sunday, September 22, 2019 at 6:09:54 PM UTC-4, Hyrules Hyrules wrote:
>
> Hi,
>
> I just discovered Weewx and i'm in the process of converting from Cumulus 
> and I'm trying to import 
> my monthly logs to my weewx database but after uploading the cumulus log 
> files and setting up my cumulus.conf
> file I get the following errow when I try a dryrun :
>
> Starting wee_import...
> Cumulus monthly log files in the '/var/tmp/cumulus' directory will be 
> imported
> The following options will be used:
>  config=/etc/weewx/weewx.conf, import-config=/var/tmp/cumulus.conf
>  from=None, to=None
>  dry-run=True, calc_missing=True, ignore_invalid_data=True
>  tranche=250, interval=derive
>  UV=True, radiation=True
> Using database binding 'wx_binding', which is bound to database 'weewx'
> Destination table 'archive' unit system is '0x01' (US).
> Missing derived observations will be calculated.
> This is a dry run, imported data will not be saved to archive.
> Obtaining raw import data for period 1...
> Raw import data read successfully for period 1.
> Mapping raw import data for period 1...
> Traceback (most recent call last):
>   File "/usr/bin/wee_import", line 834, in 
> main()
>   File "/usr/bin/wee_import", line 784, in main
> source_obj.run()
>   File "/usr/share/weewx/weeimport/weeimport.py", line 350, in run
> _mapped_data = self.mapRawData(_raw_data, self.archive_unit_sys)
>   File "/usr/share/weewx/weeimport/weeimport.py", line 664, in mapRawData
> _temp = float(_row[self.map[_field]['field_name']].strip())
> AttributeError: 'NoneType' object has no attribute 'strip'Enter code here
> ...
>
> I`ve been following the docs. Am I missing something ?
>
> My configuration file and sample monthly cumulus log file has been 
> attached to this message. Any help would be appreciated.
>
> My setup :
>
> Ubuntu server 19.04
> Davis Vantage Pro 2
>
> Thanks
>
>
>

-- 
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/6a42973c-8d7e-483f-8753-12f2d1d99f62%40googlegroups.com.