chaunceygardiner / weewx-loopdata

A WeeWX service to generate a json file (loop-data.txt) containing observations from loop events.
GNU General Public License v3.0
5 stars 2 forks source link

Adding a new field #12

Closed phil21lus closed 2 months ago

phil21lus commented 2 months ago

In the looppackets I have 'ecowh57_sig': 4.0, 'ecolightning_strike_count': 0.0, 'ecolightningcount': 1.0, 'ecolightning_distance': 10.565568676196396 Im using $current.ecolightningcount which works and the filed ecolightningcount is in the database. I added curent.ecolightningcount as an extra field in weewx.conf thinking this program would pick it up but in the loop-data.txt it ignores it. Have I misunderstood how this would work Thanks Phil

phil21lus commented 2 months ago

Forgot to mention I restart weewx after each change to weewx.conf

chaunceygardiner commented 2 months ago

I have not tested with ecowit, but, as long as the following (from the README) is true, it should work:

IMPORTANT: This extension has been tested with the WeeWX's vantage and cc3000 drivers. It will likely also work with other drivers that, like the two drivers tested, report loop packets on a regular basis and report all observations on every loop packet. Use loopdata with driver's that report loop packets on an irregular basis and/or report partial observations, at your own risk.

Now, as for current.ecolightningcount. Loopdata doesn’t just copy the observations from loop records to a file. Rather, it does proper unit conversions and formatting. As such, any added observations have to be properly wired up in WeeWX so that WeeWX associates a converter and formatted for that observation.

Some questions: Does $current.ecolightningcount work in a report? What is the output in the report? What is the loopdata: startup log output? That will tell us what items will end up in loop-data.txt.

phil21lus commented 2 months ago

set $daynumber = int($current.ecolightningcount.format("%.0f"))

The above is used in a report OK 2024-08-11T13:31:23.600701+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: unit_system : 1 2024-08-11T13:31:23.600825+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: archive_interval : 300 2024-08-11T13:31:23.600864+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: loop_data_dir : /etc/weewx/webpages/testcenter/loopdata/. 2024-08-11T13:31:23.600902+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: filename : loop-data.txt 2024-08-11T13:31:23.600929+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: target_report : LoopDataReport 2024-08-11T13:31:23.600957+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: loop_frequency : 2.0 2024-08-11T13:31:23.600987+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: specified_fields : ['trend.outTemp', 'trend.barometer.code', 'trend.barometer.desc', 'current.barometer', 'current.ecolightningcount', 'current.barometer.formatted', 'current.dateTime.raw', 'current.dewpoint', 'current.dewpoint.formatted', 'current.heatindex', 'current.outHumidity', 'current.outTemp', 'current.outTemp.formatted', 'current.rain', 'current.rainRate', 'current.rainRate.formatted', 'current.UV.formatted', 'current.windchill', 'current.windDir.ordinal_compass', 'current.windSpeed', 'current.windSpeed.formatted', 'current.windSpeed.raw', '2m.outTemp.max.formatted', '2m.outTemp.min.formatted', '2m.rain.sum.formatted', '2m.wind.rms.formatted', '2m.windGust.max', '2m.windGust.max.formatted', '10m.outTemp.max.formatted', '10m.outTemp.min.formatted', '10m.rain.sum.formatted', '10m.wind.rms.formatted', '10m.windGust.max', '10m.windGust.max.formatted', '24h.outTemp.max.formatted', '24h.outTemp.min.formatted', '24h.rain.sum.formatted', '24h.wind.rms.formatted', '24h.windGust.max', '24h.windGust.max.formatted', 'hour.outTemp.max.formatted', 'hour.outTemp.min.formatted', 'hour.rain.sum.formatted', 'hour.wind.rms.formatted', 'hour.windGust.max', 'hour.windGust.max.formatted', 'day.outTemp.max.formatted', 'day.outTemp.min.formatted', 'day.rain.sum', 'day.rain.sum.formatted', 'day.wind.rms.formatted', 'day.windGust.max', 'day.windGust.max.formatted', 'week.outTemp.max.formatted', 'week.outTemp.min.formatted', 'week.rain.sum.formatted', 'week.wind.rms.formatted', 'week.windGust.max.formatted', 'month.outTemp.max.formatted', 'month.outTemp.min.formatted', 'month.rain.sum.formatted', 'month.wind.rms.formatted', 'month.windGust.max.formatted', 'year.outTemp.max.formatted', 'year.outTemp.min.formatted', 'year.rain.sum.formatted', 'year.wind.rms.formatted', 'year.windGust.max.formatted', 'rainyear.outTemp.max.formatted', 'rainyear.outTemp.min.formatted', 'rainyear.rain.sum.formatted', 'rainyear.wind.rms.formatted', 'rainyear.windGust.max.formatted', 'alltime.outTemp.max.formatted', 'alltime.outTemp.min.formatted', 'alltime.rain.sum.formatted']2024-08-11T13:31:23.601100+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: tmpname : /tmp/LoopDatai5nvmnzm 2024-08-11T13:31:23.601127+01:00 raspberrypi weewxd[2170816]: INFO user.loopdata: enable : 1

chaunceygardiner commented 2 months ago

set $daynumber = int($current.ecolightningcount.format("%.0f"))

That’s not the same. You are supplying the format. Give me what actually prints for $current.ecolightningcount While you are at it, give me the output for $day.ecolightningcount.avg in a report

I think you haven’t shown me all the loopdata output from startup. I should be seeing all of the fields that will be in the loop-data.txt file by period. Please send that. But before you do, reinstall loopdata from github because I forgot to log the current period (although I do log all others).

When you grep for “loopdata:” in the output, I think we’ll see an ignoring because not in the day accumulator for this field. But let’s see. There should either be that log message or it should be included in the current period in the logged output at startup.

chaunceygardiner commented 2 months ago

[Please don’t respond just to this message and ignore my previous questions.]

BTW, the weewx extended view database already has: ('lightning_distance', 'REAL'), ('lightning_disturber_count', 'REAL'), ('lightning_energy', 'REAL'), ('lightning_noise_count', 'REAL'), ('lightning_strike_count', 'REAL'),

And they are properly wired up in units.py: "lightning_distance" : "group_distance", "lightning_disturber_count" : "group_count", "lightning_noise_count" : "group_count", "lightning_strike_count" : "group_count",

If you added a line in weewx.conf

StdCalibrate] [[Corrections]]

Add the following line.

    lightning_strike_count = ecolightningcount

You would be able to use current.lightning_strike_count. Alas, I don’t know if lighting_strike_count is a good field to use because I don’t know the difference between ecolightning_strike_count and ecolightningcount

chaunceygardiner commented 2 months ago

Closing for now. Reopen if you want to get back to me on this.

phil21lus commented 2 months ago

Can't test anything until this weekend Will respond when I canSent from my Galaxy -------- Original message --------From: John Kline @.> Date: 14/08/2024 00:26 (GMT+00:00) To: chaunceygardiner/weewx-loopdata @.> Cc: phil21lus @.>, Author @.> Subject: Re: [chaunceygardiner/weewx-loopdata] Adding a new field (Issue #12) Closed #12 as completed.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

phil21lus commented 2 months ago

Sorry for the late response I'm  tied up on something Sent from my Galaxy -------- Original message --------From: John Kline @.> Date: 14/08/2024 00:26 (GMT+00:00) To: chaunceygardiner/weewx-loopdata @.> Cc: phil21lus @.>, Author @.> Subject: Re: [chaunceygardiner/weewx-loopdata] Adding a new field (Issue #12) Closing for now. Reopen if you want to get back to me on this.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>