Meteotemplate 12.0 Orange

Meteotemplate 12.0 Orange

Hi guys,

I have just released a new version of the template – Meteotemplate 12.0 Orange! Some of you might think this is a rather very small update, however, in reality it is actually a major one and it was very difficult this time to prepare it – mostly because it did not depend just on me and I had to make sure everything is well co-ordinated and synchronized.

This update includes practically just bug fixes and one major new thing – a new API. If you want to read what the bug fixes are, they are listed at the bottom of this post, now I will talk about the API.

This new API now allows developers of software to built-in Meteotemplate updates into their SW. In practice this means you will only select Meteotemplate in the corresponding SW, specify your update password and that´s it. No CRON jobs, no set up in Meteotemplate, all working automatically.

In addition there are some other major advantages, so let´s just briefly look at those:

  • the API supports many extra sensors and parameters including unlimited number of extra temperature sensors, humidity sensors, leaf wetness, soil temperature, soil moisture, sunshine duration, levels of various gases, noise level, lightning etc etc. This can now all be optionally sent to the API and I can create blocks/plugins that will use this information
  • no CRON jobs – updates will be triggered by the SW directly using HTTP GET request (note: this is dealing with the updates, if you are using any extra plugins that require cron jobs, eg. webcam, notifications etc, you will still need a CRON job for that)
  • much higher reliability – using FTP is always problematic, it is unreliable and slow. HTTP GET request, which is what this API uses, is much faster and reliable. For example, this new API also supports sending data in packages (each sensor can send separately at different intervals and the data will be available in real-time as well as cached for the database) and this interval can be as short as 2 seconds (tested).
  • higher accuracy – the api script has been improved and for example precipitation is now calculated more accurately (the update script is slightly problematic when logging rain during the last 5 minutes of the day), wind gust should now exactly match the real maximum
  • nicely rounded timesthe api will save data to the database in nicely rounded times, eg: 11:00:00, 11:05:00, 11:10:00 etc.
  • error handling – improved data validation and error handling
  • API uses standardized units and variable names and is well documented in the wiki now, so any developer can easily create a script to update Meteotemplate or integrate it into their SW. People who know how to program and use some own system of getting data from their PWS can easily update the template now too.

These were just some of the advantages. One very important thing – after you update to v12, the original scripts for updates are still available so it is up to you when you decide to switch from update to API if whatever SW you use supports this.

As you can imagine, this time it was not just up to me, but I have already been in touch with several developers and we were working together on this, so here is some information about software support for SW whose developer I have been in touch with:

  • Meteobridge full support of the API, an update to your MB device is available, reboot your device
  • Weather Displayfull support of the API, an update of WD should be available now
  • WeeWx full support of the API using an extra package, already available for download
  • WeatherCat full support of the API (an update of WC will be available whenever Stu has time for this, the scripts are ready and it should be in a matter of weeks or max one month)
  • Cumulus – I have been in touch with Steve, but unfortunately Cumulus will not support the new API scripts

I have not contacted anyone else, but as mentioned above, the API is now fully documented in the WIKI so if you are using some other means of updates or getting data from your PWS, you can contact the developer and discuss it with them and of course also let me know so that I can add this information to the wiki for others.

If you are using one of the SW that will support the new API, then until an update is available and you install it, just leave everything as it is now. The template will be updated using the original update.php.

Then, once you switch to the api script, all you will have to provide is the API URL and update password.

  • API URL – is simply api.php and this file is in your template root folder, alongside indexDesktop, so the URL is something like …../api.php.
  • UPDATE PASSWORD – the update password specified in the Main settings.

After you do this MAKE SURE YOU DISABLE the CRON job. The updates will be triggered automatically by the SW and if you use the update.php it will make a mess in your database updates. Again, as mentioned above, we are talking about the CRON job that is updating your database (either update.php or the corresponding update script if you are using any of the plugins for updates – WeatherCat etc.). Do not disable any other CRON jobs you might have – the cron.php, updating your webcam plugin, notifications plugin etc. That should stay as it is now!

If you are using Meteobridge, you can then disable the original HTTP requests.


The API opens much wider potential for future blocks, plugins etc. This however required some changes in the way it saves data. What this means is that I will need to update those blocks and plugins, which use the realtime files – in particular I am talking about clientraw, mbLive and realtimeMT (WD, MB, WeatherCat). After you switch to this new API script, you need to change the update type of these blocks and plugins to “db”, so that they use your database.

This of course will only be temporary, I will update all the blocks and plugins as soon as I can, hopefully in a matter of days or a week max.

Bug fixes/improvements in v12:

  • menu check for available pages fixed
  • climate/index.php – bug fixes for missing values
  • install/setup.php – prevent autocomplete of the fields by the browser, which often overwritten the original MySQL details
  • annual report – fixed max values, fixed monthly rain values
  • climate analysis – optimization to prevent data overflow
  • mobile header – bug fixes
  • trends page – sparkline graphs fix
  • install/setup.php – improved compatibility with https pages
  • indexDesktop.php – fixed font color for menu blocks when using light theme
  • icons – added Davis Vantage Vue
  • header.php – fixed sunrise/sunset calculations
  • pages/astronomy/sun – fixed graphs (due to Highcharts update)
  • daily report – fixed number of decimal places for pressure when using inHg
  • update/testUpdate.php – fixed an issue when using custom file type update

