Looking for a daily graph for site

Many moon ago, I was able to get a daily graph of my wx station from WU and put it on my site. The graph looked like this:

Once WU killed the graph downloads, I put the graphs from my wx software (Weather Display) on my site. But I don’t like them, they’re blurry and all the info is on top of each other in the bottom pane:

Anyone in the braintrust know of a website or a piece of software that will give me a daily graph of my wx station conditions in separate chunks (like the WU graph) that I can upload to my site?

thanks…

…joe kd2qbk

Create your own using jpGraphs? They’re are various topics on the forum about doing that as well as some examples of I recall correctly.

Yes take a look at https://discourse.weather-watch.com/t/new-version-of-the-jpgraphs-for-wd-using-clientraw-data-wxgraphs-zip/63039 which is a set of graphs created for WD, you can install any or all of them to display your data from the clientraw files.

Stuart

I use Highcharts with WD data for my real-time and daily graphs like this these: Clayton, NC Weather - Daily Statistics (wxdoc.info), Clayton, NC Weather - Realtime Charts (wxdoc.info), Clayton, NC Weather - Realtime Charts (wxdoc.info). With Highcharts you can customize the look of the graphs.

The only thing I would add is that Highcharts require the user to have a license to use them. It is free for personal use but requires annual renewal which is not automatic.

Stuart

Correct and it’s free as long as you’re using it for non-commercial means such as any activity that does not result in a for-profit product and it’s limited to educational purposes and personal use.

Certainly its graphics have higher quality than those made with jpGraphs. I would like to know how to implement them, but I know that it is not easy. Any tutorial?

Thank you

I don’t have a tutorial - I just looked at examples from various websites by doing an internet search for what I was trying to accomplish with Highcharts. For me, it was a multi-step process starting with creating text files in WD with the parameters I wanted to plot, writing PowerShell scripts to manipulate the data into .CSV files for Highcharts to read, and finally plotting the data with Highcharts via PHP scripts. I think a lot of that manipulation can be avoided if you have implemented a database - then it’s easier to create the Highcharts graphs more directly. I could never get the database in WD to work, so I did things the hard way!

An easier way to start would be to duplicate my real-time charts (Clayton, NC Weather - Realtime Charts (wxdoc.info)) that use WeatherUnderground data for which I use a PowerShell script to grab the data, sort it, save is as a clean CSV file, and plot the data with Highcharts in a PHP file. If you have WeatherUnderground data on your webpage, this might be the best way to get started. I can provide the PowerShell and PHP scripts if interested.

I am a fairly limited user in knowledge, I don’t know if I would be able to do it, maybe with your help. I have data in weather underground yes. I gladly accept those scripts.

Thank you very much in advance

Okay, let’s go one step at a time. The first part of my process is to access the WeathreUnderground data from your own website using the attached PowerShell script
realtime-charts.txt (3.6 KB)

Change the filename extension from .txt to .ps1 and open it with Windows PowerShell ISE to edit it.

Line 15 will be the location of your data on your website: $url=“https://wxdoc.info/WXDailyHistory.php?ID=KNCCLAYT275$filename

Change the URL to your website and the ID to your WeatherUnderground ID.

Line 18 is where the downloaded file will be saved as a .csv file:
$path=“C:\realtime$yr$mn$dy.csv”

Create the directory C:\realtime on your PC

At line 32, I start saving files to my server, which is a NAS computer on my home network to this path: \lightning\web\realtime. You can either change the path to a location on your PC (like C:\realtime) and then upload all the CSV files to your server at the end of the script or upload each file to your server as the script runs. Lines 45-69 create all of the CSV files for the different parameters to graph. I would think that you should save/process each file on your PC as the script runs and then at the end upload all of them to your server.

I don’t know the ftp command in PowerShell to upload all the CSV files, but I’m sure you can find that with an internet search or ask on the forum.

Let me know if you have questions and once you can create, save, and upload the files to your server then I can help with creating the charts.


Return to the topic after returning home from vacation.
Well, as you tell me, we are going little by little. I hope you have patience with me, since I have no knowledge of PHP programming. I have the script on the PC and I have modified the lines of code as you indicate. I guess I should run the script, I’m not sure, but when trying to do it it seems that my PC running Windows 11 has some kind of protection against this.

What do you suggest?

PHP is unlikely to run directly on Windows. It needs to be run on a web server. Try copying the PHP file to your web site and then acccess it using your browser.

Yes, when you run a PowerShell script sometimes Windows will tell you that you don’t have permission to run it. I do remember that happened to me but I don’t remember how I got it to run. A quick Internet search indicates running this command at the Command Prompt will remove the restriction:

Set-ExecutionPolicy Bypass

If that doesn’t work, I found other options - just do a search for “How to enable execution of PowerShell scripts”.

[quote="novawx, post:10, topic:73977


Well friend, I don’t know if I will have the patience to put up with my limited knowledge.

Indeed, as you indicate, the permissions error has been solved.

Now I think the error I’m getting now tells me that the WXDailyHistory.php script is not found on my server.

What do you propose to me?

I get the same 404 error when I run the code for your website. You need to have the Weather Underground data from your weather station on your server using Ken’s WU-History script. That will download the Weather Underground data to your server as it shows on my website: Clayton, NC Weather - WU Station History (wxdoc.info).

Done, I have installed and configured the saratoga script for weather underground.

Subsequently, I executed the realtime-charts.ps1 script under PowerShell, it did not give a single error and I imagine that it has fulfilled its function, since in c:\realtime several files with a csv extension have been created.

I am not very clear if I should upload these files to my host where my website is stored. I await your instructions. Thank you

Excellent! Yes, you need to upload the CSV files except temp.csv to your website when you run the PowerShell script, so let’s get that working.

  1. Create a folder on your website called realtime.
  2. Add this code for each CSV file to the end of the PowerShell script and replace File.csv with each CSV filename (HR.csv, P.csv, etc.)
$publishUrl = "https://meteosanjuan.com/realtime" 
$filePath = "C:\realtime\File.csv"

Invoke-WebRequest -Uri $publishUrl -Method POST -InFile $filePath
  1. When you have successfully uploaded the CSV files with the PowerShell script then use a scheduler program on your PC (I use System Scheduler - Splinterware - Scheduler), to create a schedule to run realtime-charts.ps1 every five minutes.

Let me know when you have this working or if you have any problems. The next step will be to create the HighCharts PHP scripts.

Hello, after a week of hard work and problems with the change of hosting of my website and although my intention was to resume this work, it has been impossible for me to do it before. Please excuse me.
I have followed your instructions and have added to the PowerShell script what you have indicated, although I have had doubts about doing it with some CSV, for example 20240825.csv.
Also, within the script I upload the CSV files
I attach an image with the lines of code added to make sure we are on the right track.

Although I could have used the Windows task scheduler, I have done what you indicated, that is, scheduled the task under Splinterware and it is already working.
Let me know if everything is correct, don’t be in a hurry, we are moving forward little by little. It is better for a less advanced user like me

I see the CSV files are being uploaded to your website but they are empty files. Looking back at screen capture from your post from 20 Aug, the file sizes are 0KB. For example, the temperature file should like the one I’ve attached (just change the filename extension to .csv and you can view it tin Excel). Plus, a complete file for the day, like 20240826.csv should be about 44KB and yours is 1KB. I’m going to send you an IM with my email address and ask you to email me your ps1 script and 20240826.csv file.

T.txt (2.4 KB)

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