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] <javascript:>> > 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] <javascript:>. >> 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.
