maxSolarRad not available

176 views
Skip to first unread message

Peter Leban

unread,
Jul 25, 2019, 1:26:51 PM7/25/19
to weewx-user
I have 2 weather stations using weewx (3.9.2): weatherflow and vantage vue. I've installed pyephem and added maxSolarRad database field in both setups.
However, the maxSolarRad is not working in setup with vantage vue (shows N/A). This station does not provide solar radiation value but I tend to calculate it from the jar temperature. But I need a maxSolarRad. Is the maxSolarRad provided only with stations that have the solar sensor, or?

vince

unread,
Jul 25, 2019, 2:03:24 PM7/25/19
to weewx-user
On Thursday, July 25, 2019 at 10:26:51 AM UTC-7, Peter Leban wrote:
I have 2 weather stations using weewx (3.9.2): weatherflow and vantage vue. I've installed pyephem and added maxSolarRad database field in both setups.
However, the maxSolarRad is not working in setup with vantage vue (shows N/A). This station does not provide solar radiation value but I tend to calculate it from the jar temperature. But I need a maxSolarRad. Is the maxSolarRad provided only with stations that have the solar sensor, or?


You added a field to your db.  Do you have data in that field in your archive records ?

Try something like "select dateTime,maxSolarRad from archive;" or the like (untested) to verify you have actual data to report.  It's possible your skin only reports data if there are elements in the db that are other than null

Peter Leban

unread,
Jul 25, 2019, 2:09:16 PM7/25/19
to weewx-user
I have a custom html template that contains sunrise, sunset times and maxSolarRad and radiation.
With WF setup, all values are populated.
With Vantage Vue, there is no value in radiation, N/A for maxSolarRad and normal data for sun rise/set.
Same template for both setups.

gjr80

unread,
Jul 25, 2019, 2:30:00 PM7/25/19
to weewx-user
I suggest you run WeeWX directly (http://weewx.com/docs/usersguide.htm#Running_directly) and check the loop packets and archive records displayed on screen for maxSolarRad. If maxSolarRad is None then there is a fundamental problem that has nothing to do with the database. maxSolarRad only pre-requisites are pyephem and station lat, long and altitude. I suspect you have station last, long and altitude set correctly in weewx.conf so I would be double checking pyephem is properly installed. At the command prompt type the following sequence of commands:

$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
>>> quit()

If no errors where thrown by python pyephem is installed fine.

Gary

Peter Leban

unread,
Jul 25, 2019, 3:19:52 PM7/25/19
to weewx-user
I confirm the maxSolarRad is "None". How shall I proceed? Is this because Vantage Vue doesn't have a solar sensor and weeWX doesn't want to calculate any solar-related parameter?


Dne četrtek, 25. julij 2019 20.30.00 UTC+2 je oseba gjr80 napisala:

Peter Leban

unread,
Jul 25, 2019, 3:21:46 PM7/25/19
to weewx-user
And the ephem plugin doesn't return any error. I checked and I have python 2.7 and 3 installed. Is this a problem?

Dne četrtek, 25. julij 2019 21.19.52 UTC+2 je oseba Peter Leban napisala:

vince

unread,
Jul 25, 2019, 7:12:36 PM7/25/19
to weewx-user
On Thursday, July 25, 2019 at 12:19:52 PM UTC-7, Peter Leban wrote:
I confirm the maxSolarRad is "None". How shall I proceed? Is this because Vantage Vue doesn't have a solar sensor and weeWX doesn't want to calculate any solar-related parameter? 
 

I'm still a bit confused about what you're doing.

Are you generating the data for the new field you added and 'you' are making the data getting into the database ?

Or are you adding a field and expecting weewx to magically populate that field in your database (how would it know what to do) ?
 

peter

unread,
Jul 26, 2019, 1:05:34 AM7/26/19
to weewx-user
Apologies for confusion. Longer explanation:
Setup 1 (WF station with solar sensor): read 'radiation' from WF station, compare it to maxSolarRad. Based on the ratio, I decide whether the sky is sunny (radiation/maxSolarRad =~1), partly cloudy (radiation/maxSolarRad =~0.5), cloudy (radiation/maxSolarRad =~0.1), etc.
Setup 2 (Vantage Vue with no solar sensor): I read temperature from a jar (store it as 'extraTemp1') and compare it to outTemp. My result is dT=extraTemp1-outTemp. On a sunny day at noon, the expected difference is ~15 degC. I want to compare the dT against the current maxSolarRad value in order to get approximate 'radiation' value. From approximate 'radiation', I will then compare it against maxSolarRad to get sky conditions (same as in Setup1). Please note: I'm looking for approximate values, no absolute accuracy.

The issue is in Setup2 which doesn't want to give me the maxSolarRad.

Andrew Milner

unread,
Jul 26, 2019, 1:56:01 AM7/26/19
to weewx-user
right - so we can forget setup 1 then since that is working with a radiation field provided.

so for setup 2 you are storing a temperature in extraTemp1 in the database - correct?
is that being populated as expected?

where is the calculation being performed?  If in a template can you post the template.

try dT= extraTemp1.raw - outTemp.raw

peter

unread,
Jul 26, 2019, 2:07:06 AM7/26/19
to weewx-user
OK, focus on Setup 2 but let me just remind that the issue is the weewx doesn't output maxSolarRad.

I have a conditions.html file (generated by weewx every minute) with few entries; e.g.: radiation | maxSolarRad | sunrise | sunset | extraTemp1 | outTemp
Of course I use raw values so I get values only (no units). A bash script parses the conditions.html file every minute. Verifies it's daytime (from sunrise/sunset times) and calculates dT=extraTemp1-outTemp.
It then writes a dT into a simple solar.txt file that a template uses to update the weewx database entries. I actually write into 2 entries (just for now, for debugging): dT goes into extraTemp2 and dT * factor goes into radiation.
I verified entries a minute ago and they correspond to my equations and current temperature conditions. All works well up to this level.
Now I need to get the maxSolarRad :-)

