Have you installed pyephem <http://weewx.com/docs/setup.htm>? Irrespective of which algorithm is used weeWX needs to know here the Sun is to calculate maxSolarRad and for that weeWX needs pyephem.
Gary On Monday, 29 October 2018 21:32:11 UTC+10, kobuki wrote: > > I've run it now that we have sunlight (a nice sunny day fwiw): > > REC: 2018-10-29 12:27:00 CET (1540812420) altimeter: 29.7888279777, > appTemp: 71.73557034, barometer: 29.7797912689, cloudbase: 2931.0243356, > dateTime: 1540812420.0, dewpoint: 61.7885389671, ET: 0.000201022314202, > heatindex: 72.0, humidex: 80.9574895993, inDewpoint: 58.9109361372, > inHumidity: 65.2041778279, inTemp: 71.204, interval: 1, *maxSolarRad: > None*, outHumidity: 70.3, outTemp: 72.0, pressure: 29.1458023626, rain: > 0.0, rainRate: 0.0, txBatteryStatus: 0.0, usUnits: 1, UV: 1.82, > windBatteryStatus: 0.0, windchill: 72.0, windDir: 132.438871386, windGust: > 10.0, windGustDir: 165.347826087, windrun: 41.0369442587, windSpeed: 7.5 > > It's all none. It's present in all LOOP messages too, all None there too. > Another calculated field, cloudbase seems to have normal values. One thing > to note is that I'm not running the latest WeeWx, but I didn't think it's > important since maxSolarRad has been introduced quite a long time ago. I > can update it hiwever if needed. > > On Monday, October 29, 2018 at 1:45:14 AM UTC+1, Thomas Keffer wrote: >> >> The daily summaries are used for the stats --- things like >> $week.maxSolarRad.max. They are not used for the plots. >> >> Did you run weewx from the command line? What values did it show for >> maxSolarRad? >> >> -tk >> >> >> >> On Sun, Oct 28, 2018 at 10:24 AM kobuki <[email protected]> wrote: >> >>> Tom, it's exactly what I did. I'm quite well versed with mysql, so >>> adding the column is not a problem. I've even shown the extract for the >>> column in my first post! >>> >>> So, to sum up: 1. I've added the field to the python schema and also set >>> its group; 2. added the filed to the software-generated list of fields; 3. >>> added the maxSolarRad field to the archive table in mysql (it's actually >>> MariaDB, but that's not important now). Yet it still filled my db with >>> nulls even in daylight. I can't test it any more as it's already too dark. >>> I will rebuild the daily records when the values start appear in the db. >>> Unless it's a requirement for it to work at all, in that case I'll do it >>> right away. >>> >>> On Sunday, October 28, 2018 at 6:02:37 PM UTC+1, Thomas Keffer wrote: >>>> >>>> Replicating is necessary for sqlite --- it has no mechanism for adding >>>> a column to a database table. >>>> >>>> However, if you are using MySQL, then you can just add a column. Here >>>> are the instructions <http://www.mysqltutorial.org/mysql-add-column/>. >>>> >>>> But, you must still rebuild the daily summaries, because they will not >>>> be aware of the new type. Use the wee_database tool with the >>>> --rebuild-daily >>>> <http://weewx.com/docs/utilities.htm#Action_--rebuild-daily> option to >>>> do this. >>>> >>>> -tk >>>> >>>> On Sun, Oct 28, 2018 at 9:45 AM kobuki <[email protected]> wrote: >>>> >>>>> Thanks for the explanation. I did see the instructions for >>>>> wee_database but I'm perfectly fine with the current database. I see no >>>>> point in replicating it - what is the exact reasoning behind it? Isn't it >>>>> possible to tell WeeWx to use the current db with the modified archive >>>>> table? The new one should be completely identical to the old one after >>>>> adding the extra column, after all. It has a lot of data, too. >>>>> >>>>> On Sunday, October 28, 2018 at 4:07:02 PM UTC+1, Thomas Keffer wrote: >>>>>> >>>>>> There are several things that could be going wrong. >>>>>> >>>>>> First, the schema is used only when the database is first being >>>>>> created. After that, the schema is read from the database --- it's not >>>>>> enough to just add a new type to schemas.wview.schema. You have to >>>>>> rebuild the database with the new type. The utility wee_database can >>>>>> do this. It will create a new database with the new schema, then >>>>>> populate >>>>>> it with data from the old database. See the section *Add a new type >>>>>> to the archive database >>>>>> <http://weewx.com/docs/customizing.htm#add_archive_type>* in the >>>>>> Customizing Guide. >>>>>> >>>>>> When you're done, double check that the new database, in fact, >>>>>> includes the new type. This can be done by running the mysql utility >>>>>> with the command >>>>>> >>>>>> *describe weewx.archive* >>>>>> >>>>>> Finally, make sure that values of maxSolarRad are non-NULL. You can >>>>>> do this by running weewxd directly from the command line >>>>>> <http://weewx.com/docs/usersguide.htm#Running_directly>. Watch the >>>>>> values as they go by and see if they are None. >>>>>> >>>>>> -tk >>>>>> >>>>>> >>>>>> On Sun, Oct 28, 2018 at 5:41 AM kobuki <[email protected]> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I've added maxSolarRad to my WeeWx in the following way. First, I >>>>>>> added these lines to the /usr/share/weewx/user/extensions.py file: >>>>>>> >>>>>>> import weewx.units >>>>>>> import schemas.wview >>>>>>> >>>>>>> extended_schema = schemas.wview.schema + [('maxSolarRad', 'REAL')] >>>>>>> weewx.units.obs_group_dict['maxSolarRad'] = 'group_radiation' >>>>>>> >>>>>>> Then made changes to /etc/weewx/weewx.conf: >>>>>>> >>>>>>> [DataBindings] >>>>>>> [[wx_binding]] >>>>>>> database = archive_mysql >>>>>>> table_name = archive >>>>>>> manager = weewx.wxmanager.WXDaySummaryManager >>>>>>> # schema = schemas.wview.schema >>>>>>> schema = user.extensions.extended_schema >>>>>>> >>>>>>> ... >>>>>>> >>>>>>> [StdWXCalculate] >>>>>>> [[Calculations]] >>>>>>> ... >>>>>>> maxSolarRad = software >>>>>>> >>>>>>> Naturally, I added a new column to the archive table in my weewx >>>>>>> mysql schema: >>>>>>> >>>>>>> `maxSolarRad` double DEFAULT NULL, >>>>>>> >>>>>>> Then restarted WeeWx, I see in the logs that maxSolarRad is being >>>>>>> handled with a certain algorithm, but the maxSolarRad column is >>>>>>> filled with NULL values in the database. >>>>>>> >>>>>>> Could anyone explain what I'm missing from the above procedure to >>>>>>> make it work? Thanks in advance... >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "weewx-user" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "weewx-user" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "weewx-user" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
