0 is different to null/NULL. 0 indcates there was a measurement and the 
value is zero (eg your thermomenter reports 0C). Null indicates there was 
no measurement or no data (eg you don't have a thermometer). The nulls only 
matter if they are in a field in which you should (given the capabilities 
of your station) have observational data. Have a look at the schema used by 
a default weeWX install (The Archive types appendix 
<http://weewx.com/docs/customizing.htm#archive_types> to the Customization 
Guide gives a good indicator, or have a look in bin/schemas/wview.py for 
the definitive schema). I guarantee there are a lot of fields there that 
your station woon't be fillling.

Gary

On Tuesday, 13 March 2018 20:13:54 UTC+10, Greg from Oz wrote:
>
> If NULLS are bad why is the default NULL?
> I ran this command:
> MariaDB [weewx]> SHOW COLUMNS FROM archive FROM weewx;
> +----------------------+---------+------+-----+---------+-------+
> | Field                | Type    | Null | Key | Default | Extra |
> +----------------------+---------+------+-----+---------+-------+
> | dateTime             | int(11) | NO   | PRI | NULL    |       |
> | usUnits              | int(11) | NO   |     | NULL    |       |
> | interval             | int(11) | NO   |     | NULL    |       |
> | barometer            | double  | YES  |     | NULL    |       |
> | pressure             | double  | YES  |     | NULL    |       |
> | altimeter            | double  | YES  |     | NULL    |       |
> | inTemp               | double  | YES  |     | NULL    |       |
> | outTemp              | double  | YES  |     | NULL    |       |
> | inHumidity           | double  | YES  |     | NULL    |       |
> | outHumidity          | double  | YES  |     | NULL    |       |
> | windSpeed            | double  | YES  |     | NULL    |       |
> | windDir              | double  | YES  |     | NULL    |       |
> | windGust             | double  | YES  |     | NULL    |       |
> | windGustDir          | double  | YES  |     | NULL    |       |
> | rainRate             | double  | YES  |     | NULL    |       |
> | rain                 | double  | YES  |     | NULL    |       |
> | dewpoint             | double  | YES  |     | NULL    |       |
> | windchill            | double  | YES  |     | NULL    |       |
> | heatindex            | double  | YES  |     | NULL    |       |
> | ET                   | double  | YES  |     | NULL    |       |
> | radiation            | double  | YES  |     | NULL    |       |
>
>
> On Tuesday, 13 March 2018 20:21:16 UTC+11, gjr80 wrote:
>>
>> Greg,
>>
>> The --check-strings (and its friend --fix-strings) action is there for 
>> SQLite databases (do a wee_database --help). It will run on a MySQL 
>> install but essentially has no effect. Having a null/NULL value in a 
>> database is fine, that is how the python None values are stored. However, 
>> having a string or a null string in a weeWX database field is not OK, that 
>> is what --check-strings will pickup and --fix-strings will fix. I'm not 
>> sure why the null string only comes up for SQLite databases, before my 
>> time, though one way that you can easily get them if you are not carfeul is 
>> through use of a graphical db browser/editor.
>>
>> Gary
>>
>> On Tuesday, 13 March 2018 19:02:58 UTC+10, Greg from Oz wrote:
>>>
>>> Hi,
>>> I am using mqysql as my weewx database.
>>> I run the wee_database --check-strings and it comes back clean but if I 
>>> run mysql command to look for NULL I get a lot of results.
>>> Anyone know why this would be the case?
>>>
>>> Thanks
>>>
>>> wee_database --check-strings
>>> Using configuration file /etc/weewx/weewx.conf
>>> Using database binding 'wx_binding', which is bound to database 
>>> 'archive_mysql'
>>> Preparing Null String Check, this may take awhile...
>>> Checking record: 488186; Timestamp: 2018-03-12 10:05:00 AEDT (1520809500)
>>> No null strings found.
>>> Completed Null String Check in 28.89 seconds.
>>>
>>>
>>> Yet, if I run the command below it shows I do have NULL values.
>>>
>>>
>>> MariaDB [weewx]> select dateTime, rain , rainRate from archive where 
>>> rain IS NULL;
>>> +------------+------+----------+
>>> | dateTime   | rain | rainRate |
>>> +------------+------+----------+
>>> | 1501541984 | NULL |        0 |
>>> | 1501546184 | NULL |        0 |
>>> | 1501563583 | NULL |        0 |
>>> | 1501564184 | NULL |        0 |
>>> | 1501564490 | NULL |        0 |
>>> | 1501585184 | NULL |        0 |
>>> | 1501590884 | NULL |        0 |
>>> | 1501634684 | NULL |        0 |
>>> | 1501635284 | NULL |        0 |
>>> | 1501636784 | NULL |        0 |
>>> | 1501656884 | NULL |        0 |
>>> | 1501659584 | NULL |        0 |
>>> | 1501675645 | NULL |        0 |
>>>
>>>

-- 
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.

Reply via email to