Dne petek, 26. julij 2019 07.56.01 UTC+2 je oseba Andrew Milner napisala:

gjr80

unread,
Jul 26, 2019, 2:14:49 AM7/26/19
to weewx-user
Given the maxSolarRad pre-requisites I still think we need to make sure pyephem is not somehow causing the calculation to be aborted (and set to None as a result). Is WeeWX producing the Standard or Seasons skin? If so is it publicly visible or are the extended sun properties (elevation, azimuth, right ascension, declination etc) being populated (note on the Seasons skin you need to click on ‘Celestial’ to see them)?

Gary

peter

unread,
Jul 26, 2019, 2:24:12 AM7/26/19
to weewx-user
Good point. Extended almanac is not available in Setup 2. I need to show $almanac.sunset to get the sun set time. In Setup 1, I get it through $almanac.sun.set; extended almanac works properly in Setup 1.
I use neowx skin in both setups but did modifications to it.


Dne petek, 26. julij 2019 08.14.49 UTC+2 je oseba gjr80 napisala:

gjr80

unread,
Jul 26, 2019, 2:28:12 AM7/26/19
to weewx-user
In that case pyephem is either not installed or not installed properly (previous post re import seems to indicate the latter). Try uninstalling pyephem then install following the instructions in the User’s Guide (http://weewx.com/docs/setup.htm).

Gary

peter

unread,
Jul 26, 2019, 2:35:08 AM7/26/19
to weewx-user
Gary, thanks a lot for this... I did follow your suggestion to verify if ephem was installed

$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
>>> quit()

If no errors where thrown by python pyephem is installed fine.


... and it worked OK, no errors returned.

But I just reran the
sudo pip install pyephem

and restarted weewx. maxSolarRad works!

Thanks again!

Dne petek, 26. julij 2019 08.28.12 UTC+2 je oseba gjr80 napisala:
Reply all
Reply to author
Forward
0 new messages