weewx-loopdata program

202 views
Skip to first unread message

philip....@gmail.com

unread,
Jun 11, 2026, 11:00:44 AM (11 days ago) Jun 11
to weewx-user
weewx version 5.3.1
Ive added current.ecolightningcount to the weewx-loopdata ver 3.3.2 program and it updates OK but it displays 6 decimal places. Ive added various things in weewx.conf but obviously not correctly
Coulk somebody put me out of my misery and point me in the right direction.

Thanks Phil

John Kline

unread,
Jun 11, 2026, 2:28:36 PM (11 days ago) Jun 11
to weewx...@googlegroups.com, weewx-user
It should display the same in the file as it does in the target report you specified in the LoopData section of weewx.conf.  Look at the report you specified (target_report) and add current.ecolighingcount to that report.  Does it also display with 6 decimal places?

On Jun 11, 2026, at 8:00 AM, philip....@gmail.com <philip....@gmail.com> wrote:


--
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.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/32453638-58fc-4a1b-bf38-85e6bcff50den%40googlegroups.com.

John Smith

unread,
Jun 11, 2026, 6:01:36 PM (10 days ago) Jun 11
to weewx...@googlegroups.com
The simplest fix would be to remove the column and then re-add it with the INTEGER type instead of REAL.

The slightly more complex fix would be to update the column type in your database by doing something like

ALTER TABLE my_table ADD COLUMN new_col INTEGER;
UPDATE my_table SET new_col = CAST(old_col AS INTEGER);
ALTER TABLE my_table DROP COLUMN old_col;
ALTER TABLE my_table RENAME COLUMN new_col TO old_col;

Although Claude.ai says SQLite columns are dynamically typed, so you could get away with just doing

UPDATE my_table SET col = CAST(col AS INTEGER);

John Kline

unread,
Jun 11, 2026, 7:35:57 PM (10 days ago) Jun 11
to weewx...@googlegroups.com, weewx...@googlegroups.com
Please don’t change the database.  loopdata formats observations as specified by a report.  The reason for this is, typically, the observation values written on every loop record are used to update values in a report.  Of course, just like when observations are used in a report, adding .raw will skip the formatting.

On Jun 11, 2026, at 3:01 PM, John Smith <deltafo...@gmail.com> wrote:



John Smith

unread,
Jun 11, 2026, 9:01:22 PM (10 days ago) Jun 11
to weewx...@googlegroups.com
Why would a column for lightning strikes not use INTEGER in the first place?

It's not like you can have a half or third of a lightning strike.

John Kline

unread,
Jun 11, 2026, 9:46:04 PM (10 days ago) Jun 11
to weewx...@googlegroups.com, weewx...@googlegroups.com
This is fundamentally a formatting issue.  I have this completely covered in the extension.

I don’t know how well weewx will play with observations that are integers (but, like I say, this is about formatting).  I do know that the extended schema has lighthing count as REAL.

('lightning_strike_count',    'REAL'),

On Jun 11, 2026, at 6:01 PM, John Smith <deltafo...@gmail.com> wrote:



John Smith

unread,
Jun 12, 2026, 12:32:10 AM (10 days ago) Jun 12
to weewx...@googlegroups.com
This is fundamentally a formatting issue. 

It might manifest as a formatting issue, but it's really a database issue and a waste of bytes storing whole numbers as decimals.

I do know that the extended schema has lighthing count as REAL.

The defaults are unnecessarily bloated, but I guarantee others on this list don't want the issue rehashed yet again.

Pablo Sanchez

unread,
Jun 12, 2026, 7:32:35 AM (10 days ago) Jun 12
to weewx...@googlegroups.com
It is a database issue because the column's domain should be an integer. Any other data type allows for garbage data to exist.

By design, many DB engines reject data that does not match the domain.
---
pablo

John Kline

unread,
Jun 12, 2026, 9:38:26 AM (10 days ago) Jun 12
to weewx...@googlegroups.com, weewx...@googlegroups.com
We are talking about the formatters associated with the observation.  It *may* be true that, if the observation was set up incorrectly, the database type would have an effect on the output, but the goal here is to properly create the new type.  This is why I have asked the OP to tell me what is displayed in the report.  That takes the extension out of the picture and we can work to get the observation configured correctly.  The loopdata extension, by design, uses the same formatters as the target report.

