Hi, You need to follow the instructions in the Add a new type to the archive database <http://weewx.com/docs/customizing.htm#add_archive_type> section of the Customization Guide. In your case your driver already emits hourRain so you won't have a file user/electricty.py, instead just create a file user/myschema.py and put the import and schema assignment at step 1 in user/myschema.py. If you do this you will need to make sure your schema = line at step 2 is changed accordingly.
Gary On Monday, 27 March 2017 15:06:40 UTC+10, Paolo Benvenuto wrote: > > ok, is there a command to add the db field? > > Il giorno lunedì 27 marzo 2017 00:41:08 UTC+2, Tom Keffer ha scritto: >> >> That's the nature of schema-based databases, such as sqlite or MySQL. You >> give up flexibility in exchange for speed and efficiency. >> >> -tk >> >> On Sun, Mar 26, 2017 at 12:30 PM, Paolo Benvenuto <paolo...@gmail.com> >> wrote: >> >>> Yes, it stands. >>> >>> However: >>> >>> - I didn't create the columns for the other data which weewx inserts >>> into the database, I'd expect that those data have their column in the >>> database like the other data which have them >>> - It seems that weewx receives that data from the wmr100 driver, why >>> doesn't it create their database columns for all the data it receives from >>> the driver? or at least weewx, if security suggest not to do it, the user >>> to create the columns with a syslog message >>> >>> Il giorno sabato 25 marzo 2017 22:31:42 UTC+1, Tom Keffer ha scritto: >>>> >>>> Data for plots are taken from the database. So, unless there is a >>>> column 'hourRain' in your schema, it cannot be used in a plot. It can >>>> only be used in the $current tag. >>>> >>>> Stands to reason, if you think about it. >>>> >>>> -tk >>>> >>>> On Sat, Mar 25, 2017 at 12:30 PM, Paolo Benvenuto <paolo...@gmail.com> >>>> wrote: >>>> >>>>> My wmr100 driver outputs a hourRain field: >>>>> >>>>> {'UV': 'uv', 'outHumidity': 'humidity_1', 'inTempBatteryStatus': >>>>> 'battery_status_0', 'rainBatteryStatus': 'battery_status_rain', >>>>> 'extraTemp2': 'temperature_3', 'outTempBatteryStatus': >>>>> 'battery_status_1', 'inTemp': 'temperature_0', 'hourRain': 'rain_hour' >>>>> , 'rain': 'rain', 'extraHumid6': 'humidity_7', 'pressure': 'pressure', >>>>> 'extraHumid4': 'humidity_5', 'extraHumid5': 'humidity_6', >>>>> 'extraHumid2': 'humidity_3', 'extraHumid3': 'humidity_4', >>>>> 'extraHumid1': 'humidity_2', 'extraTemp6': 'temperature_7', >>>>> 'extraTemp7': 'temperature_8', 'extraTemp4': 'temperature_5', >>>>> 'extraTemp5': 'temperature_6', 'rainRate': 'rain_rate', 'extraTemp3': >>>>> 'temperature_4', 'extraTemp1': 'temperature_2', 'extraHumid7': >>>>> 'humidity_8', 'extraBatteryStatus2': 'battery_status_3', >>>>> 'extraBatteryStatus3': 'battery_status_4', 'windBatteryStatus': >>>>> 'battery_status_wind', 'extraBatteryStatus1': 'battery_status_2', >>>>> 'extraBatteryStatus6': 'battery_status_7', 'extraBatteryStatus7': >>>>> 'battery_status_8', 'extraBatteryStatus4': 'battery_status_5', >>>>> 'extraBatteryStatus5': 'battery_status_6', 'windDir': 'wind_dir', >>>>> 'outTemp': 'temperature_1', 'windSpeed': 'wind_speed', 'inHumidity': >>>>> 'humidity_0', 'rain24': 'rain_24', 'windGust': 'wind_gust', >>>>> 'uvBatteryStatus': 'battery_status_uv', 'rainTotal': 'rain_total'} >>>>> >>>>> So I put it in my skin: >>>>> >>>>> [[[dayrain]]] >>>>> yscale = None, None, 0.02 >>>>> plot_type = bar >>>>> [[[[rain]]]] >>>>> color = gray >>>>> [[[[hourRain]]]] >>>>> color = black >>>>> >>>>> >>>>> >>>>> However, I get this error: >>>>> >>>>> Mar 25 20:26:19 localhost weewx[31399]: reportengine: Caught >>>>> unrecoverable exception in generator weewx.imagegenerator. >>>>> ImageGenerator >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** no such column: >>>>> hourRain >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** Traceback (most >>>>> recent call last): >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/reportengine.py", line 239, >>>>> in run >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** obj.start() >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/reportengine.py", line 273, >>>>> in start >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** self.run() >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/imagegenerator.py", line 32 >>>>> , in run >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** self. >>>>> genImages(self.gen_ts) >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/imagegenerator.py", line >>>>> 145, in genImages >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** >>>>> aggregate_interval=aggregate_interval) >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/manager.py", line 511, in >>>>> getSqlVectors >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** >>>>> aggregate_type, aggregate_interval) >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weewx/manager.py", line 757, in >>>>> _getSqlVectors >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** for _rec in >>>>> _cursor.execute(sql_str, (startstamp, stopstamp)): >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** File >>>>> "/usr/share/weewx.github.development/weedb/sqlite.py", line 41, in >>>>> guarded_fn >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** raise weedb. >>>>> NoColumnError(e) >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** NoColumnError: >>>>> no such column: hourRain >>>>> Mar 25 20:26:19 localhost weewx[31399]: **** Generator >>>>> terminated >>>>> >>>>> Is it a bug or am I missing something? >>>>> >>>>> -- >>>>> 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 weewx-user+...@googlegroups.com. >>>>> 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 weewx-user+...@googlegroups.com. >>> 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.