Author Topic: Meteotemplate  (Read 137610 times)

wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Meteotemplate
« Reply #390 on: April 17, 2017, 11:00:24 AM »
Question
Will the API work with HTTPS as the transport rather than HTTP? (haven't tested yet, but my production site is all HTTPS (http being redirected to HTTPS if used)

I can confirm that it is working on my HTTPS site.
Reinhard


jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #391 on: April 17, 2017, 12:51:52 PM »
Wait is over

 [cheer] [cheer] [cheer] [cheer] [cheer]


Woot!

Just updated WeatherCat and tested the API function on my test site ... works great!

one question - from the wiki:
Quote
The URL of the API script is simply the URL of your template folder and api.php. The api.php is in the template root folder. You then set the interval, the database will be updated every 5 minutes, but you can set the interval of calling the API to something shorter. The API script will cache the data and update the database every 5 minutes using aggregated data from the cache file. This is also advantageous because upon each trigger of the API script, a file of current conditions is saved.

Assumptions
1) the cache file is in cache/apiCache.txt
2) Current version of WeatherCat released with the API does not provide the ability to change the API call interval that I can find - anyone know what the interval default is, or how to change it
2a) assuming the interval is set in a plist file somewhere and could be modified to 1m and then would get an updated apiCache.txt every 60s and the DB would get updated by the API ever 5m

Question
Will the API work with HTTPS as the transport rather than HTTP? (haven't tested yet, but my production site is all HTTPS (http being redirected to HTTPS if used)

Hi,

HTTPS - should not be an issue

Interval - the way this works is:
you can call the api.php at any interval (must be less than 5 min though), one user uses even just 2s, but for that you have to make sure your server can handle this.

Each time the api is called, a "live" file is created -  used for all live blocks, gauges etc. Then it checks if it is time to update the db (5 min), if not, it saves the data to the apiCache. Then once 5 minutes passes, it aggregates and processes the cache, updates the db and clears the cache and the process repeats.

The interval at which you call the api.php is something you should be able to set in WC - or at least thats what I told the developers, including Stu. This is how it works. I do not have WC so I cannot check if that is really how it works - all I can say is - hopefully yes :D

jhoke

  • Gentle Breeze
  • **
  • Posts: 56
  • this space for rent
    • EW5604
    • KPAALBRI11
    • Indian Mountain Lakes - Carbon County Weather
  • Station Details: Davis Vantage Pro2, MacMini (i5 2.5Ghz 4GBRam 500GB HD, 4TB attached storage), other bits coming soon (UV, etc)
Re: Meteotemplate
« Reply #392 on: April 17, 2017, 02:09:22 PM »
Thanks Jachym

So currently the WC Api setup does not provide an interval setting - something hopefully we can get added in a future update (and a pointer to where it can be manually changed in the plists )

in regards to HTTPS ... in testing I am seeing a small issue calling (at least) the google font api - it is hardcoded in the CSS as HTTP and is throwing a bunch of errors in Javascript console

Quote
Mixed Content: The page at 'https://nepaweather.com/indexDesktop.php' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,latin-ext'. This request has been blocked; the content must be served over HTTPS.

As you can call HTTPS external resources from an HTTP page (IIRC) would it make sense that if the API supports HTTPS to migrate these over to HTTPS rather than HTTP?

As you can see, I am migrating from http://weather.hoke.org/meteo/ to https://nepaweather.com/

**slowly**


wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Meteotemplate
« Reply #393 on: April 17, 2017, 02:43:44 PM »
jhoke,

within the Meteotemplate distribution you will find a folder called "css" and within this folder a file called "main.php". I changed all the http to https and it is working.
Reinhard


jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #394 on: April 17, 2017, 03:05:48 PM »
OK, if the interval setting is not there it is not ideal, it should have been, I have to email Stu to add this

jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #395 on: April 17, 2017, 04:47:36 PM »
jhoke,

within the Meteotemplate distribution you will find a folder called "css" and within this folder a file called "main.php". I changed all the http to https and it is working.

I know about this issue, it will be ok in v14

wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Meteotemplate
« Reply #396 on: April 17, 2017, 06:04:24 PM »
jhoke,
by the way: I sorted out all blocks on the startpage of Meteotemplate that does have no support for https (getting info/content from http sources) so that I now have a clean https startpage. Some of my Plugin pages are not https, but the content of external sources is in some cases not available as https.
For example I removed the Meteogram-block and created a Meteogram-Plugin instead to reach the goal of my "clean" https startpage (although on calling the plugin page you will get a "not-https-page" returned). So in this way it is at least possible to put non-https-content on an extra page.
Reinhard


jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #397 on: April 17, 2017, 06:16:26 PM »
Hi,
I did fix several occurrences of http for https in the upcoming v14 release.

Blocks + plugins will be dealt with later.

Though in some cases it is not possible - if the external source is only available over http, there is nothing I can do. For example the Asteroids page is only available via http and so will never work in https mode unless they change it at the source side.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: Meteotemplate
« Reply #398 on: April 17, 2017, 06:34:39 PM »
Assumptions
2) Current version of WeatherCat released with the API does not provide the ability to change the API call interval that I can find - anyone know what the interval default is, or how to change it

