Weather-Display Driver

Does anyone else use the weather station software Weather-Display? I have a Davis Vantage Pro2 with solar radiation and UV sensors personal weather station (PWS). I am working on a driver to pull my PWS data from my web server. The intent is that I will not have to upload my data to WeatherUnderground (or other sites) and then pull the data back from there to expose it to Hubitat. I found waynedgrant's work that makes the Weather-Display data files available in a JSON format:

From there I am writing a driver to expose that data to Hubitat. I started with @Cobra's excellent driver to pull WeatherUnderground data and I am altering that to pull the data from my web server's PWS data files instead. I have made some good progress, but have a long way to go. While I can get all current and historical weather data from my PWS data files, I believe I will still need to access a public source for any forecast data desired. Forecast data will be a 'phase 2' effort on this project.

Let me know if there is any interest in this and I will be happy to share once I make a little more progress. If anyone knows of an existing solution I would love to hear about that too.

Thanks.

1 Like

Very interested. I still have not setup weeWX, but this is what I've been hoping would become available for the community.

@Matthew
It looks like my pws doesn’t have support in weewx so I’m looking for an alternative.
I’ll have alook at this software to see if my station is supported.
If it is then I’m happy to help with the port of my driver.

Do you need to connect the pws directly or will it accept ip data?

Andy

Matthew, I am also running two versions of Weather Display, one that uploads to my online site and one that uploads to a local web server.

I would like very much to cooperate with you except ... I am a novice (even at 71 year old) with the Z-Wave/ZigBee technology and just finished installing/registering my new 'Hubitat Elevation' hub... :blush:

I will look at the GitHub 'json-webservice-wdlive' (the JSON formatted Web Service API) to familiarize myself with the PHP code.

Ray

1 Like

My PWS console has a IP data logger. That means it is connected to my home network and all the data is available over that network. The Weather-Display software reads the data output from the PWS consol and then saves the files to my web server (it could be any web server, not limited to one that you host). As long as you can access that file, on the local network or a local or remote web server, this solution should work.

1 Like

@Matthew
Do you 'push' the data from the PWS or does WD poll for it?

Andy

Not sure how to describe that? I think both. The PWS consol is constantly updating, I think about every two seconds. Weather-Display is connected via the IP:port of the consol and it shows those updates real-time and then save files with the current readings at a frequency that you can set. I use the popular Saratoga template for my weather website. If you look at my PWS website Superior Weather you will see it updates about every 10 seconds.

So did you program your wps to ‘send’ the data to WD?

The reason I ask is that My PWS is capable of sending data to servers other than WU bit I don’t think it will accept connections.

Andy

I did not program the PWS to send the data to the network..... that is a built-in function of the IP data logger. The IP data logger is a cable attached to he PWS console that also connects it to the local network via ethernet. That data logger broadcasts the consol readings over the network. Weather-Display is configured to listen for those broadcasts and collects the data to both display in real time on its interface on the PC and to save to data files on the local network or public network through FTP. Weather-Display can also transmit the data to WU and many other weather aggregator sites (CWOP/WeatherBug/WOW/AWEKAS/etc...). You just need to configure the software to turn on those abilities and provide any user login information those sites may require. So my software, Weather-Display, handles all of my data submissions, not the PWS. I do think my PWS (Davis) is capable of sending data directly to their own site (weatherlink.com), but I do not use that ability.

Does that help?

First version of the driver is presented below. Some notes:

This uses the Weather-Display data files from a webserver you specify in the driver preferences. I used waynedgrant's work to make those data files available in JSON format on my webserver:

I did have to alter one file as the 'time.php' file was hard coded for uppercase meridiem designators and my Weather-Display presents those as lowercase. Other than that I did not make any other changes to his work.

The driver allows you to choose to use the Weather-Display variable or the Weather underground variable where both exist. So, if you have a solar radiation sensor you can choose to use your own reading, or if you do not have sensor your can choose a WU station that does and pull it's solar radiation reading. There are a handful of variables you can make this option for.

The polling in this version is the same timing for both the Weather-Display and the Weather Underground polling. I did try to have separate settings for each, but I could not get that to work. I would prefer separate readings as I will only use WU for forecast data and that does not change often so longer polling is more than acceptable. However I want frequent readings from my Weather-Display current readings.