On Jun 12, 2026, at 4:32 AM, Pablo Sanchez <pa...@hillsandlakes.com> wrote:



philip....@gmail.com

unread,
Jun 12, 2026, 11:52:59 AM (10 days ago) Jun 12
to weewx-user
John K
This is whats in the weewx.conf
 [[LoopDataReport]]
        HTML_ROOT = /etc/weewx/webpages/loopdata
        enable = true
        skin = LoopData
        [[[Extras]]]
            loop_data_file = loop-data.txt
            expiration_time = 4
            page_update_pwd = foobar
            googleAnalyticsId = ""
            analytics_host = ""
        [[[Units]]]
            [[[[StringFormats]]]]
                mile_per_hour = %.0f
                degree_C = %.1f
                km_per_hour = %.0f
                degree_F = %.1f
current.ecolightningcount = %.0f

txt file attached and the link to view is
loop-data.txt

John Kline

unread,
Jun 12, 2026, 12:30:26 PM (10 days ago) Jun 12
to weewx...@googlegroups.com, weewx-user
You are showing me LoopDataReport, but not LoopData.  Is this report the target report in the LoopData section.

In any event, if the loop data report is the target report in the LoopData section, my guess is that you haven’t properly defined the ecolightningcount type.  Is this something you did on your own, or is it from an extension that I can look at?  The type needs to be associated with group_count in weewx.units.obs_group_dict.

In any event, you might get this working the wrong way by removing the “current.“ in LoopDataReport so that it reads:

ecolightningcount = %.0f

I say the wrong way because you really want ecolightningcount to be a properly defined observation so you don’t keep hitting these problems.

On Jun 12, 2026, at 8:53 AM, philip....@gmail.com <philip....@gmail.com> wrote:

John K

philip....@gmail.com

unread,
Jun 13, 2026, 6:19:41 AM (9 days ago) Jun 13
to weewx-user
i was using gw1000.py and Ive added  'ecolightningcount': 'group_count' to the file.
It now formats correctly without decimal points so thanks for your pointers

Phil

John Kline

unread,
Jun 13, 2026, 8:32:40 AM (9 days ago) Jun 13
to weewx...@googlegroups.com, weewx-user
Excellent.  You might want to ask the maintainer of the gw1000 extension to add 'ecolightningcount': 'group_count' so other users won’t hit this problem. 

On Jun 13, 2026, at 3:19 AM, philip....@gmail.com <philip....@gmail.com> wrote:

i was using gw1000.py and Ive added  'ecolightningcount': 'group_count' to the file.

philip....@gmail.com

unread,
Jun 15, 2026, 6:37:21 AM (7 days ago) Jun 15
to weewx-user
Gary was the maintainer but ive notice the version has been updated so maybe not a problem but ive not checked as yet.
Your loop-data.txt file uses different headings so the gauges.ss doesn't work .
Is there a newer version ??
Thanks Phil

steepleian

unread,
Jun 15, 2026, 7:33:25 AM (7 days ago) Jun 15
to weewx...@googlegroups.com, weewx-user
Gary is no longer online. The new home for the driver is https://github.com/weewx-contrib/weewx-gw1000

It is a fork from Gary’s last version.


On 15 Jun 2026, at 11:37, philip....@gmail.com <philip....@gmail.com> wrote:

Gary was the maintainer but ive notice the version has been updated so maybe not a problem but ive not checked as yet.

John Kline

unread,
Jun 15, 2026, 8:41:54 AM (7 days ago) Jun 15
to weewx...@googlegroups.com, weewx-user
>> Your loop-data.txt file uses different headings so the gauges.ss doesn't work .

LoopData uses the keys you type into the LoopData section of weewx.conf.  And it formats the data based on the target report specified.  Gauges.ss w/ Gary’s weewx-realtime_gauge-data extension, has a fixed number of fields, with Gary’s keys and formats data on the client side.

If your objective is only to get the gauges to work, grab yourself of copy of weewx-realtime_gauge-data.  Someone on this forum will be able to point you to a copy.

For my site, I update gauges with LoopData because I auto update far more than just the gauges.

On Jun 15, 2026, at 3:37 AM, philip....@gmail.com <philip....@gmail.com> wrote:

Gary was the maintainer but ive notice the version has been updated so maybe not a problem but ive not checked as yet.
Reply all
Reply to author
Forward
0 new messages