Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
For what it is worth. The file is not corrupt it just has tabs set to 8 
spaces for indentation and space indentation set to 4 spaces. So if you 
replace the tabs with 8 spaces and leave the spaces along the file should 
indent correctly. If you use an Eclipse editor with a python plugin you can 
easily see this.
Thanks

On Friday, February 21, 2020 at 3:37:45 PM UTC-7, G Hammer wrote:
>
> Perhaps, but it is working on my production system at the moment under 
> python 2.7
>
> On Fri, Feb 21, 2020, 5:34 PM vince > 
> wrote:
>
>> On Friday, February 21, 2020 at 2:27:34 PM UTC-8, J D wrote:
>>>
>>> Sorry to tell you but what you posted has indentation problems in many 
>>> places. I would spend some time reading the link I sent you about python 
>>> indentation and try it again.
>>>


>> The file you are starting with is hosed on the github side.  No way it 
>> works as-is with weewx of any version.
>>
>> There are 39 places on 32 lines.   Simply substituting 4-spaces for 1-tab 
>> globally doesn't do it, as it results in hosed space-based indenting that 
>> needs hand-fixing to add/delete spaces so the actual code works.
>>
>> -- 
>> 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/wlufg8AdT0E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/7fc0a424-79d3-4c43-b01e-65d83d858a4b%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/e2a02ce0-514d-4d27-9310-91fba364c386%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Perhaps, but it is working on my production system at the moment under
python 2.7

On Fri, Feb 21, 2020, 5:34 PM vince  wrote:

> On Friday, February 21, 2020 at 2:27:34 PM UTC-8, J D wrote:
>>
>> Sorry to tell you but what you posted has indentation problems in many
>> places. I would spend some time reading the link I sent you about python
>> indentation and try it again.
>>
>>>
>>>
> The file you are starting with is hosed on the github side.  No way it
> works as-is with weewx of any version.
>
> There are 39 places on 32 lines.   Simply substituting 4-spaces for 1-tab
> globally doesn't do it, as it results in hosed space-based indenting that
> needs hand-fixing to add/delete spaces so the actual code works.
>
> --
> 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/wlufg8AdT0E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/7fc0a424-79d3-4c43-b01e-65d83d858a4b%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/CALBRR-1%3Dbh2SSJRn4PFDPU0rYPGE5ZhpXPekOWZJWtqyA-VB%3Dg%40mail.gmail.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Perhaps I'll leave this to actual programmers.

If it is something easily done, I'm game.

If it requires hours of hunt the wumpus, seems to be a useless endeavor.

I've removed the tab/space problem. As I do not program, it's beyond me
what level of indentation is needed.



On Fri, Feb 21, 2020, 5:27 PM J D  wrote:

> Hi,
> Sorry to tell you but what you posted has indentation problems in many
> places. I would spend some time reading the link I sent you about python
> indentation and try it again.
> Thanks
>
> On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>>
>> I'd like to run v4 when I upgrade hardware this week.
>> Seems to be doing fine for the devices and skin I use.
>> With one exception, a RainMachine extension.
>> There is one that was written by someone at RainMachine, but I think he
>> has moved on.
>> I've asked there and raised an issue on the github page for the extension
>> with no response.
>>
>> How, besides installing v4 and the extension, can I determine if it will
>> run under v4?
>>
>> The extension is located at
>> https://github.com/sprinkler/rainmachine-weewx and referenced at
>> https://github.com/weewx/weewx/wiki/RainMachine
>>
>> With this functionality confirmed, I can make the change, without it I'll
>> need to stay with v3
>>
>>
>> --
> 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/wlufg8AdT0E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/c5f85afb-dec6-4f6f-9aed-8c04e53a4dab%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/CALBRR-22yx2w%3DGqgKP6q2bPrO5Tk_Z-Dr7iL7Fqxm31Rpj%3Dopw%40mail.gmail.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread vince
On Friday, February 21, 2020 at 2:27:34 PM UTC-8, J D wrote:
>
> Sorry to tell you but what you posted has indentation problems in many 
> places. I would spend some time reading the link I sent you about python 
> indentation and try it again.
>
>>
>>
The file you are starting with is hosed on the github side.  No way it 
works as-is with weewx of any version.

There are 39 places on 32 lines.   Simply substituting 4-spaces for 1-tab 
globally doesn't do it, as it results in hosed space-based indenting that 
needs hand-fixing to add/delete spaces so the actual code works.

-- 
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/7fc0a424-79d3-4c43-b01e-65d83d858a4b%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Well, considering that you didn't address any of the reported errors, I
don't see what info would help.


On Fri, Feb 21, 2020, 5:27 PM vince  wrote:

> On Friday, February 21, 2020 at 1:49:43 PM UTC-8, G Hammer wrote:
>>
>> No, it did not. I had already ran it through and found many errors.
>> Going to start from scratch, first removing all tabs in favor of 4 spaces.
>> Then run it through 2to3, then see what errors out.
>>
>>
> If you don't share with us what errors you're finding we can't really help.
>
> I'm going to give up on helping with this one.  Best of luck.
>
>
> --
> 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/wlufg8AdT0E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/2fc02509-9f9f-4052-a1cd-91694404f6b2%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/CALBRR-1b8ZLigbc3hyJbKZWUp-W1PeUWN3_cZheVc5195t51Eg%40mail.gmail.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread vince
On Friday, February 21, 2020 at 1:49:43 PM UTC-8, G Hammer wrote:
>
> No, it did not. I had already ran it through and found many errors.
> Going to start from scratch, first removing all tabs in favor of 4 spaces.
> Then run it through 2to3, then see what errors out.
>
>
If you don't share with us what errors you're finding we can't really help.

I'm going to give up on helping with this one.  Best of luck.
 

-- 
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/2fc02509-9f9f-4052-a1cd-91694404f6b2%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
Sorry to tell you but what you posted has indentation problems in many 
places. I would spend some time reading the link I sent you about python 
indentation and try it again.
Thanks

On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/c5f85afb-dec6-4f6f-9aed-8c04e53a4dab%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
File attached as rainmachine2.py