As I said above, this was a difficult update, changing the update scripts is always potentially problematic and one has to make absolutely sure it works fine. Hopefully it will as it has been tested by several users, at this point I would like to thank (in particular order) to Luc, Brian (WD), Stu (WeatherCat), Matt (WeeWx), Arthur, Reinhard and Boris (MB) for their cooperation and help.

I have a full list of features to add, based on the January questionnaire, but I will leave those for v13. In this update I wanted to concentrate on the API to make sure it works perfectly.

Update instructions

Pretty simple – go through each folder and replace the existing scripts with the corresponding new ones. Make sure you do not delete the entire folders! Each folder in the update package only includes the updated files, which must be replaced individually.

Then lastly, copy the api.php into your server root folder (do this even if you cannot use the api at this point, it will not in any way influence your db updates and will be ready for the future). Also copy the .htaccess file (if you have not done so already as part of the bug fixes package), which will make sure your icons are working fine.

If you are using any of the above mentioned SW, which should support the API, first check if the update has already been implemented and if so, disable the CRON job, set the updates to the api script and hopefully the api will then start updating your db. If not, quickly change back to update.php and let me know and I will look at what the problem could be.

Meteobridge – once the update is available, you will need to reboot your device so that it loads it! You should then see Meteotemplate in the Weather Networks tab.

Make sure that the directory “cache” in template root is writable!

Downloading Files

As I mentioned yesterday, for downloading the update you will need a token. I will get back to you within 24 hours so please be patient. First come, first serve, but I have to make sure I do this in batches so that there is not too many people trying to download this at the same time and I also work every day so in case I just don´t see your email immediately, please be patient, I will definitely get back to you.

The other reason for this is that this update is potentially problematic, updates is something that just has to work, so in case I see any issues, I will immediately stop issuing the download tokens until the problem is resolved.



15 thoughts on “Meteotemplate 12.0 Orange

  1. Once you have sent us a token to do downloads, will that same token be used by us individually for all future downloads?

    For example I might not implement all the blocks or plug-ins and decide that something else might be cool to add, and then have to go through the token request again?

    Finally, I worry with the limited amount of time I have in making some changes that takes my web page off the air for an extended time, so I have left a functional earlier version on my server, got the new version working (when I did update) and only when everything was working well with the new install, switch my newest installation to be the main one.

    Will I still be able to install and test 12. or later and leave 10.0, for instance, still running on my web server?

    • Hi Dale,
      token is only valid for 24h, so you will need to ask for a new one. However, you only need this for template updates, blocks and plugins don’t require any tokens, so this is likely to be maybe 3-4 times a year when new version is released.

      Not sure I completely understand your second question. You can run as many MTs on one server as you want. If you connect them all to the same mysql, you just need to change the paths for each in the main settings.

      Also, don’t worry, for example, the update 11->12 took me 2 minutes to do in the demo and it should not take more than 5 minutes to you. It is only replacing a few files. Nothing more, all settings is preserved.

    • Hi,
      ok, then this does not support the api, so just use whatever update method you used until now. Don´t change anything. The API is only for users of Weather Display and Meteobridge currently.

    • Hi Michel,
      What is VP2SQL? I have never seen this. I need to know how you update your template now. Which program do you use to get data to alldata table?
      Weather Display? Meteobridge? Cumulus? WU? WeatherLink? NetAtmo? WeatherCat?

  2. This version is great news for the WeeWX users because now they can send their weather data directly to the new meteotemplate api with use of the weewx meteotemplate uploader (thanks Matthew!). Choose archive or loop data, whatever you want. Both full and partial loop packets are supported.
    Jachym, it was a great pleasure testing with you. Thanks!
    Cheers, luc

  3. I’ve updated to Orange and also WD10.37S43. All seems to working well. In WD – Control Panel there is a new option for Meteotemplate, this is where you place your update password and path to api.php. I’ve set it to update every 30 seconds, but it only updates every minute, not a big deal. Also in WD, in Control Panel – Web file/Web page Setup then Custom Web Page Setup/Meteotemplate I removed the path for the Cron Job.
    The one thing I see with Orange is in the Database Update. There is no save option/button when changing to API, then if I go back into Database Update, it reverts to WD-Old and must be changed back to API.
    I hope this make sense.
    Thank you for all the hard work!

    • Hi Ed,
      yes, you are right, but… this update setup is only used by the update.php, which is not used by the api, so whatever you put in update setup is now irrelevant.
      In fact, in the wiki I now said that if you can use the API, you can completely ignore all update setup in control panel of Meteotemplate

  4. Hi Jachym,
    this sounds very interessting! As soon this new release works without problems I intend to not only update from Avocado, but install Meteotemplate completely new from the scratch. Maybe waiting to release v13, to make sure all works smoothly.
    As you recognized, your update pace was partially a bit too fast for me, but the new api feature (if it works really) is a reason to make some improvments on my own server with a much better Meteotemplate…..hopefully it accepts https, serverside and db security configuration more naturally than before.
    Looking forward to try it out.
    Best regards,

Leave a Comment