Menu

Home

Tony Sutton

Introduction

ts-WeatherData.ps1 is an Powerscript file developed by Tony Sutton that can pull weather data from WUnderground's weather xml feed and outputs into a text file. This also pulls the current weather condition image file too.

This can be used for overlays for your webcam images, for example via Blue Iris however can be used with any software that allows you to add this data via Overlay editor.

Requirements

  • Operating system that support Powershell
    Powershell installation - see Microsoft's Windows PowerShell webpage (link URL) if you need to install it.
  • Your own wunderground API Key - link URL

Setting this Up

Download ts-WeatherData.ps1 from the 'Source' of this project. Save it in somewhere where it has full read/write permission. I saved mine in My Document folder named ts-WeatherData on my D drive so you wouldf have this as a full path to the powershell file i.e.

D:\My Documents\ts-WeatherData\ts-WeatherData.ps1

Now before you use this, you will need to get your own wunderground API Key to allow you to pull data from wunderground server. To do that, go to http://api.wunderground.com/weather/api/ and click on "Sign up FREE!" button. You will only need the Developer account.

Once registered, grab your API key and using Notepad, edit the .ps1 file you've downloaded.

Look for XXX_YOUR_KEY_XXX under "Enter your data" section - replace it with your own key.

To ensure this works, you need to test this. Go to Start -> Run and enter this line, ensuring that you replace the path with your own path:

powershell -ExecutionPolicy ByPass -File D:\Downloads\ts-WeatherData\ts-WeatherData.ps1

If this has worked, you would see two new files being created. They are:

  • condition.gif
  • WeatherData.txt

in this same folder as the script file. If you do see them, then your set up has worked! Don't forget to set your Country and City while you're editing the file.

= Adding the text overlay in Blue Iris =

As mentioned earlier, this can be used with any software with an Overlay editor, however since I am using Blue Iris, here is the steps to add this. To ensure the steps are the same as to what you are seeing, I am using Blue Iris v3.35.04.

Open up Blue Iris, go to Options and click on the Macros tab. You should see a list of macros. Click on a field of the next available & blank macro -> click on "Set to file...". Find the output file whch is the WeatherData.txt file. Once selected, click the OK button to save it.

In this example, the %1 macro looks like this:

file://D:\My Documents\ts-WeatherData\WeatherData.txt

Click the OK button to save this.

Now, you need to add this to the camera view. Right click the screen of the selected camera you want to add this to and select Camera Properties. Click on the Video tab, you should see the Text and Graphic Overlays section -> click on Edit button.

Click on Add text/time button and on the top field, type in %1. This is where you should see the weather data in the Preview box. Edit the font, colour, size, etc to your requirements. When you've finished with it, click the OK button to save it.

From this point, you will need to move the overlay to where you want to set it to. I put mine at the bottom, right corner. Finally when you're happy with where it is, click the OK button.

The screen will reset and the text overlay will show up.

Adding the graphic overlay in Blue Iris

This method is very similar as above but you use the "Add Image" button - this will bring up the Select graphic file window. You will find the file in the same location as where the script is. As an example, this is my location:

D:\My Documents\ts-WeatherData\condition.gif

Once selected, ensure that you have the "Constrain Proportions" and also "Use transparent colour key" are checked. Click the OK button to save it.

Move the graphic overlay to where you want it to show up. I put mine at the bottom, left corner. Finally, click the OK button to save it.

The screen will reset and the graphic overlay will show up.

Known Issue

The only known issue that I am aware of is that the graphic overlay may disappear now and then while viewing it in the editor still have it showing up. I believe this is a bug with Blue Iris v3.35.04 and I am in discussion with the developer to see if this can be resolved or another way round.