Weather-Display Driver

@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.

Updated both versions to V1.4.0 I decided to not show all possible measurements and instead only show the units that were selected in the driver (F or C, In or mm, Kph or Mph, etc....) This significantly reduced the number of lines in the code and makes the 'Current States' presentation much more readable. All data available can still be seen in the log if that option is selected.

I have incorporated a logging filter (substantially taken from @Cobra 's code, Thanks!) so you can choose to see more detailed logging for debugging or general information, but then you can turn that off for a greatly reduced logging level when things are running well.

1 Like

Both WU and APIXU versions updated to V1.5.0 with various improvements and bug fixes. Adapted @bangali's implementation of the code contribution from @jebbett to use some cool weather icons.

Updated both APIXU and Wunderground driver versions so that the icons are being pulled from my github repository (so I do not burden or use any resources from @bangali's file location). I recommend anyone using these drivers download the icons to their own location and update the driver to pull from there.

Enjoy.

1 Like

I have started a new thread for the new, improved driver version. The old one will remain, but will not be updated/developed further.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.