I have not done thorough testing of this, so please use with caution and report any issues. Let me know what you think. Thanks.

1 Like

I decided to make a version of the driver that uses APIXU.COM instead of WeatherUnderground. I know you can't get a new free WU API key and this will give mostly the same capabilities ... for free. You will need a APIXU.COM API key (free). If WU ever takes away the free API option for those of us with an existing API .... this will be a good alternative.

I could not add 'Chance of rain' (or PrecipPercent) because in APIXU that is only available in the paid version. I also did not see either Solar Radiation or Illuminance ... so those are not choices. Of course, if your Weather-Display PWS has those sensors then use can use those.

Again, not much testing of all the options has taken place. Let me know if you find something that needs fixed.

2 Likes

Well ... anything worth doing is worth over-doing ... I always say. I have re-done both of my Weather-Display drivers. They are both very similar. The only difference is that one uses WeatherUnderground and the other uses APIXU as the online API data source. A brief write up is below ... including attributions to significant contributors/authors that I learned from to compile this code, Special thanks to @bangali for his work on the APIXU.com API sections. This work would not have been been completed so quickly or elegantly without that effort. Thank you.

Many people contributed to the creation of this driver. Significant contributors include
@Cobra who adapted it from @mattw01's work and I thank them for that! A large 'Thank you'
to @bangali for his APIXU.COM base code that some of this was adapted from. I learned a lot
from his work and incorporated a lot of that here. With all of that collaboration I have heavily
modified the code myself: @Matthew (Scottma61) with lots of help from the Hubitat community.
This driver is intended to pull data from data files from a web server created by Weather-Display software
(http://www.weather-display.com). It will also suppliment forecast data from WeatherUnderground (WU)
(http://www.wunderground.com) or from APIXU.com. You will need your WU/APIXU API key for this to function.

There are three main sets of weather variables exposed. The prefix 'wd' is for Weather-Display variables. The prefix 'wu' are fore WeatherUnderground ( or 'xu' for the APIXU version) variables. No prefix are for what you can use as 'defaults' based on your selections in the driver. These are redundant, but are intended to prevent you from having to change your variable name to select the data you want. The driver exposes both metric and imperial measurements and the full compliment of Weather-Display and WeatherUnderground/APIXU data (free versions) are available, so pick what you wish.

The driver has some options to allow you to choose to use the Weather-Display variable or the
WeatherUnderground/APIXU variable where both exist. So, if you have a solar radiation sensor you can choose to use your own reading, or if you do not have solar sensor your can choose a WU station that does and pull it's solar radiation reading. There are a handful of variables you can select with this option.

Again, not much testing of all the options that are available has taken place. Let me know if you find something that needs fixed. Hope you find the driver, or the code, useful.

2 Likes

I corrected and issue with the scheduler late last night night. If anyone did copy the code in other versions prior to then, I suggest you refresh it now, or your updates may not be working as you expected them to.

Corrected. re-copy the GitHub and try again.

Scrubbed the code on the APIXU version. Corrected multiple bugs and ensured that the variables exposed are consistent. New version posted on GitHub version 1.3.0 Will make the same change to the WU version when I have time.

WeatherWunderground version 1.3 updated with same changes mentioned above. On the same GitHub.

Both versions updated to 1.3.2 There was just too much data presented, even for me. There are now options to 'Present' data for the APIXU/WeatherUnderground and Weather-Display variables. You can choose to not present (show) them (default) and just show the resulting variables based on your selections.

1 Like

Both versions updated, again, to 1.3.3 Added a Date-Time format selector. All dates and times will be returned in the format selected in the driver.

Both versions updated to V1.3.4. Reorganized selectors so that Sunrise & Sunset are now under one called 'Astronomy', City & State are now under one called 'Location', and the Weather Summary Formats were eliminated. The weather summaries will use the Display Units selected automatically so no separate selector is necessary.

Let me know if you see anything that doesn't look right. Thanks.

Both versions updated to V1.3.5. This updates the illuminance/Lux calculation based on @bangali's most recent update to his APIXU driver. I tried to replicate that for the WunderGround driver as close as possible but I did have to use different condition results that were available in the WU data. I have not extensively compared the resulting Lux calculation between APIXU and WU, but they are reasonably close in the few observations I have made.