On Friday, February 21, 2020 at 4:58:01 PM UTC-5, G Hammer wrote:
>
> Ok, downloaded the file, took the original expand --tabs=4 rainmachine.py 
> > temp.txt replaced the .py file with the .txt file resulting in a 
> rainmachine.py with no tabs.
> Ran 2to3 get an error, a lone 'return' on line 67.
>
> RefactoringTool: There was 1 error:
> RefactoringTool: Can't parse rainmachine.py: ParseError: bad input: 
> type=1, value='return', context=('', (67, 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/d20e4710-3f81-4a5d-85df-1f620609839e%40googlegroups.com.
# Copyright 2018 Green Electronics LLC
"""
Upload weather data directly to RainMachine smart irrigation controler 
  http://rainmachine.com

Based on RainMachine API 4.6 https://rainmachine.docs.apiary.io/

This extension only works on the local network (doesn't work with RainMachine 
Remote Access service). RainMachine IP address and https port 8080 must be 
accessible from WeeWX installation.

An access token is needed and can be obtained with a POST request:
curl -X POST -k -d ' { "pwd": "admin", "remember":1}' https://rainmachine_ip:8080/api/4/auth/login

More details can be found here: 
https://support.rainmachine.com/hc/en-us/articles/228022248-Controlling-RainMachine-through-REST-API

By default data is sent to RainMachine hourly. Although is possible to send data more often the
RainMachine Mixer (that aggregates data from multiple sources) runs only hourly.


Minimal configuration:

[StdRESTful]
[[RainMachine]]
token = ACCESS_TOKEN
ip = RAINMACHINE IP
usessl = false
"""

import Queue
import syslog
import urllib
import urllib2
import json

import weewx
import weewx.restx
import weewx.units
from weeutil.weeutil import to_bool, accumulateLeaves, startOfDayUTC

VERSION = "0.3"

if weewx.__version__ < "3":
raise weewx.UnsupportedFeature("weewx 3 is required, found %s" %
   weewx.__version__)

def logmsg(level, msg):
syslog.syslog(level, 'restx: RainMachine: %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)


def _get_day_min_max_temp(dbm, ts):
sod = startOfDayUTC(ts)
val = dbm.getSql("SELECT MIN(outTemp), MAX(outTemp) FROM %s "
 "WHERE dateTime>? AND dateTime<=?" %
 dbm.table_name, (sod, ts))
if val is None:
return None, None

return val

# convert temperature to celsius (we need this from values read from DB)
def _convert_temperature(v, from_unit):
if from_unit is None or v is None:
return None
if from_unit != weewx.METRIC:
std_type, _ = weewx.units.getStandardUnitType(from_unit, 'outTemp')
from_type = (v, std_type, 'group_temperature')
v = weewx.units.convert(from_type, 'degree_C')[0]
return v



class RainMachine(weewx.restx.StdRESTful):
def __init__(self, engine, config_dict):
super(RainMachine, self).__init__(engine, config_dict)
loginf('service version is %s' % VERSION)

site_dict = weewx.restx.get_site_dict(config_dict, 'RainMachine', 'token', 'ip')
if site_dict is None:
logerr("Data will not be posted: Missing configuration options.")
return

site_dict.setdefault('usessl', False)
site_dict['usessl'] = to_bool(site_dict.get('usessl'))

site_dict['manager_dict'] = weewx.manager.get_manager_dict(
config_dict['DataBindings'], config_dict['Databases'], 'wx_binding')

self.archive_queue = Queue.Queue()
self.archive_thread = RainMachineThread(self.archive_queue, **site_dict)
self.archive_thread.start()
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
loginf("Data will be uploaded for RainMachine located at %s ssl: %s" % (site_dict['ip'], site_dict['usessl']))

def new_archive_record(self, event):
self.archive_queue.put(event.record)


class RainMachineThread(weewx.restx.RESTThread):
"""
RainMachine POST /api/4/parser/data expected data format (metric units only):
{
"weather": [
{
"mintemp":null,
"maxtemp": null,
"temperature": null,
"wind": null,
"solarrad": null,
"qpf": null,
"rain": null,
"minrh": null,
"maxrh": null,
"condition": 26,
"pressure": null,
"dewpoint": null
},
{
"timestamp": 1563362587,
"mintemp":null,
"maxtemp": null,
"temperature": null,
"wind": null,
"solarrad": null,
   

[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Ok, downloaded the file, took the original expand --tabs=4 rainmachine.py > 
temp.txt replaced the .py file with the .txt file resulting in a 
rainmachine.py with no tabs.
Ran 2to3 get an error, a lone 'return' on line 67.

RefactoringTool: There was 1 error:
RefactoringTool: Can't parse rainmachine.py: ParseError: bad input: type=1, 
value='return', context=('', (67, 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/8809a566-2a62-4493-bd59-e228256536ad%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
No, it did not. I had already ran it through and found many errors.
Going to start from scratch, first removing all tabs in favor of 4 spaces.
Then run it through 2to3, then see what errors out.

On Friday, February 21, 2020 at 4:27:13 PM UTC-5, vince wrote:
>
> On Friday, February 21, 2020 at 1:07:39 PM UTC-8, J D wrote:
>>
>> Hi,
>> So your edits for the tabs messed up the python indentation. I would go 
>> back to a previous version and make sure that for each tab you find that 
>> you put in the correct number of spaces so the code still lines up after 
>> you replace the tabs as it did before. This is why I need to see the actual 
>> file.
>>
>>>
>>>
> I ran the .py file through 2to3 here - see if this helps any.
>  
>

-- 
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/ef241471-f4f3-465e-80e3-dae51d500e2d%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Thanks, I'll give it a try!

On Friday, February 21, 2020 at 4:27:13 PM UTC-5, vince wrote:
>
> On Friday, February 21, 2020 at 1:07:39 PM UTC-8, J D wrote:
>>
>> Hi,
>> So your edits for the tabs messed up the python indentation. I would go 
>> back to a previous version and make sure that for each tab you find that 
>> you put in the correct number of spaces so the code still lines up after 
>> you replace the tabs as it did before. This is why I need to see the actual 
>> file.
>>
>>>
>>>
> I ran the .py file through 2to3 here - see if this helps any.
>  
>

-- 
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/63603eb7-7079-465a-a344-932ec2fe348c%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
I'll take the original and try expand to rid the file of spaces.

On Friday, February 21, 2020 at 4:07:39 PM UTC-5, J D wrote:
>
> Hi,
> So your edits for the tabs messed up the python indentation. I would go 
> back to a previous version and make sure that for each tab you find that 
> you put in the correct number of spaces so the code still lines up after 
> you replace the tabs as it did before. This is why I need to see the actual 
> file.
> Thanks
>
> On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>>
>> I'd like to run v4 when I upgrade hardware this week.
>> Seems to be doing fine for the devices and skin I use.
>> With one exception, a RainMachine extension.
>> There is one that was written by someone at RainMachine, but I think he 
>> has moved on.
>> I've asked there and raised an issue on the github page for the extension 
>> with no response.
>>
>> How, besides installing v4 and the extension, can I determine if it will 
>> run under v4?
>>
>> The extension is located at 
>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>> https://github.com/weewx/weewx/wiki/RainMachine
>>
>> With this functionality confirmed, I can make the change, without it I'll 
>> need to stay with v3
>>
>>
>>

-- 
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/718b2be4-c64f-412e-bd27-005d91ce0736%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread vince
On Friday, February 21, 2020 at 1:07:39 PM UTC-8, J D wrote:
>
> Hi,
> So your edits for the tabs messed up the python indentation. I would go 
> back to a previous version and make sure that for each tab you find that 
> you put in the correct number of spaces so the code still lines up after 
> you replace the tabs as it did before. This is why I need to see the actual 
> file.
>
>>
>>
I ran the .py file through 2to3 here - see if this helps any.
 

-- 
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/33672cad-d9f2-4150-b6fd-1877c4d30edf%40googlegroups.com.
# Copyright 2018 Green Electronics LLC
"""
Upload weather data directly to RainMachine smart irrigation controler 
  http://rainmachine.com

Based on RainMachine API 4.6 https://rainmachine.docs.apiary.io/

This extension only works on the local network (doesn't work with RainMachine 
Remote Access service). RainMachine IP address and https port 8080 must be 
accessible from WeeWX installation.

An access token is needed and can be obtained with a POST request:
curl -X POST -k -d ' { "pwd": "admin", "remember":1}' https://rainmachine_ip:8080/api/4/auth/login

More details can be found here: 
https://support.rainmachine.com/hc/en-us/articles/228022248-Controlling-RainMachine-through-REST-API

By default data is sent to RainMachine hourly. Although is possible to send data more often the
RainMachine Mixer (that aggregates data from multiple sources) runs only hourly.


Minimal configuration:

[StdRESTful]
[[RainMachine]]
token = ACCESS_TOKEN
	ip = RAINMACHINE IP
	usessl = false
"""

import queue
import syslog
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import json

import weewx
import weewx.restx
import weewx.units
from weeutil.weeutil import to_bool, accumulateLeaves, startOfDayUTC

VERSION = "0.3"

if weewx.__version__ < "3":
raise weewx.UnsupportedFeature("weewx 3 is required, found %s" %
   weewx.__version__)

def logmsg(level, msg):
syslog.syslog(level, 'restx: RainMachine: %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)


def _get_day_min_max_temp(dbm, ts):
sod = startOfDayUTC(ts)
val = dbm.getSql("SELECT MIN(outTemp), MAX(outTemp) FROM %s "
 "WHERE dateTime>? AND dateTime<=?" %
 dbm.table_name, (sod, ts))
if val is None:
	return None, None

return val

# convert temperature to celsius (we need this from values read from DB)
def _convert_temperature(v, from_unit):
if from_unit is None or v is None:
return None
if from_unit != weewx.METRIC:
std_type, _ = weewx.units.getStandardUnitType(from_unit, 'outTemp')
from_type = (v, std_type, 'group_temperature')
v = weewx.units.convert(from_type, 'degree_C')[0]
return v



class RainMachine(weewx.restx.StdRESTful):
def __init__(self, engine, config_dict):
super(RainMachine, self).__init__(engine, config_dict)
loginf('service version is %s' % VERSION)

	site_dict = weewx.restx.get_site_dict(config_dict, 'RainMachine', 'token', 'ip')
	if site_dict is None:
	logerr("Data will not be posted: Missing configuration options.")
return

	site_dict.setdefault('usessl', False)
	site_dict['usessl'] = to_bool(site_dict.get('usessl'))

site_dict['manager_dict'] = weewx.manager.get_manager_dict(
config_dict['DataBindings'], config_dict['Databases'], 'wx_binding')

self.archive_queue = queue.Queue()
self.archive_thread = RainMachineThread(self.archive_queue, **site_dict)
self.archive_thread.start()
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
loginf("Data will be uploaded for RainMachine located at %s ssl: %s" % (site_dict['ip'], site_dict['usessl']))

def new_archive_record(self, event):
self.archive_queue.put(event.record)


class RainMachineThread(weewx.restx.RESTThread):
"""
RainMachine POST /api/4/parser/data expected data format (metric units only):
{
"weather": [
{
"mintemp":null,
"maxtemp": null,
"temperature": null,
"wind": null,
"solarrad": null,
"qpf": null,
"rain": null,
"minrh": null,
"maxrh": null,
"condition": 26,
"pressure": null,
"dewpoint": null
},
{
"timestamp": 1563362587,
"mintemp":null,
"maxtemp": null,
"temperature": null,
"wind": null,
"solarrad": null,
  

[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
So your edits for the tabs messed up the python indentation. I would go 
back to a previous version and make sure that for each tab you find that 
you put in the correct number of spaces so the code still lines up after 
you replace the tabs as it did before. This is why I need to see the actual 
file.
Thanks

On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/90af4946-02e1-421c-b1c8-55a504b63b2e%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Attached.

On Friday, February 21, 2020 at 3:43:12 PM UTC-5, J D wrote:
>
> Hi,
> Need to see the actual file creating the error since you have been 
> changing it based on your previous posts.
> Thanks
>
> On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>>
>> I'd like to run v4 when I upgrade hardware this week.
>> Seems to be doing fine for the devices and skin I use.
>> With one exception, a RainMachine extension.
>> There is one that was written by someone at RainMachine, but I think he 
>> has moved on.
>> I've asked there and raised an issue on the github page for the extension 
>> with no response.
>>
>> How, besides installing v4 and the extension, can I determine if it will 
>> run under v4?
>>
>> The extension is located at 
>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>> https://github.com/weewx/weewx/wiki/RainMachine
>>
>> With this functionality confirmed, I can make the change, without it I'll 
>> need to stay with v3
>>
>>
>>

-- 
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/6e0a5a97-d653-4f77-8cd9-3c48058a9ca1%40googlegroups.com.
# Copyright 2018 Green Electronics LLC
"""
Upload weather data directly to RainMachine smart irrigation controler 
  http://rainmachine.com

Based on RainMachine API 4.6 https://rainmachine.docs.apiary.io/

This extension only works on the local network (doesn't work with RainMachine 
Remote Access service). RainMachine IP address and https port 8080 must be 
accessible from WeeWX installation.

An access token is needed and can be obtained with a POST request:
curl -X POST -k -d ' { "pwd": "admin", "remember":1}' https://rainmachine_ip:8080/api/4/auth/login

More details can be found here: 
https://support.rainmachine.com/hc/en-us/articles/228022248-Controlling-RainMachine-through-REST-API

By default data is sent to RainMachine hourly. Although is possible to send data more often the
RainMachine Mixer (that aggregates data from multiple sources) runs only hourly.


Minimal configuration:

[StdRESTful]
[[RainMachine]]
token = ACCESS_TOKEN
	ip = RAINMACHINE IP
	usessl = false
"""

import queue
import syslog
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import json

import weewx
import weewx.restx
import weewx.units
from weeutil.weeutil import to_bool, accumulateLeaves, startOfDayUTC

VERSION = "0.4"

if weewx.__version__ < "3":
raise weewx.UnsupportedFeature("weewx 3 is required, found %s" %
   weewx.__version__)

def logmsg(level, msg):
syslog.syslog(level, 'restx: RainMachine: %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)


def _get_day_min_max_temp(dbm, ts):
sod = startOfDayUTC(ts)
val = dbm.getSql("SELECT MIN(outTemp), MAX(outTemp) FROM %s "
 "WHERE dateTime>? AND dateTime<=?" %
 dbm.table_name, (sod, ts))
if val is None:
return None, None
return val

# convert temperature to celsius (we need this from values read from DB)
def _convert_temperature(v, from_unit):
if from_unit is None or v is None:
return None
if from_unit != weewx.METRIC:
std_type, _ = weewx.units.getStandardUnitType(from_unit, 'outTemp')
from_type = (v, std_type, 'group_temperature')
v = weewx.units.convert(from_type, 'degree_C')[0]
return v



class RainMachine(weewx.restx.StdRESTful):
def __init__(self, engine, config_dict):
super(RainMachine, self).__init__(engine, config_dict)
loginf('service version is %s' % VERSION)

site_dict = weewx.restx.get_site_dict(config_dict, 'RainMachine', 'token', 'ip')
if site_dict is None:
logerr("Data will not be posted: Missing configuration options.")
site_dict.setdefault('usessl', False)
site_dict['usessl'] = to_bool(site_dict.get('usessl'))

site_dict['manager_dict'] = weewx.manager.get_manager_dict(
config_dict['DataBindings'], config_dict['Databases'], 'wx_binding')

self.archive_queue = queue.Queue()
self.archive_thread = RainMachineThread(self.archive_queue, **site_dict)
self.archive_thread.start()
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
loginf("Data will be uploaded for RainMachine located at %s ssl: %s" % (site_dict['ip'], site_dict['usessl']))

def new_archive_record(self, event):
self.archive_queue.put(event.record)


class RainMachineThread(weewx.restx.RESTThread):
"""
RainMachine POST /api/4/parser/data expected data format (metric units only):
{
"weather": [
{
"mintemp":null,
 

[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
Need to see the actual file creating the error since you have been changing 
it based on your previous posts.
Thanks

On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/ef7130ef-24a1-44fb-b413-080cacf91fe1%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
The code is located at gethub Rainmachine 

That page has some additional info that may be helpful as well.



On Friday, February 21, 2020 at 3:28:28 PM UTC-5, J D wrote:
>
> Hi,
> You need to post the actual code that produced this error if you want 
> additional help.
> Thanks
>
> On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>>
>> I'd like to run v4 when I upgrade hardware this week.
>> Seems to be doing fine for the devices and skin I use.
>> With one exception, a RainMachine extension.
>> There is one that was written by someone at RainMachine, but I think he 
>> has moved on.
>> I've asked there and raised an issue on the github page for the extension 
>> with no response.
>>
>> How, besides installing v4 and the extension, can I determine if it will 
>> run under v4?
>>
>> The extension is located at 
>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>> https://github.com/weewx/weewx/wiki/RainMachine
>>
>> With this functionality confirmed, I can make the change, without it I'll 
>> need to stay with v3
>>
>>
>>

-- 
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/d3ad4a1f-e407-4682-a1c3-14fb04042f7b%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
You need to post the actual code that produced this error if you want 
additional help.
Thanks

On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/af5f5f67-1241-40f0-a0d6-a28ca4efd370%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
Thanks, that got me through the formatting errors. No idea why sometimes in 
the same line use spaces tab spaces. But all that is cleaned up.
Now, program logic is failing it seems.

raceback (most recent call last):
  File "./bin/weewxd", line 261, in 
main()
  File "./bin/weewxd", line 148, in main
engine = weewx.engine.StdEngine(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 75, in __init__
self.loadServices(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 136, in loadServices
obj = weeutil.weeutil.get_object(svc)(self,config_dict)
  File "/home/weewx/bin/weeutil/weeutil.py", line 1093, in get_object
mod = __import__(module)
  File "/home/weewx/bin/user/rainmachine.py", line 82, in 
class RainMachine(weewx.restx.StdRESTful):
  File "/home/weewx/bin/user/rainmachine.py", line 87, in RainMachine
site_dict = weewx.restx.get_site_dict(config_dict, 'RainMachine', 
'token', 'ip')
NameError: name 'config_dict' is not defined


Runs fine under python 2

-- 
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/6e6e2bf1-8722-49de-81a7-f924c98d12ab%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread J D
Hi,
Python 3 does not allow tabs and spaces to be mixed. See 
https://www.python.org/dev/peps/pep-0008/ 
Most people just use an editor and replace the tabs with correct amount of 
spaces when they see this error.
Thanks Jerry

On Saturday, January 18, 2020 at 7:46:16 PM UTC-7, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/c6b4487d-4325-4b04-a450-0118869ab97a%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread vince
On Friday, February 21, 2020 at 10:35:01 AM UTC-8, G Hammer wrote:
>
> I have installed 4.0.b12 and running only python 3.
> I tried 2to3 on the rainmachine extension and while it had no errors in 
> completing, the resulting code is not proper.
> When I run weewx directly, it fails when loading rainmachine:
>  File "/home/weewx/bin/user/rainmachine.py", line 67
> return None, None
> ^
> TabError: inconsistent use of tabs and spaces in indentation
>
> As I'm not a programmer, I have no idea of what use of tabs and spaces 
> would mean.
>
>
>
Python is particular about indentation of each line, requiring you to 
basically pick tabs or spaces when you want to indent.

You need to use one way (hint - pick spaces) consistently in a python file. 

My 'guess' is your line 67 has a tab in it.  Open it in an editor and 
backspace so it starts in column 1, then 'space' forward to set the proper 
indenting.  See if that's all that's needed.  If you used tabs on multiple 
lines, it'll complain every time until you get all the tabs replaced with 
spaces throughout.  Be very careful with not messing up the indentation.

If you're using vi or vim as an editor, I'd suggest you add "set expandtab" 
to your .vimrc file.  If you don't use vi or vim, ignore this sentence :-)


-- 
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/97871d98-17f5-43a1-aeb8-102979b8513a%40googlegroups.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-02-21 Thread G Hammer
I have installed 4.0.b12 and running only python 3.
I tried 2to3 on the rainmachine extension and while it had no errors in 
completing, the resulting code is not proper.
When I run weewx directly, it fails when loading rainmachine:
 File "/home/weewx/bin/user/rainmachine.py", line 67
return None, None
^
TabError: inconsistent use of tabs and spaces in indentation

As I'm not a programmer, I have no idea of what use of tabs and spaces 
would mean.

Help?

On Saturday, January 18, 2020 at 9:46:16 PM UTC-5, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/f1079749-7e54-4667-abfa-12c62927435e%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread G Hammer
Excellent info, appreciated!

On Sunday, January 19, 2020 at 7:52:14 PM UTC-5, Thomas Keffer wrote:
>
> Be sure to read the article *Python 3 strategy 
> * in the WeeWX 
> Wiki.
>
> -tk
>
> On Sun, Jan 19, 2020 at 2:04 PM G Hammer > 
> wrote:
>
>> When I install the new system Tuesday, I plan to only install python 3.
>> Hopefully there won't be many changes that need done manually, but I'll 
>> see what transpires.
>>
>> Thanks!
>>
>>
>> On Sunday, January 19, 2020 at 2:23:19 PM UTC-5, vince wrote:
>>>
>>> On Sunday, January 19, 2020 at 8:14:00 AM UTC-8, G Hammer wrote:

 Thanks for the tips, I'm going to see if I am able to get it working 
 under python 3 as that seems to be the future. Good to know that it may 
 run 
 as is with WeeWX 4.



>>> Just run it through "2to3 -w" to have it make the most usual changes.  
>>> That should get you close.
>>>
>>> Be sure if you're using python3 to install the python3 versions of all 
>>> the modules required for weewx.
>>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/c317f3c6-6472-4591-a8e2-59a40c3f657e%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/bd3f8dd6-7578-4ee9-8326-3cfcaa57bcae%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread Thomas Keffer
Be sure to read the article *Python 3 strategy
* in the WeeWX Wiki.

-tk

On Sun, Jan 19, 2020 at 2:04 PM G Hammer  wrote:

> When I install the new system Tuesday, I plan to only install python 3.
> Hopefully there won't be many changes that need done manually, but I'll
> see what transpires.
>
> Thanks!
>
>
> On Sunday, January 19, 2020 at 2:23:19 PM UTC-5, vince wrote:
>>
>> On Sunday, January 19, 2020 at 8:14:00 AM UTC-8, G Hammer wrote:
>>>
>>> Thanks for the tips, I'm going to see if I am able to get it working
>>> under python 3 as that seems to be the future. Good to know that it may run
>>> as is with WeeWX 4.
>>>
>>>
>>>
>> Just run it through "2to3 -w" to have it make the most usual changes.
>> That should get you close.
>>
>> Be sure if you're using python3 to install the python3 versions of all
>> the modules required for weewx.
>>
> --
> 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/c317f3c6-6472-4591-a8e2-59a40c3f657e%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/CAPq0zEANM9SNdSQN1T08kV4V6Rt-F2wdrxWzgOjtYAT59uF%2B2w%40mail.gmail.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread G Hammer
When I install the new system Tuesday, I plan to only install python 3.
Hopefully there won't be many changes that need done manually, but I'll see 
what transpires.

Thanks!


On Sunday, January 19, 2020 at 2:23:19 PM UTC-5, vince wrote:
>
> On Sunday, January 19, 2020 at 8:14:00 AM UTC-8, G Hammer wrote:
>>
>> Thanks for the tips, I'm going to see if I am able to get it working 
>> under python 3 as that seems to be the future. Good to know that it may run 
>> as is with WeeWX 4.
>>
>>
>>
> Just run it through "2to3 -w" to have it make the most usual changes. 
>  That should get you close.
>
> Be sure if you're using python3 to install the python3 versions of all the 
> modules required for weewx.
>

-- 
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/c317f3c6-6472-4591-a8e2-59a40c3f657e%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread vince
On Sunday, January 19, 2020 at 8:14:00 AM UTC-8, G Hammer wrote:
>
> Thanks for the tips, I'm going to see if I am able to get it working under 
> python 3 as that seems to be the future. Good to know that it may run as is 
> with WeeWX 4.
>
>
>
Just run it through "2to3 -w" to have it make the most usual changes.  That 
should get you close.

Be sure if you're using python3 to install the python3 versions of all the 
modules required for weewx.

-- 
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/dfe8b9e2-4ceb-4476-ac76-b1f336748c55%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread G Hammer
Thanks for the tips, I'm going to see if I am able to get it working under 
python 3 as that seems to be the future. Good to know that it may run as is 
with WeeWX 4.


On Sunday, January 19, 2020 at 12:04:33 AM UTC-5, gjr80 wrote:
>
> As John said the code has not been ported to WeeWX v4 and definitely will 
> not run under WeeWX v4/python 3. That being said, it may work with WeeWX v4 
> when run under python 2; looking through the code quickly I don't see 
> anything that obviously will not work under WeeWX v4/python 2. WeeWX v4 
> logging has changed, with the syslog module no longer being used; however, 
> that will not prevent the extension from running under WeeWX v4/python 2, 
> you will just find the RainMachine log entries will be formatted a little 
> differently.
>
> Its a fairly basic small extension which can be easily and fully ported to 
> WeeWX v4 python 2/3. If you get stuck sing out and we can port it for you.
>
> Gary
>
> On Sunday, 19 January 2020 14:51:42 UTC+10, John Kline wrote:
>>
>> I had a quick look.  It imports Queue (with a capital ‘Q’).  That will 
>> fail in python 3.
>> As such, this has not been ported.
>>
>> As for an answer to the general question, there are tools available to 
>> convert code (2to3, modernize).  It usually requires more work than that, 
>> but you could run one of them on the code to see what it changes.  That 
>> would give you a good idea of whether it is already python3 ready.
>>
>> Actually, a better way is just to read up on the subject.  When you do, 
>> it will be pretty easy to spot code that will run in 2 and 3.
>>
>> On Jan 18, 2020, at 8:39 PM, G Hammer  wrote:
>>
>> 
>> Seems that there should be a way to determine this as the change to 
>> Python 3 isn't just a WeeWX thing.
>>
>> As for whether or not to run the beta, it's beta 8 and what I use seems 
>> to be ok as far as reports go. Is it not what beta are for after all?
>>
>> Anyway, not what I asked, so let's see what else comes.
>>
>> On Sat, Jan 18, 2020, 11:14 PM Andrew Milner  
>> wrote:
>>
>>> I do not think v4 has officially been released yet - so I would 
>>> recommend installing the new hardware with 3.9 and do the upgrade when v4 
>>> is finally released.  That way you do not change the whole shebang - 
>>> hardware and software - in one giant leap. Regarding 'how do you know' - 
>>> the answer is that you don't!!  The original writer may update wike or 
>>> download with additional information, or another user may post a comment, 
>>> but there is no automatic verification process of all extensions written by 
>>> other people.
>>>
>>>
>>>
>>>
>>> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:

 I'd like to run v4 when I upgrade hardware this week.
 Seems to be doing fine for the devices and skin I use.
 With one exception, a RainMachine extension.
 There is one that was written by someone at RainMachine, but I think he 
 has moved on.
 I've asked there and raised an issue on the github page for the 
 extension with no response.

 How, besides installing v4 and the extension, can I determine if it 
 will run under v4?

 The extension is located at 
 https://github.com/sprinkler/rainmachine-weewx and referenced at 
 https://github.com/weewx/weewx/wiki/RainMachine

 With this functionality confirmed, I can make the change, without it 
 I'll need to stay with v3


 -- 
>>> 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/wlufg8AdT0E/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> weewx...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/e95133ce-4a77-43db-930f-facf0e73e5e8%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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/CALBRR-09JohVQPwKLeyHfVBW6DV1KdZOP5QhLzTm3ms01teygA%40mail.gmail.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/115a223a-cb4f-4c1e-8866-42f786a9d

Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-19 Thread G Hammer
Thanks for the information, I'll see if I'm able to get it ported.

On Saturday, January 18, 2020 at 11:51:42 PM UTC-5, John Kline wrote:
>
> I had a quick look.  It imports Queue (with a capital ‘Q’).  That will 
> fail in python 3.
> As such, this has not been ported.
>
> As for an answer to the general question, there are tools available to 
> convert code (2to3, modernize).  It usually requires more work than that, 
> but you could run one of them on the code to see what it changes.  That 
> would give you a good idea of whether it is already python3 ready.
>
> Actually, a better way is just to read up on the subject.  When you do, it 
> will be pretty easy to spot code that will run in 2 and 3.
>
> On Jan 18, 2020, at 8:39 PM, G Hammer > 
> wrote:
>
> 
> Seems that there should be a way to determine this as the change to Python 
> 3 isn't just a WeeWX thing.
>
> As for whether or not to run the beta, it's beta 8 and what I use seems to 
> be ok as far as reports go. Is it not what beta are for after all?
>
> Anyway, not what I asked, so let's see what else comes.
>
> On Sat, Jan 18, 2020, 11:14 PM Andrew Milner  > wrote:
>
>> I do not think v4 has officially been released yet - so I would recommend 
>> installing the new hardware with 3.9 and do the upgrade when v4 is finally 
>> released.  That way you do not change the whole shebang - hardware and 
>> software - in one giant leap. Regarding 'how do you know' - the answer is 
>> that you don't!!  The original writer may update wike or download with 
>> additional information, or another user may post a comment, but there is no 
>> automatic verification process of all extensions written by other people.
>>
>>
>>
>>
>> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>>>
>>> I'd like to run v4 when I upgrade hardware this week.
>>> Seems to be doing fine for the devices and skin I use.
>>> With one exception, a RainMachine extension.
>>> There is one that was written by someone at RainMachine, but I think he 
>>> has moved on.
>>> I've asked there and raised an issue on the github page for the 
>>> extension with no response.
>>>
>>> How, besides installing v4 and the extension, can I determine if it will 
>>> run under v4?
>>>
>>> The extension is located at 
>>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>>> https://github.com/weewx/weewx/wiki/RainMachine
>>>
>>> With this functionality confirmed, I can make the change, without it 
>>> I'll need to stay with v3
>>>
>>>
>>> -- 
>> 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/wlufg8AdT0E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/e95133ce-4a77-43db-930f-facf0e73e5e8%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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/CALBRR-09JohVQPwKLeyHfVBW6DV1KdZOP5QhLzTm3ms01teygA%40mail.gmail.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/98528562-590a-4773-984c-d8942be1ab1a%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-18 Thread gjr80
As John said the code has not been ported to WeeWX v4 and definitely will 
not run under WeeWX v4/python 3. That being said, it may work with WeeWX v4 
when run under python 2; looking through the code quickly I don't see 
anything that obviously will not work under WeeWX v4/python 2. WeeWX v4 
logging has changed, with the syslog module no longer being used; however, 
that will not prevent the extension from running under WeeWX v4/python 2, 
you will just find the RainMachine log entries will be formatted a little 
differently.

Its a fairly basic small extension which can be easily and fully ported to 
WeeWX v4 python 2/3. If you get stuck sing out and we can port it for you.

Gary

On Sunday, 19 January 2020 14:51:42 UTC+10, John Kline wrote:
>
> I had a quick look.  It imports Queue (with a capital ‘Q’).  That will 
> fail in python 3.
> As such, this has not been ported.
>
> As for an answer to the general question, there are tools available to 
> convert code (2to3, modernize).  It usually requires more work than that, 
> but you could run one of them on the code to see what it changes.  That 
> would give you a good idea of whether it is already python3 ready.
>
> Actually, a better way is just to read up on the subject.  When you do, it 
> will be pretty easy to spot code that will run in 2 and 3.
>
> On Jan 18, 2020, at 8:39 PM, G Hammer > 
> wrote:
>
> 
> Seems that there should be a way to determine this as the change to Python 
> 3 isn't just a WeeWX thing.
>
> As for whether or not to run the beta, it's beta 8 and what I use seems to 
> be ok as far as reports go. Is it not what beta are for after all?
>
> Anyway, not what I asked, so let's see what else comes.
>
> On Sat, Jan 18, 2020, 11:14 PM Andrew Milner  > wrote:
>
>> I do not think v4 has officially been released yet - so I would recommend 
>> installing the new hardware with 3.9 and do the upgrade when v4 is finally 
>> released.  That way you do not change the whole shebang - hardware and 
>> software - in one giant leap. Regarding 'how do you know' - the answer is 
>> that you don't!!  The original writer may update wike or download with 
>> additional information, or another user may post a comment, but there is no 
>> automatic verification process of all extensions written by other people.
>>
>>
>>
>>
>> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>>>
>>> I'd like to run v4 when I upgrade hardware this week.
>>> Seems to be doing fine for the devices and skin I use.
>>> With one exception, a RainMachine extension.
>>> There is one that was written by someone at RainMachine, but I think he 
>>> has moved on.
>>> I've asked there and raised an issue on the github page for the 
>>> extension with no response.
>>>
>>> How, besides installing v4 and the extension, can I determine if it will 
>>> run under v4?
>>>
>>> The extension is located at 
>>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>>> https://github.com/weewx/weewx/wiki/RainMachine
>>>
>>> With this functionality confirmed, I can make the change, without it 
>>> I'll need to stay with v3
>>>
>>>
>>> -- 
>> 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/wlufg8AdT0E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/e95133ce-4a77-43db-930f-facf0e73e5e8%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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/CALBRR-09JohVQPwKLeyHfVBW6DV1KdZOP5QhLzTm3ms01teygA%40mail.gmail.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/d3757f93-51d9-41da-9560-c0188f981109%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-18 Thread John Kline
I had a quick look.  It imports Queue (with a capital ‘Q’).  That will fail in 
python 3.
As such, this has not been ported.

As for an answer to the general question, there are tools available to convert 
code (2to3, modernize).  It usually requires more work than that, but you could 
run one of them on the code to see what it changes.  That would give you a good 
idea of whether it is already python3 ready.

Actually, a better way is just to read up on the subject.  When you do, it will 
be pretty easy to spot code that will run in 2 and 3.

> On Jan 18, 2020, at 8:39 PM, G Hammer  wrote:
> 
> 
> Seems that there should be a way to determine this as the change to Python 3 
> isn't just a WeeWX thing.
> 
> As for whether or not to run the beta, it's beta 8 and what I use seems to be 
> ok as far as reports go. Is it not what beta are for after all?
> 
> Anyway, not what I asked, so let's see what else comes.
> 
>> On Sat, Jan 18, 2020, 11:14 PM Andrew Milner  
>> wrote:
>> I do not think v4 has officially been released yet - so I would recommend 
>> installing the new hardware with 3.9 and do the upgrade when v4 is finally 
>> released.  That way you do not change the whole shebang - hardware and 
>> software - in one giant leap. Regarding 'how do you know' - the answer is 
>> that you don't!!  The original writer may update wike or download with 
>> additional information, or another user may post a comment, but there is no 
>> automatic verification process of all extensions written by other people.
>> 
>> 
>> 
>> 
>>> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>>> I'd like to run v4 when I upgrade hardware this week.
>>> Seems to be doing fine for the devices and skin I use.
>>> With one exception, a RainMachine extension.
>>> There is one that was written by someone at RainMachine, but I think he has 
>>> moved on.
>>> I've asked there and raised an issue on the github page for the extension 
>>> with no response.
>>> 
>>> How, besides installing v4 and the extension, can I determine if it will 
>>> run under v4?
>>> 
>>> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
>>> and referenced at https://github.com/weewx/weewx/wiki/RainMachine
>>> 
>>> With this functionality confirmed, I can make the change, without it I'll 
>>> need to stay with v3
>>> 
>>> 
>> 
>> -- 
>> 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/wlufg8AdT0E/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/e95133ce-4a77-43db-930f-facf0e73e5e8%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/CALBRR-09JohVQPwKLeyHfVBW6DV1KdZOP5QhLzTm3ms01teygA%40mail.gmail.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/05483DC8-FBBF-41AC-B9BE-CD9995301373%40johnkline.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-18 Thread Andrew Milner
why not ask the author of the extension then - if it is important to you to 
have the answer.  After all, the author is the person who should have the 
answer.  As to whether the author  has tested against the beta version 
depends very much upon the time available to the author of the extension I 
suspect.  I know the bootstrap skin and mesowx took some iterations after 
the introduction of I think weewx v3 before there were useable versions 
available - and the changes were actually made by another weewx user rather 
than the original author.  

On Sunday, 19 January 2020 06:39:25 UTC+2, G Hammer wrote:
>
> Seems that there should be a way to determine this as the change to Python 
> 3 isn't just a WeeWX thing.
>
> As for whether or not to run the beta, it's beta 8 and what I use seems to 
> be ok as far as reports go. Is it not what beta are for after all?
>
> Anyway, not what I asked, so let's see what else comes.
>
> On Sat, Jan 18, 2020, 11:14 PM Andrew Milner  > wrote:
>
>> I do not think v4 has officially been released yet - so I would recommend 
>> installing the new hardware with 3.9 and do the upgrade when v4 is finally 
>> released.  That way you do not change the whole shebang - hardware and 
>> software - in one giant leap. Regarding 'how do you know' - the answer is 
>> that you don't!!  The original writer may update wike or download with 
>> additional information, or another user may post a comment, but there is no 
>> automatic verification process of all extensions written by other people.
>>
>>
>>
>>
>> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>>>
>>> I'd like to run v4 when I upgrade hardware this week.
>>> Seems to be doing fine for the devices and skin I use.
>>> With one exception, a RainMachine extension.
>>> There is one that was written by someone at RainMachine, but I think he 
>>> has moved on.
>>> I've asked there and raised an issue on the github page for the 
>>> extension with no response.
>>>
>>> How, besides installing v4 and the extension, can I determine if it will 
>>> run under v4?
>>>
>>> The extension is located at 
>>> https://github.com/sprinkler/rainmachine-weewx and referenced at 
>>> https://github.com/weewx/weewx/wiki/RainMachine
>>>
>>> With this functionality confirmed, I can make the change, without it 
>>> I'll need to stay with v3
>>>
>>>
>>> -- 
>> 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/wlufg8AdT0E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/e95133ce-4a77-43db-930f-facf0e73e5e8%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/2c3c86a5-147b-482e-a0ab-72786453f2d2%40googlegroups.com.


Re: [weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-18 Thread G Hammer
Seems that there should be a way to determine this as the change to Python
3 isn't just a WeeWX thing.

As for whether or not to run the beta, it's beta 8 and what I use seems to
be ok as far as reports go. Is it not what beta are for after all?

Anyway, not what I asked, so let's see what else comes.

On Sat, Jan 18, 2020, 11:14 PM Andrew Milner 
wrote:

> I do not think v4 has officially been released yet - so I would recommend
> installing the new hardware with 3.9 and do the upgrade when v4 is finally
> released.  That way you do not change the whole shebang - hardware and
> software - in one giant leap. Regarding 'how do you know' - the answer is
> that you don't!!  The original writer may update wike or download with
> additional information, or another user may post a comment, but there is no
> automatic verification process of all extensions written by other people.
>
>
>
>
> On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>>
>> I'd like to run v4 when I upgrade hardware this week.
>> Seems to be doing fine for the devices and skin I use.
>> With one exception, a RainMachine extension.
>> There is one that was written by someone at RainMachine, but I think he
>> has moved on.
>> I've asked there and raised an issue on the github page for the extension
>> with no response.
>>
>> How, besides installing v4 and the extension, can I determine if it will
>> run under v4?
>>
>> The extension is located at
>> https://github.com/sprinkler/rainmachine-weewx and referenced at
>> https://github.com/weewx/weewx/wiki/RainMachine
>>
>> With this functionality confirmed, I can make the change, without it I'll
>> need to stay with v3
>>
>>
>> --
> 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/wlufg8AdT0E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/e95133ce-4a77-43db-930f-facf0e73e5e8%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/CALBRR-09JohVQPwKLeyHfVBW6DV1KdZOP5QhLzTm3ms01teygA%40mail.gmail.com.


[weewx-user] Re: WeeWX v4 I Need an Extension Verified/Checked

2020-01-18 Thread Andrew Milner
I do not think v4 has officially been released yet - so I would recommend 
installing the new hardware with 3.9 and do the upgrade when v4 is finally 
released.  That way you do not change the whole shebang - hardware and 
software - in one giant leap. Regarding 'how do you know' - the answer is 
that you don't!!  The original writer may update wike or download with 
additional information, or another user may post a comment, but there is no 
automatic verification process of all extensions written by other people.




On Sunday, 19 January 2020 04:46:16 UTC+2, G Hammer wrote:
>
> I'd like to run v4 when I upgrade hardware this week.
> Seems to be doing fine for the devices and skin I use.
> With one exception, a RainMachine extension.
> There is one that was written by someone at RainMachine, but I think he 
> has moved on.
> I've asked there and raised an issue on the github page for the extension 
> with no response.
>
> How, besides installing v4 and the extension, can I determine if it will 
> run under v4?
>
> The extension is located at https://github.com/sprinkler/rainmachine-weewx 
> and 
> referenced at https://github.com/weewx/weewx/wiki/RainMachine
>
> With this functionality confirmed, I can make the change, without it I'll 
> need to stay with v3
>
>
>

-- 
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/e95133ce-4a77-43db-930f-facf0e73e5e8%40googlegroups.com.