It updates at one minute intervals - this isn't modifiable as when designing it, and in discussion with Jachym, it was agreed this is the best interval to use.

(Note: The manual says it updates every 5 minutes, this is an error in the manual )

Cheers.

jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #399 on: April 17, 2017, 06:41:55 PM »
Hi guys,

yes, if WC uses 1 minute then this is the recommended interval and it is fine. It would be a problem if it was 5 mins, but this is perfectly ok and probably the best compromise between data age and server load.

This means your live gauges, blocks etc. will be updated minutely and api updte your db when 5 data sets are in the cache.

Thanks Stu

jhoke

  • Gentle Breeze
  • **
  • Posts: 56
  • this space for rent
    • EW5604
    • KPAALBRI11
    • Indian Mountain Lakes - Carbon County Weather
  • Station Details: Davis Vantage Pro2, MacMini (i5 2.5Ghz 4GBRam 500GB HD, 4TB attached storage), other bits coming soon (UV, etc)
Re: Meteotemplate
« Reply #400 on: April 17, 2017, 10:45:40 PM »
Stu/Jachym

Thanks both of you ... 1m is what I would have set to ... just got caught off guard with btwn the info @ Meteo Wiki and the Docs from WC ..


wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Meteotemplate
« Reply #401 on: April 18, 2017, 11:27:48 AM »
Stu/Jachym

Thanks both of you ... 1m is what I would have set to ... just got caught off guard with btwn the info @ Meteo Wiki and the Docs from WC ..

Don't mention it!  ;)
Reinhard


jhoke

  • Gentle Breeze
  • **
  • Posts: 56
  • this space for rent
    • EW5604
    • KPAALBRI11
    • Indian Mountain Lakes - Carbon County Weather
  • Station Details: Davis Vantage Pro2, MacMini (i5 2.5Ghz 4GBRam 500GB HD, 4TB attached storage), other bits coming soon (UV, etc)
Re: Meteotemplate
« Reply #402 on: April 18, 2017, 12:13:32 PM »
So ... new domain and install of MeteoTemplate ... still working out some kinks due to HTTPS but ...

https://nepaweather.com/

Updated versions, plugins, blocks and using API flawlessly - thank you Stu and Jachym for making this available :)

Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Meteotemplate
« Reply #403 on: April 18, 2017, 04:41:35 PM »
John, just looked at your new site. Clean and fast. Nice work.
Blick


jachym

  • Strong Breeze
  • ***
  • Posts: 210
    • Meteotemplate
  • Station Details: WH1080
Re: Meteotemplate
« Reply #404 on: April 18, 2017, 04:48:34 PM »
John, just looked at your new site. Clean and fast. Nice work.

I second that