On 29/08/17 15:41,
atrophi...@gmail.com wrote:
> It would appear that I have my pywws uploading to weathercloud with
> several items being logged. However before I share my works I'd like to
> refine it a little and confirm a few things.
>
> My .ini file has the [config] section as below, with pywws sending the
> data using a 10min cron set up in the weather.ini file;
> |
>
> [config]
>
> url =
http://api.weathercloud.net/v01/set
>
> auth_type = http
>
> catchup = 0
>
> result = []
>
> use get = True
>
> interval = 0
>
> |
> So can I improve the following.
>
> * Weathercloud accept at 10 minute intervals only, should the interval
> in the config be set to 600 instead? If so should this service then
> be placed under [logged] in the weather.ini
Yes, set the interval to 600 (or 590 to have a margin), but don't worry
about which section in weather.ini you add the service to. The interval
setting ensures data isn't sent to frequently.
> * Weathercloud has 4 return codes, I'd like the text string to show in
> the log file instead of the number, I couldn't understand the
> examples in other service.ini files
It's a bit of a cludge using a list of regular expressions to match each
line in the text response. Well designed servers that make proper use of
error codes are easier to handle.
> A couple of values I'd like to include in the template file are
> the average wind speed & average wind direction (10-min average values).
> And the highest wind speed (10-min maximum gust of wind). I know I can
> use the #calc # expression but unsure if it then needs a #loop # or
> #goto # expression?
Using #calc# on anything but the current record is difficult. You can't
use a loop or goto to accumulate results.
> One final though at this time, Weathercloud needs a version number when
> uploading data, I've currently hand written my pywws version in the .ini
> file but can I pull this from the installed pywws to cater for other
> versions being used?
There isn't currently any way to do this as far as I can tell.