lightmaster / Meteobridge-Weather34-Template

Github repository for the Meteobridge version of the weather34 template
Other
18 stars 10 forks source link

Sunshine hour #65

Open Rob3r7o opened 4 years ago

Rob3r7o commented 4 years ago

Hi, there is a way to know the sunshine hour for a day/month/year? I think it's possible with the solar sensor and i really hope that with some script we can have this. Thank you so much for your work.

Rob3r7o commented 10 months ago

Hi lightmaster, I'm not a programmer. I did this job in a year for my weather station The my idea is: a sunshine.php file that contains the code to process the sun absence/presence limit, based on the coordinates of the weather station, using a mathematical formula and the solar radiation value.

Then the data is saved in a database (sunshine) every minute 1= sunny 0=cloudy.

The sunshine.php file is launched by meteobridge every minute.

modification of the sun3.php file (daylight/darkness) to display the hours of sunshine. The file accesses the sunshine database and counts the hours:minutes of sunshine. Furthermore, if the sun is shining the graphics will be a strong yellow dot. If the sun is in shade then it will be a semi-transparent yellow dot.

edit the setting.php file to make the daylight/darkness pane update every minute.

modification to the css/main.light main.dark file to have the word "sunshine"

use the sunplot.php file to get the graph of the hours of sunshine. The sunplot.php file (file used for weathercat) accesses the database and presents the sun's parabola with the sunny/cloudy hours on the screen.

Use the emptySunshine.php file in meteobridge to empty the sunshine database at the end of the day.

Things I couldn't do: It would be better if at the end of the day the emptySunshine.php file counted the hours:minutes of sunshine and saved them in a local file. Have some type of monthly, yearly solar chart.

To get an idea of what I'm talking about you can visit my site www.menoventi.hu

I wrote all the code in php so it's possible there are errors or better ways to do the calculations.

The only file I got online is sunplot.php. It's a file taken from the weathercat forum.

I tried to use the variables used in our settings.php so that there is nothing to configure. Copy the files and everything should work.

I also created a sunshineTest.php file that just does a test and presents all the values on the screen, to make sure everything is working well.

The mathematical formula inside sunshine.php/sunshineTest.php must be modified by the user to adjust the sun limit.

There are three values that can be changed: First a general value (I started from *0.6) to adjust the sun limit. After we can adjust other 2 value for adjust the sun limit before 8am and past 14.

I would like to share my work. If you or anyone else is interested I can attach the files.

Thank you. Roberto Liguori

lightmaster commented 9 months ago

Hey. Firstly, I've got a lot on my plate in my personal life with the holidays coming up. Can we address this after the new year?

I did take a look at the sunplot on your site. A couple of things I noticed that would need to be addressed before being implemented, most of which I also notice are missing on your AQI popup. 1st, add the header to the top of the popup frame (see Aurora's header). 2nd, adjust the colors used in sunplot.php to match the overall color scheme of the template. For instance, could use the blue used in the rainfall parts (#3b9cac) for the blue of the sky. 3rd, shrink the sunplot a little bit and add the border around it that the other popup frames use.