You might also want to check out a GUI tool that can open/read/edit a
SQLite database such as https://github.com/sqlitebrowser/sqlitebrowser/wiki
I personally used it on Windows. I backup and copy the db to a windows
machine, carefully manually remove bad data, and put it back.

On Fri, Aug 6, 2021 at 1:07 PM gjr80 <[email protected]> wrote:

> Probably not used/referred to as often as rain, but you may want to give
> rainRate the same treatment. If your station does not emit rainRate (most
> don’t) chances are WeeWX calculates rainRate for you. In such cases a
> period of bogus rainfall will cause a period of bogus rainRate. The other
> thing regards rainRate is that due to WeeWX using a 15 minute (default
> value) sliding window to calculate rainRate you need to extend your period
> of concern by at least 15 minutes (ie add 900 to the higher of the two
> timestamp values used in the rain query).
>
> Gary
>
> On Saturday, 7 August 2021 at 02:35:10 UTC+10 Big Hiller wrote:
>
>> LIKE. A. CHARM!
>>
>> You, sir, are a gentleman and a scholar!
>>
>> Thank you so much for the clear and concise instructions. I'm sure I'll
>> refer to this thread in the future should I ever get more erroneous data.
>>
>> Again, thanks!!
>>
>> On Friday, August 6, 2021 at 8:03:13 AM UTC-7 [email protected] wrote:
>>
>>> 1. Stop weewx.
>>>
>>> 2. Install the tool sqlite3, if it has not been installed already:
>>>
>>> *sudo apt install sqlite3*
>>>
>>>
>>> 3. Calculate the starting and ending dates in unix epoch time. These are
>>> the dates that you want to zero out. The tool
>>> https://www.epochconverter.com/ is useful for this.
>>>
>>> 14 June 2021 0000 = *1623654000*
>>> 1 August 2021 0000 = *1627801200*
>>>
>>>
>>> 4. Find your sqlite database file. If you did a package install, it will
>>> be in /var/lib/weewx/weewx.sdb. If you did a setup.py install, it will
>>> be in /home/weewx/archive/weewx.sdb. I'm assuming the former.
>>>
>>> 5. Make a backup of the database file:
>>>
>>> *sudo cp /var/lib/weewx/weewx.sdb /var/lib/weewx/weewx.sdb.backup*
>>>
>>>
>>> 6. Use the tool sqlite3 to see what's in the database. This select
>>> statement will show the epoch time, date, and rain for the period 14 June
>>> until 1 August. Make sure you include the semicolon at the end. It will
>>> print out a lot of rows. Look them over.
>>>
>>> *sudo sqlite3 /var/lib/weewx/weewx.sdb*
>>> sqlite> *select datetime, datetime(dateTime, 'unixepoch','localtime'),
>>> rain from archive where dateTime > 1623654000 and dateTime <= 1627801200;*
>>>
>>>
>>> 7. If it meets your expectations, zero out the rain fields for that
>>> period:
>>>
>>> sqlite> *update archive set rain=0.0 where dateTime > 1623654000 and
>>> dateTime <= 1627801200;*
>>> sqlite> *.quit*
>>>
>>>
>>> 8. Rebuild the daily summaries for the affected period.
>>>
>>> *sudo wee_database --rebuild-daily --from=2021-06-14 --to=2021-08-01*
>>>
>>>
>>> 9. Restart weewx.
>>>
>>> On Thu, Aug 5, 2021 at 9:23 PM Big Hiller <[email protected]> wrote:
>>>
>>>>
>>>> Phew! Good thing you asked, it says "database = archive_sqlite"
>>>>
>>>> I did say I am a n00b ;)
>>>> On Thursday, August 5, 2021 at 5:44:27 PM UTC-7 [email protected] wrote:
>>>>
>>>>> We need to know (for sure) what database you are using. Look in your
>>>>> weewx.conf file, for the section that looks like:
>>>>>
>>>>> [DataBindings]
>>>>>
>>>>>     [[wx_binding]]
>>>>>         # The database must match one of the sections in [Databases].
>>>>>         # This is likely to be the only option you would want to
>>>>> change.
>>>>>         database = archive_sqlite
>>>>>
>>>>> We need the line for the option "database". It will say
>>>>> "archive_mysql" if you are using MySQL, "archive_sqlite" otherwise.
>>>>>
>>>>> -tk
>>>>>
>>>>> On Thu, Aug 5, 2021 at 5:37 PM Big Hiller <[email protected]> wrote:
>>>>>
>>>>>> 1. Pacific (PST)
>>>>>> 2. MySQL, I believe.
>>>>>>
>>>>>> On Thursday, August 5, 2021 at 5:17:49 PM UTC-7 [email protected]
>>>>>> wrote:
>>>>>>
>>>>>>> 1. What time zone are you in?
>>>>>>> 2. What database are you using?
>>>>>>>
>>>>>>> On Thu, Aug 5, 2021 at 4:42 PM Big Hiller <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm no good at SQL or pretty much anything in Linux other than
>>>>>>>> getting my WeeWX instance running.
>>>>>>>>
>>>>>>>> It's been running great for almost a year now and I have a little
>>>>>>>> issue I was hoping to get a little help on.
>>>>>>>>
>>>>>>>> My wife has been putting the sprinkler into a new place and I
>>>>>>>> hadn't noticed until a little while back but when she waters the lawn 
>>>>>>>> it's
>>>>>>>> been going into the rain sensor and has been getting measured as rain 
>>>>>>>> fall.
>>>>>>>> Clearly this is not good and luckily we have had no rain at all here in
>>>>>>>> Vancouver for the last few months so I feel it's safe to simple null 
>>>>>>>> out
>>>>>>>> any data for that sensor in the specific range.
>>>>>>>>
>>>>>>>> That leads me to the question:
>>>>>>>> *How (which command) would I delete all the rainfall data from June
>>>>>>>> 14, 2021 to August 1, 2021?*
>>>>>>>>
>>>>>>>> Probably really simple for some of you :)
>>>>>>>>
>>>>>>>> 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].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/weewx-user/764c76c8-9162-497e-ad08-01cbb8d65f7an%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/764c76c8-9162-497e-ad08-01cbb8d65f7an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>> 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].
>>>>>>
>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/weewx-user/816feb5b-9c27-4dc9-9e07-b14e0fa220c7n%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/weewx-user/816feb5b-9c27-4dc9-9e07-b14e0fa220c7n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>> 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].
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/762f209a-cdcf-4d0e-9912-f451c5db205an%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/weewx-user/762f209a-cdcf-4d0e-9912-f451c5db205an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/c83481be-fc1f-4212-afd3-6bc0d5da32c7n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/c83481be-fc1f-4212-afd3-6bc0d5da32c7n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Peter Quinn
(415)794-2264

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAA1SM21QPG6hyKzmA%3DDG_9%2BZc0dN_4535V0EGVN_oNrPQ%2BPbvg%40mail.gmail.com.

Reply via email to