[weewx-user] Bresser 5in1 in docker on Synology

2024-07-31 Thread 'Kris_bresser' via weewx-user
Hi all

I am enjoying a lot my Bresser Wifi Pro 5in1 weather station and I am 
pushing the data into my home assistant via the WeeWX docker. I first 
explain a bit how I did it, as it may help users with similar hardware, but 
at the end, I do have a question.

These are the things I did to get it working:

My weather station unfortunately did not allow for a direct connection to a 
home server, but it does allow for an upload to Wunderground. I created an 
account, and filled out the details and from then onwards, my station is 
sending data to Wunderground. But, I still wanted to capture the traffic 
for using in my home assistant. That's why in my ASUS router with Merlin 
firmware, I created some IP-tables to redirect the traffic to Wunderground 
to my WeeWx server:
 iptables -t nat -A PREROUTING -s bresserIP -p tcp --dport 80 -j DNAT 
--to-destination weewx-serverIP:3010 
iptables -t nat -A POSTROUTING -j MASQUERADE  

Now all packets will be redirected to port 3010.

Then I installed a docker container on my synology via docker-compose. The 
docker is from felddy, weewx. This combines MQTT,  weewx and the 
interceptor, as I am redirecting traffic.
--
version: "3.8"
services:
  weewx:
container_name: weewx_bresser
image: felddy/weewx
init: true
restart: "always"
privileged: true
network_mode: host
ports:
   - 8102:80
volumes:
   - /volume1/docker/weewx/:/data
  - /volume1/docker/weewx/html/:/home/weewx/public_html/ 
environment:
  - timezone=Europe/Brussels
  - WEEWX_UID=weewx
  - WEEWX_GID=dialout
---
This docker requires in my data folder of course the configuration file. At 
first install, this file is created, then, you can fill it out. I copy here 
the most important parts of my weewx.conf.

##

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 2

# Root directory of the weewx data file hierarchy for this station
WEEWX_ROOT = /home/weewx

# Whether to log successful operations. May get overridden below.
log_success = True

# Whether to log unsuccessful operations. May get overridden below.
log_failure = True

# Do not modify this. It is used when installing and updating weewx.
version = 4.10.2

##
#   This section is for information about the station.

[Station]

# Description of the station location
location = "Thuis"

# Latitude in decimal degrees. Negative for southern hemisphere
latitude = fill_in_your_latitude
# Longitude in decimal degrees. Negative for western hemisphere.
longitude = fill_in_your_longitude

# Altitude of the station, with the unit it is in. This is used only
# if the hardware cannot supply a value.
altitude = 41, meter# Choose 'foot' or 'meter' for unit

# Set to type of station hardware. There must be a corresponding stanza
# in this file, which includes a value for the 'driver' option.
station_type = Interceptor
  


# If you have a website, you may specify an URL. This is required if you
# intend to register your station.
#station_url = http://www.example.com

# The start of the rain year (1=January; 10=October, etc.). This is
# downloaded from the station if the hardware supports it.
rain_year_start = 1

# Start of week (0=Monday, 6=Sunday)
week_start = 0

##

[Interceptor]
# This section is for the network traffic interceptor driver.

# The driver to use:
driver = user.interceptor
device_type = wu-client    this is used for all undefined clients 
which just upload to Wunderground.
mode = listen
address = my_weewx_server_ip_address
port = 3010
##
#   This section is for uploading data to Internet sites

[StdRESTful]

# Uncomment and change to override logging for uploading services.
# log_success = True
# log_failure = True
I put all uploads on false, except for Weather Underground.
[[Wunderground]]
# This section is for configuring posts to the Weather Underground.

# If you wish to post to the Weather Underground, set the option 
'enable' to true,  then
# specify a station (e.g., 'KORHOODR3') and password. To guard 
against parsing errors, put
# the password in quotes.
enable = true
station = 'station_name'
password = 'myKEY'

# Set the following to True to have weewx use the WU "Rapidfire"
# protocol. Not all hardware can support it. See the User's Guide.
rapidfire = true

[[MQTT]]
server_url = mqtt://my_mqtt_server_IP:1883/
topic = wea

[weewx-user] Bresser 5in1 Pro Wifi + docker on Synology

2024-07-31 Thread 'Kris_bresser' via weewx-user
Hi all

I am intercepting packages from my Bresser weather station to my home 
server via IPtables, on port 3010. Then, by using the Felddy docker 
container, which combines WeeWx, MQTT and Interceptor, I am able to fetch 
the data (original for Wunderground) and send it via MQTT to my home 
assistant. This container is also updating Wunderground.

My main challenge is the rain parameter, as you can see from the logs 
below. At first, he is ignoring the unrecognized parameter rainin, then he 
is NOT uploading the rain data to Wunderground.
I do have a couple of questions:
- I am assuming the rain calculations are correct, but why is there no rain 
data sent to Wunderground?
- why does the docker send the data twice to Wunderground, via Ambient and 
via wunderground-RF?
- Is there a way, in case Felddy docker container is not updated, to update 
myself to WeeWx v5 and to include other items, such as HTML, Skins,, ...

Thanks,
Kris

Some of my settings:
[Interceptor]
# This section is for the network traffic interceptor driver.

# The driver to use:
driver = user.interceptor
device_type = wu-client
mode = listen
address = my local IP address of the server
port = 3010
[[Wunderground]]
enable = true
station = 'IHEUSD37'
password = my_key'
rapidfire = true

The logs:

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: GET: 
ID=IHEUSD37&PASSWORD=&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=30.03&tempf=67.8&dewptf=65.4&humidity=92&windspeedmph=0.0&windgustmph=0.0&winddir=0&rainin=0.0&dailyrainin=0.0&indoortempf=80.4&indoorhumidity=59

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: raw data: 
ID=IHEUSD37&PASSWORD=XXX&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=30.03&tempf=67.8&dewptf=65.4&humidity=92&windspeedmph=0.0&windgustmph=0.0&winddir=0&rainin=0.0&dailyrainin=0.0&indoortempf=80.4&indoorhumidity=59

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: using rain_total 0.0 from 
dailyrainin

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: ignored parameter 
ID=IHEUSD37

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: ignored parameter 
PASSWORD=

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: ignored parameter 
action=updateraww

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: ignored parameter 
realtime=1

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: ignored parameter rtfreq=5

Jul 31 07:08:18 weewx[18] INFO user.interceptor: unrecognized parameter 
rainin=0.0

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: raw packet: {'dateTime': 
1722409698, 'usUnits': 1, 'rain_total': 0.0, 'barometer': 30.03, 
'temperature_out': 67.8, 'dewpoint': 65.4, 'humidity_out': 92.0, 
'wind_speed': 0.0, 'wind_gust': 0.0, 'wind_dir': 0.0, 'temperature_in': 
80.4, 'humidity_in': 59.0, 'rain': 0.0}

Jul 31 07:08:18 weewx[18] DEBUG user.interceptor: mapped packet: 
{'dateTime': 1722409698, 'usUnits': 1, 'barometer': 30.03, 'outHumidity': 
92.0, 'inHumidity': 59.0, 'outTemp': 67.8, 'inTemp': 80.4, 'windSpeed': 
0.0, 'windGust': 0.0, 'windDir': 0.0, 'dewpoint': 65.4, 'rain': 0.0}

Jul 31 07:08:18 weewx[18] DEBUG user.mqtt: data: {'dateTime': 
'1722409698.0', 'barometer_mbar': '1016.9323640926025', 'outHumidity': 
'92.0', 'inHumidity': '59.0', 'outTemp_C': '19.886', 
'inTemp_C': '26.893', 'windSpeed_kph': '0.0', 'windGust_kph': 
'0.0', 'dewpoint_C': '18.557', 'dayRain_mm': '0.0', 
'appTemp_C': '22.921167614995962', 'cloudbase_meter': '208.17462880033375', 
'heatindex_C': '20.335', 'humidex_C': '26.3052624710459', 
'inDewpoint_C': '18.186680066004232', 'rainRate_mm_per_hour': '0.0', 
'windchill_C': '19.886', 'usUnits': '16.0'}

Jul 31 07:08:18 weewx[18] DEBUG weewx.restx: Ambient: url: 
https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?action=updateraw&ID=IHEUSD37&PASSWORD=XXX&softwaretype=weewx-4.10.2&baromin=30.030&dateutc=2024-07-31%2007%3A08%3A18&dewptf=65.4&humidity=092&tempf=67.8&realtime=1&rtfreq=2.5&windgustmph=0.0&windspeedmph=0.0

Jul 31 07:08:18 weewx[18] DEBUG weewx.restx: Wunderground-RF url: 
'https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?action=updateraw&ID=IHEUSD37&PASSWORD=XXX&softwaretype=weewx-4.10.2&baromin=30.030&dateutc=2024-07-31%2007%3A08%3A18&dewptf=65.4&humidity=092&tempf=67.8&realtime=1&rtfreq=2.5&windgustmph=0.0&windspeedmph=0.0'

Jul 31 07:08:18 weewx[18] INFO weewx.restx: MQTT: Published record 
2024-07-31 07:08:18 UTC (1722409698)

Jul 31 07:08:18 weewx[18] INFO weewx.restx: Wunderground-RF: Published 
record 2024-07-31 07:08:18 UTC (1722409698)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e16eee7a-8232-4d53-b191-46ca56

Re: [weewx-user] SQLite3 calculate an item

2024-07-31 Thread wfs...@gmail.com
You can do this with the sqlite3 utility program.  I believe the sql update 
statement you want is:

update archive set signal4 = case when outtemp < 10.0 then 1.0 else 0.0 end;

I tried it on a copy of my database, see attached.

Walt

On Tuesday, July 30, 2024 at 7:03:20 PM UTC-5 Craig Young wrote:

> Good advice Peter .. I will give this a try.
>
> Craig
>
> On Wednesday, July 31, 2024 at 11:18:26 AM UTC+12 p q wrote:
>
>> if I were doing it, I would use SQLite to execute the queries and then I 
>> would check my work with DB Browser.
>>
>> I think you may have misunderstood my backup comment. I would practice on 
>> a copy of my database. Once I had the queries correct, then I'd stop Weewx, 
>> make another backup of the database to be safe, perform the operation, and 
>> then restart Weewx. If you're sure you won't mess up, you can skip practice 
>> and the extra backup.
>>
>> On Tue, Jul 30, 2024 at 4:09 PM Craig Young  wrote:
>>
>>> Absolutely, I would backup the database first .. your idea of using a 
>>> two pass method would work .. would I do that with the weewx database 
>>> utility or some linux based sql app like DB Browser for SQLite?
>>>
>>> On Wednesday, July 31, 2024 at 10:45:47 AM UTC+12 p q wrote:
>>>
 Do yourself a favor and make a backup copy. Test out whatever method 
 you chose on the copy.

 As to the query, I think you could fill the Signal field with 0.0 and 
 then do an UPDATE SQL query where outTemp > 10.0. You can find the SQL 
 syntax online.

 On Tue, Jul 30, 2024 at 3:30 PM Craig Young  
 wrote:

> WeeWx version: 4.10.2
> DB: SQLite3
>
> What is the best method for recalculating an item in the entire 
> database?  Specifically, I want to do this:
>
> signal4 = 1.0 if outTemp < 10.0 else 0.0
>
> So I want the DB update method to look at each record and if the 
> temperature (in that record) is less than 10.0 C then set the signal4 
> value 
> in that record to 1.0, otherwise, set the signal4 value to 0.0.
>
> Do I use wee_database --calc missing?
> or some other method?
>
> There are currently 575,000 records in the database so I really don't 
> want to mess this up.  I assume I need to stop WeeWx while doing this?
>
> Craig
>
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/weewx-user/df5146de-9a51-4c05-888a-17a663d774f4n%40googlegroups.com
>  
> 
> .
>


 -- 
 Peter Quinn
 (415)794-2264 <(415)%20794-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 weewx-user+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/119eea81-a564-4b8c-b84f-3b9bb857e6d6n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Peter Quinn
>> (415)794-2264 <(415)%20794-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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a395b8bf-5ad0-4857-9e3f-77b3dcb45739n%40googlegroups.com.
Stop weewx before messing with the database.

You can update the database with the sqlite3 utility program.

Yes definitely do this on a backup first to make sure you get the result you 
want.

Then I'd copy the live database again, apply the change to the copy, verify it 
is correct and then
replace the existing database with the updated copy

i believe the SQL update statement you want is:

update archive set signal4 = case when outtemp < 10.0 then 1.0 else 0.0 end;


Proof using a copy of my database;  i used heatingvoltage because i don't have 
signal4 and
heatingvoltage isn't used in my setup.

SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> .open weewx.sdb
sqlite> .mode columns
sqlite> .headers on

sqlite> select signal4 from archive;
Error: no such column: signal4

sqlite> select heatingvoltage from archive limit 1;
heatingVoltage
--

sqlite> select case when outtemp < 10.0

[weewx-user] weewx dead

2024-07-31 Thread Marco Citossi
I've tried to restart a lot of times but I get this error. 
"Checking for weewx: weewx dead but pid file exists."
What could be the problem?
Thank.
M.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com.


Re: [weewx-user] weewx dead

2024-07-31 Thread Graham Eddy
delete the pid file. then it will start (and create new pid file)
⊣GE⊢

> On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:
> 
> I've tried to restart a lot of times but I get this error. 
> "Checking for weewx: weewx dead but pid file exists."
> What could be the problem?
> Thank.
> M.
> 
> 
> -- 
> 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 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
>  
> .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/A3AA241C-CC4D-456E-BC3B-B22E0C8A20EC%40geddy.au.


Re: [weewx-user] weewx dead

2024-07-31 Thread Marco Citossi
I don't find the pid file in the ps list.
I've tried to restart the webserver but same problem.

Il giorno mercoledì 31 luglio 2024 alle 15:47:50 UTC+2 Graham Eddy ha 
scritto:

> delete the pid file. then it will start (and create new pid file)
> *⊣GE⊢*
>
> On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:
>
> I've tried to restart a lot of times but I get this error. 
> "Checking for weewx: weewx dead but pid file exists."
> What could be the problem?
> Thank.
> M.
>
>
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3004edfc-4a80-4c82-a777-a5adbbc70e79n%40googlegroups.com.


Re: [weewx-user] weewx dead

2024-07-31 Thread vince
Marco - what os (and version) are you running and which version of weewx ?

In older os using init.d startup files the pid file would be in /var/run if 
that helps any in looking for it.   Generally trying to stop weewx twice 
and then start it (not 'restart') used to work.

On Wednesday, July 31, 2024 at 7:13:50 AM UTC-7 Marco Citossi wrote:

> I don't find the pid file in the ps list.
> I've tried to restart the webserver but same problem.
>
> Il giorno mercoledì 31 luglio 2024 alle 15:47:50 UTC+2 Graham Eddy ha 
> scritto:
>
>> delete the pid file. then it will start (and create new pid file)
>> *⊣GE⊢*
>>
>> On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:
>>
>> I've tried to restart a lot of times but I get this error. 
>> "Checking for weewx: weewx dead but pid file exists."
>> What could be the problem?
>> Thank.
>> M.
>>
>>
>> -- 
>> 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 on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/97532e95-e395-4331-99cc-14ad88fa5678n%40googlegroups.com.


[weewx-user] Re: Bresser 5in1 in docker on Synology

2024-07-31 Thread 'Kris_bresser' via weewx-user
And there seems to be a second issue, look at the logs:

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: GET: 
ID=&PASSWORD=&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=30.06&tempf=68.1&dewptf=66.3&humidity=94&windspeedmph=0&windgustmph=0&winddir=22&rainin=0.01&dailyrainin=0.01&indoortempf=80.4&indoorhumidity=60

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: raw data: 
ID=&PASSWORD=XXX&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=30.06&tempf=68.1&dewptf=66.3&humidity=94&windspeedmph=0&windgustmph=0&winddir=22&rainin=0.01&dailyrainin=0.01&indoortempf=80.4&indoorhumidity=60

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: using rain_total 0.01 
from dailyrainin

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: ignored parameter ID=

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: ignored parameter 
PASSWORD=

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: ignored parameter 
action=updateraww

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: ignored parameter 
realtime=1

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: ignored parameter rtfreq=5

Jul 31 07:47:18 weewx[19] INFO user.interceptor: unrecognized parameter 
rainin=0.01

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: raw packet: {'dateTime': 
1722412038, 'usUnits': 1, 'rain_total': 0.01, 'barometer': 30.06, 
'temperature_out': 68.1, 'dewpoint': 66.3, 'humidity_out': 94.0, 
'wind_speed': 0.0, 'wind_gust': 0.0, 'wind_dir': 22.0, 'temperature_in': 
80.4, 'humidity_in': 60.0, 'rain': 0.0}

Jul 31 07:47:18 weewx[19] DEBUG user.interceptor: mapped packet: 
{'dateTime': 1722412038, 'usUnits': 1, 'barometer': 30.06, 'outHumidity': 
94.0, 'inHumidity': 60.0, 'outTemp': 68.1, 'inTemp': 80.4, 'windSpeed': 
0.0, 'windGust': 0.0, 'windDir': 22.0, 'dewpoint': 66.3, 'rain': 0.0}

Jul 31 07:47:18 weewx[19] DEBUG user.mqtt: data: {'dateTime': 
'1722412038.0', 'barometer_mbar': '1017.9482805402474', 'outHumidity': 
'94.0', 'inHumidity': '60.0', 'outTemp_C': '20.054', 
'inTemp_C': '26.893', 'windSpeed_kph': '0.0', 'windGust_kph': 
'0.0', 'dewpoint_C': '19.054', 'dayRain_mm': '0.0', 
'appTemp_C': '23.31513352227849', 'cloudbase_meter': '165.3833616182381', 
'heatindex_C': '20.575', 'humidex_C': '26.866234390281974', 
'inDewpoint_C': '18.455042874306713', 'rainRate_mm_per_hour': '0.0', 
'windchill_C': '20.054', 'usUnits': '16.0'}

Jul 31 07:47:18 weewx[19] DEBUG weewx.restx: Ambient: url: 
https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?action=updateraw&ID=XXX&PASSWORD=XXX&softwaretype=weewx-4.10.2&baromin=30.060&dateutc=2024-07-31%2007%3A47%3A18&dewptf=66.3&humidity=094&tempf=68.1&realtime=1&rtfreq=2.5&windgustmph=0.0&windspeedmph=0.0
 


Jul 31 07:47:18 weewx[19] INFO weewx.restx: MQTT: Published record 
2024-07-31 07:47:18 UTC (1722412038)

Jul 31 07:47:18 weewx[19] DEBUG weewx.restx: Wunderground-RF url: '
https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?action=updateraw&ID=XXX&PASSWORD=XXX&softwaretype=weewx-4.10.2&baromin=30.060&dateutc=2024-07-31%2007%3A47%3A18&dewptf=66.3&humidity=094&tempf=68.1&realtime=1&rtfreq=2.5&windgustmph=0.0&windspeedmph=0.0
 

'

Jul 31 07:47:18 weewx[19] INFO weewx.restx: Wunderground-RF: Published 
record 2024-07-31 07:47:18 UTC (1722412038)

*Rain_total = 0.01 (inch), which stems from dailyrainin, but this is not 
saved in dayRain or rain, as it is 0.0. *

Thank you for your help.

Kris
On Wednesday, July 31, 2024 at 10:49:09 AM UTC+2 Kris_bresser wrote:

> Hi all
>
> I am enjoying a lot my Bresser Wifi Pro 5in1 weather station and I am 
> pushing the data into my home assistant via the WeeWX docker. I first 
> explain a bit how I did it, as it may help users with similar hardware, but 
> at the end, I do have a question.
>
> These are the things I did to get it working:
>
> My weather station unfortunately did not allow for a direct connection to 
> a home server, but it does allow for an upload to Wunderground. I created 
> an account, and filled out the details and from then onwards, my station is 
> sending data to Wunderground. But, I still wanted to capture the traffic 
> for using in my home assistant. That's why in my ASUS router with Merlin 
> firmware, I created some IP-tables to redirect the traffic to Wunderground 
> to my WeeWx server:
>  iptables -t nat -A PREROUTING -s bresserIP -

Re: [weewx-user] SQLite3 calculate an item

2024-07-31 Thread Craig Young
Thank you heaps Walt .. exactly what I was looking for.

Craig

On Wednesday, July 31, 2024 at 11:12:27 PM UTC+12 wfs...@gmail.com wrote:

> You can do this with the sqlite3 utility program.  I believe the sql 
> update statement you want is:
>
> update archive set signal4 = case when outtemp < 10.0 then 1.0 else 0.0 
> end;
>
> I tried it on a copy of my database, see attached.
>
> Walt
>
> On Tuesday, July 30, 2024 at 7:03:20 PM UTC-5 Craig Young wrote:
>
>> Good advice Peter .. I will give this a try.
>>
>> Craig
>>
>> On Wednesday, July 31, 2024 at 11:18:26 AM UTC+12 p q wrote:
>>
>>> if I were doing it, I would use SQLite to execute the queries and then I 
>>> would check my work with DB Browser.
>>>
>>> I think you may have misunderstood my backup comment. I would practice 
>>> on a copy of my database. Once I had the queries correct, then I'd stop 
>>> Weewx, make another backup of the database to be safe, perform the 
>>> operation, and then restart Weewx. If you're sure you won't mess up, you 
>>> can skip practice and the extra backup.
>>>
>>> On Tue, Jul 30, 2024 at 4:09 PM Craig Young  
>>> wrote:
>>>
 Absolutely, I would backup the database first .. your idea of using a 
 two pass method would work .. would I do that with the weewx database 
 utility or some linux based sql app like DB Browser for SQLite?

 On Wednesday, July 31, 2024 at 10:45:47 AM UTC+12 p q wrote:

> Do yourself a favor and make a backup copy. Test out whatever method 
> you chose on the copy.
>
> As to the query, I think you could fill the Signal field with 0.0 and 
> then do an UPDATE SQL query where outTemp > 10.0. You can find the SQL 
> syntax online.
>
> On Tue, Jul 30, 2024 at 3:30 PM Craig Young  
> wrote:
>
>> WeeWx version: 4.10.2
>> DB: SQLite3
>>
>> What is the best method for recalculating an item in the entire 
>> database?  Specifically, I want to do this:
>>
>> signal4 = 1.0 if outTemp < 10.0 else 0.0
>>
>> So I want the DB update method to look at each record and if the 
>> temperature (in that record) is less than 10.0 C then set the signal4 
>> value 
>> in that record to 1.0, otherwise, set the signal4 value to 0.0.
>>
>> Do I use wee_database --calc missing?
>> or some other method?
>>
>> There are currently 575,000 records in the database so I really don't 
>> want to mess this up.  I assume I need to stop WeeWx while doing this?
>>
>> Craig
>>
>> -- 
>> 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 on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/df5146de-9a51-4c05-888a-17a663d774f4n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Peter Quinn
> (415)794-2264 <(415)%20794-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 weewx-user+...@googlegroups.com.

>>> To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/119eea81-a564-4b8c-b84f-3b9bb857e6d6n%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>> Peter Quinn
>>> (415)794-2264 <(415)%20794-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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7ab0aa5f-a172-4f3a-81f7-208fbae82f27n%40googlegroups.com.


Re: [weewx-user] weewx dead

2024-07-31 Thread Marco Citossi
Hi vince! 
Centos 7, weewx 3.8.0.a1
I've find pid in /var/run...deleted, stopped weewx 2 times (failed), start 
again but nothing same problem.
Thanks.


Il giorno mercoledì 31 luglio 2024 alle 19:24:26 UTC+2 vince ha scritto:

> Marco - what os (and version) are you running and which version of weewx ?
>
> In older os using init.d startup files the pid file would be in /var/run 
> if that helps any in looking for it.   Generally trying to stop weewx twice 
> and then start it (not 'restart') used to work.
>
> On Wednesday, July 31, 2024 at 7:13:50 AM UTC-7 Marco Citossi wrote:
>
>> I don't find the pid file in the ps list.
>> I've tried to restart the webserver but same problem.
>>
>> Il giorno mercoledì 31 luglio 2024 alle 15:47:50 UTC+2 Graham Eddy ha 
>> scritto:
>>
>>> delete the pid file. then it will start (and create new pid file)
>>> *⊣GE⊢*
>>>
>>> On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:
>>>
>>> I've tried to restart a lot of times but I get this error. 
>>> "Checking for weewx: weewx dead but pid file exists."
>>> What could be the problem?
>>> Thank.
>>> M.
>>>
>>>
>>> -- 
>>> 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 on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>
>>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9bd28098-0985-433a-87b8-1dffbd2d1614n%40googlegroups.com.


Re: [weewx-user] weewx dead

2024-07-31 Thread Marco Citossi
Anyway also from the other webserver with weewx 5 I get an error.
Could be a problem of firewall again?
 
weewx.service - WeeWX
   Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor 
preset: disabled)
   Active: failed (Result: exit-code) since Wed 2024-07-31 22:28:35 CEST; 
2s ago
 Docs: https://weewx.com/docs
  Process: 59322 ExecStart=/usr/bin/weewxd /etc/weewx/weewx.conf 
(code=exited, status=4)
 Main PID: 59322 (code=exited, status=4)

CRITICAL weewx.engine:   Vantage.__init__(self, 
**config_dict[DRIVER_NA>
CRITICAL weewx.engine: File 
"/usr/share/weewx/weewx/drivers/vantage.py">
CRITICAL weewx.engine:   self.port.openPort()
CRITICAL weewx.engine: File 
"/usr/share/weewx/weewx/drivers/vantage.py">
weewx.engine:   raise weewx.WeeWxIOError(ex)
weewx.engine:   weewx.WeeWxIOError: [Errno 113] No route to host
CRITICAL __main__: Unable to load driver: [Errno 113] No route to host
weewxd[59322]: CRITICAL __main__:   Exiting...
weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
weewx.service: Failed with result 'exit-code'.

Il giorno mercoledì 31 luglio 2024 alle 22:23:51 UTC+2 Marco Citossi ha 
scritto:

> Hi vince! 
> Centos 7, weewx 3.8.0.a1
> I've find pid in /var/run...deleted, stopped weewx 2 times (failed), start 
> again but nothing same problem.
> Thanks.
>
>
> Il giorno mercoledì 31 luglio 2024 alle 19:24:26 UTC+2 vince ha scritto:
>
>> Marco - what os (and version) are you running and which version of weewx ?
>>
>> In older os using init.d startup files the pid file would be in /var/run 
>> if that helps any in looking for it.   Generally trying to stop weewx twice 
>> and then start it (not 'restart') used to work.
>>
>> On Wednesday, July 31, 2024 at 7:13:50 AM UTC-7 Marco Citossi wrote:
>>
>>> I don't find the pid file in the ps list.
>>> I've tried to restart the webserver but same problem.
>>>
>>> Il giorno mercoledì 31 luglio 2024 alle 15:47:50 UTC+2 Graham Eddy ha 
>>> scritto:
>>>
 delete the pid file. then it will start (and create new pid file)
 *⊣GE⊢*

 On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:

 I've tried to restart a lot of times but I get this error. 
 "Checking for weewx: weewx dead but pid file exists."
 What could be the problem?
 Thank.
 M.


 -- 
 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 on the web visit 
 https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
  
 
 .




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fd1a2e43-771b-471c-8af7-42f6ca60f7cen%40googlegroups.com.


[weewx-user] WH57 and gateway 1100

2024-07-31 Thread bell...@gmail.com
I finally had some time to experiment with my WH57. Here is what I ended up 
doing.
I have the driver polling the 1100 every 20 seconds and my archive interval 
is 5 minutes.

‘Out of the box’ the number of strikes in an archive interval is persisted 
and the distance from the last strike, even if no strikes occurred in the 
interval. Like many others, I only wanted the distance if a strike 
occurred. In the [StdCalibrate][[Corrections]] I added the following.
lightning_distance = lightning_distance if lightning_strike_count and 
lightning_strike_count > 0 else None
This checks that the loop packet field lightning_strike_count has a value 
and it is greater than 0. Checking that the field has a value is important 
because the first loop packet after starting WeeWX sets it to None.

Persisting the last strike in an archive interval is nice, but I also 
wanted to persist the closest. I also figured if I was capturing the last 
strike, I might as well capture the first strike. I also decided to capture 
the time of the first and last strike. (Note, without writing some code I 
could not figure out a way to capture the time of the min (closest) strike.

I also decided that the lightning_distance field would persist the average 
distance to the strikes in the archive period. I did this for a couple of 
reasons. First, for more consistent naming conventions. Second, it would 
easily work with the Seasons skin. Note, I have no intention of using the 
additional first, last, and min values in the Seasons skin. I will use my 
WeeWX-JAS skin to display these.

The first thing to do is get the data into these additional fields. I used 
the [StdCalibrate][[Corrections]] section. I ended up with the following.
lightning_last_distance = lightning_distance if lightning_strike_count and 
lightning_strike_count > 0 else None
lightning_last_det_time = lightning_last_det_time if lightning_strike_count 
and lightning_strike_count > 0 else None

lightning_first_distance = lightning_distance if lightning_strike_count and 
lightning_strike_count > 0 else None
lightning_first_det_time = lightning_last_det_time if 
lightning_strike_count and lightning_strike_count > 0 else None

lightning_min_distance = lightning_distance if lightning_strike_count and 
lightning_strike_count > 0 else None

lightning_distance = lightning_distance if lightning_strike_count and 
lightning_strike_count > 0 else None

With these ‘corrections’, WeeWX now accumulates the lightning data into 
multiple fields. In the loop packet, all of the distance fields have the 
same value. Same with the time fields. Using the accumulator function, the 
first, last, and min values can be extracted and put into the archive 
record.

My [Accumulator] section looks like the following.
# Additional lightning data, note lightning_last_det_time is below in 
the GW1000 section
[[lightning_last_distance]]
extractor = last
[[lightning_first_distance]]
extractor = first
[[lightning_first_det_time]]
extractor = first
[[lightning_min_distance]]
extractor = min
# 'override' the setting that GW1000 driver has (I decided to set it 
here and delete from the GW1000 section)
[[lightning_distance]]
extractor = avg

Next, I used weectl database to add the new fields to the database.

Finally I updated the bin/user/extensions.py with the units for the new 
fields.
import weewx.units
weewx.units.obs_group_dict['lightning_last_distance'] = 'group_distance'
weewx.units.obs_group_dict['lightning_last_det_time'] = 'group_time'
weewx.units.obs_group_dict['lightning_first_distance'] = 'group_distance'
weewx.units.obs_group_dict['lightning_first_det_time'] = 'group_time'
weewx.units.obs_group_dict['lightning_min_distance'] = 'group_distance'

Known limitations.
If there is more than one strike is in a loop packet interval (20 seconds), 
the loop packet will have the number of strikes and the packet will have 
the distance to and time of the last strike.

Now to get some real data to experiment with displaying the data…
rich

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e4914b23-6a2a-41ab-93bf-d25622d19540n%40googlegroups.com.


Re: [weewx-user] weewx dead

2024-07-31 Thread vince
If you're running weewx 5.1 yes it is very likely you need the weewx user 
added to the group(s) needed to access network devices.   See the wiki and 
FAQ and many (many) other posts here with how to debug and fix the problem.

On Wednesday, July 31, 2024 at 1:34:57 PM UTC-7 Marco Citossi wrote:

> Anyway also from the other webserver with weewx 5 I get an error.
> Could be a problem of firewall again?
>  
> weewx.service - WeeWX
>Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor 
> preset: disabled)
>Active: failed (Result: exit-code) since Wed 2024-07-31 22:28:35 CEST; 
> 2s ago
>  Docs: https://weewx.com/docs
>   Process: 59322 ExecStart=/usr/bin/weewxd /etc/weewx/weewx.conf 
> (code=exited, status=4)
>  Main PID: 59322 (code=exited, status=4)
>
> CRITICAL weewx.engine:   Vantage.__init__(self, 
> **config_dict[DRIVER_NA>
> CRITICAL weewx.engine: File 
> "/usr/share/weewx/weewx/drivers/vantage.py">
> CRITICAL weewx.engine:   self.port.openPort()
> CRITICAL weewx.engine: File 
> "/usr/share/weewx/weewx/drivers/vantage.py">
> weewx.engine:   raise weewx.WeeWxIOError(ex)
> weewx.engine:   weewx.WeeWxIOError: [Errno 113] No route to host
> CRITICAL __main__: Unable to load driver: [Errno 113] No route to host
> weewxd[59322]: CRITICAL __main__:   Exiting...
> weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
> weewx.service: Failed with result 'exit-code'.
>
> Il giorno mercoledì 31 luglio 2024 alle 22:23:51 UTC+2 Marco Citossi ha 
> scritto:
>
>> Hi vince! 
>> Centos 7, weewx 3.8.0.a1
>> I've find pid in /var/run...deleted, stopped weewx 2 times (failed), 
>> start again but nothing same problem.
>> Thanks.
>>
>>
>> Il giorno mercoledì 31 luglio 2024 alle 19:24:26 UTC+2 vince ha scritto:
>>
>>> Marco - what os (and version) are you running and which version of weewx 
>>> ?
>>>
>>> In older os using init.d startup files the pid file would be in /var/run 
>>> if that helps any in looking for it.   Generally trying to stop weewx twice 
>>> and then start it (not 'restart') used to work.
>>>
>>> On Wednesday, July 31, 2024 at 7:13:50 AM UTC-7 Marco Citossi wrote:
>>>
 I don't find the pid file in the ps list.
 I've tried to restart the webserver but same problem.

 Il giorno mercoledì 31 luglio 2024 alle 15:47:50 UTC+2 Graham Eddy ha 
 scritto:

> delete the pid file. then it will start (and create new pid file)
> *⊣GE⊢*
>
> On 31 Jul 2024, at 11:37 PM, Marco Citossi  wrote:
>
> I've tried to restart a lot of times but I get this error. 
> "Checking for weewx: weewx dead but pid file exists."
> What could be the problem?
> Thank.
> M.
>
>
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/weewx-user/979e0836-166b-4da1-abca-dd37f5d9e483n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e443e18e-004e-4b12-a920-55d8c9f1e40bn%40googlegroups.com.


[weewx-user] Re: Belchertown and MQTT configuration error

2024-07-31 Thread
I checked mosquitto.conf and it has "listener 1883" in it.  I also disabled 
my pihole and checked that my raspberry pi is listening on port 1883.  

On Friday, July 26, 2024 at 11:23:25 PM UTC-4 M&M wrote:

> I checked journalctl and now I'm seeing this error:
>
> Jul 26 23:16:30 raspberrypi weewxd[1141]: ERROR user.ambientweatherapi: 
> AmbientAPI get_devices() returned empty dict
> Jul 26 23:16:30 raspberrypi weewxd.py[1141]: ambientweatherapi driver 
> encountered an error.
> Jul 26 23:16:30 raspberrypi weewxd[1141]: ERROR user.ambientweatherapi: 
> ambientweatherapi driver encountered an error.
> Jul 26 23:16:30 raspberrypi weewxd.py[1141]: Error caught was: AmbientAPI 
> get_devices() returned empty dict
> Jul 26 23:16:30 raspberrypi weewxd[1141]: ERROR user.ambientweatherapi: 
> Error caught was: AmbientAPI get_devices() returned empty dict
> Jul 26 23:16:30 raspberrypi weewxd.py[1141]: ambientweatherapi driver had 
> an error sending data to weewx.
> Jul 26 23:16:30 raspberrypi weewxd[1141]: ERROR user.ambientweatherapi: 
> ambientweatherapi driver had an error sending data to weewx.
> Jul 26 23:16:30 raspberrypi weewxd.py[1141]: Error caught was: Previous 
> error occured, skipping packet build.
> Jul 26 23:16:30 raspberrypi weewxd[1141]: ERROR user.ambientweatherapi: 
> Error caught was: Previous error occured, skipping packet build.
>
> On Friday, July 26, 2024 at 11:20:51 PM UTC-4 M&M wrote:
>
>> Making some progress.  I am back to having weewx running and I now have 
>> mosquito running as well.  I was able to test that service by mosquitto_sub 
>> and mosquitto_pub which worked by sending "hello world".  However when I 
>> check my local Belchertown page, it now says this at the top:
>>
>> Failed connecting to the weather station. Please try again later! Last 
>> Updated 26 July 2024, 23:10:00
>>
>> On Friday, July 26, 2024 at 2:02:17 PM UTC-4 M&M wrote:
>>
>>> Oh thats right!  I edited the /etc/default/locales file.  I changed it 
>>> from en_GB.UTF-8 to en_US.UTF-8 since I was trying to fix the time in 
>>> Belchertown skin to show a 12h time format.  I believe I fixed it and for 
>>> some reason, i decided to edit the locales file.  I'll change that back 
>>> when I get to that system.
>>>
>>> Thanks.  I believe that is what will fix it.
>>>
>>> On Friday, July 26, 2024 at 12:17:42 PM UTC-4 vince wrote:
>>>

 https://stackoverflow.com/questions/14547631/python-locale-error-unsupported-locale-settling

 Have you messed with system locale at the os level or edited it in some 
 weewx or mqtt config file ? There have been some skeletal reports about 
 this over the years but I've never really understood the explanations.

 On Friday, July 26, 2024 at 3:41:42 AM UTC-7 Mark Jenks wrote:

> Make sure MQTT is running correctly. You can test it via CLI. This 
> page goes into configuring a cert, you can stop reading at that point.
>
>
> https://medium.com/gravio-edge-iot-platform/how-to-set-up-a-mosquitto-mqtt-broker-securely-using-client-certificates-82b2aaaef9c8
>
>
> On Thursday, July 25, 2024 at 10:27:54 PM UTC-5 M&M wrote:
>
>> Also I tried commenting out all of the MQTT lines in weewx.conf so 
>> that I could get the service running again but it isn't running at all.  
>> Giving me the same error as I posted above.
>>
>> On Thursday, July 25, 2024 at 11:11:15 PM UTC-4 M&M wrote:
>>
>>> I'm getting closer.  Mosquito service is running but weewx gives me 
>>> the follow error in journalctl:
>>>
>>> Jul 25 22:59:55 raspberrypi weewxd[25852]: INFO __main__: 
>>> Terminating weewx version 5.0.2
>>> Jul 25 22:59:55 raspberrypi systemd[1]: weewx.service: Succeeded.
>>> Jul 25 22:59:55 raspberrypi systemd[1]: Stopped WeeWX.
>>> Jul 25 22:59:55 raspberrypi systemd[1]: weewx.service: Consumed 3h 
>>> 44min 13.462s CPU time.
>>> Jul 25 23:00:51 raspberrypi systemd[1]: Started WeeWX.
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: INFO __main__: 
>>> Initializing weewxd version 5.0.2
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: INFO __main__: Command 
>>> line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: Traceback (most recent 
>>> call last):
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>> "/usr/share/weewx/weewxd.py", line 265, in 
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: main()
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>> "/usr/share/weewx/weewxd.py", line 107, in main
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: weewx_root, 
>>> user_module = weeutil.startup.initialize(config_dict)
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>> "/usr/share/weewx/weeutil/startup.py", line 67, in initialize
>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: 
>>> importlib.import_module('user.extensions')
>>

[weewx-user] Re: WH57 and gateway 1100

2024-07-31 Thread 'michael.k...@gmx.at' via weewx-user
Hi Rich,

that sounds to me as if your approach is as close as you can get, given 
that the Ecowitt devices only let you poll data in a given Interval. Also, 
the WH57 is more a "toy" than a sensor, missing out the vast majority of 
lightning strikes, and mine is set to the maximum sensitivity (but not 
indoor), and it often misses lightnings that are within less than 3km. 
Anyway, as I am running a couple of Ecowitt stations in parallel, I'll 
configure one of them the way you described here and compare the one to the 
other. Last night would have delivered good data:
[image: The weather in AT, Salzburg, Hallein, Rif.png]

bell...@gmail.com schrieb am Donnerstag, 1. August 2024 um 01:52:27 UTC+2:

> I finally had some time to experiment with my WH57. Here is what I ended 
> up doing.
> I have the driver polling the 1100 every 20 seconds and my archive 
> interval is 5 minutes.
>
> ‘Out of the box’ the number of strikes in an archive interval is persisted 
> and the distance from the last strike, even if no strikes occurred in the 
> interval. Like many others, I only wanted the distance if a strike 
> occurred. In the [StdCalibrate][[Corrections]] I added the following.
> lightning_distance = lightning_distance if lightning_strike_count and 
> lightning_strike_count > 0 else None
> This checks that the loop packet field lightning_strike_count has a value 
> and it is greater than 0. Checking that the field has a value is important 
> because the first loop packet after starting WeeWX sets it to None.
>
> Persisting the last strike in an archive interval is nice, but I also 
> wanted to persist the closest. I also figured if I was capturing the last 
> strike, I might as well capture the first strike. I also decided to capture 
> the time of the first and last strike. (Note, without writing some code I 
> could not figure out a way to capture the time of the min (closest) strike.
>
> I also decided that the lightning_distance field would persist the average 
> distance to the strikes in the archive period. I did this for a couple of 
> reasons. First, for more consistent naming conventions. Second, it would 
> easily work with the Seasons skin. Note, I have no intention of using the 
> additional first, last, and min values in the Seasons skin. I will use my 
> WeeWX-JAS skin to display these.
>
> The first thing to do is get the data into these additional fields. I used 
> the [StdCalibrate][[Corrections]] section. I ended up with the following.
> lightning_last_distance = lightning_distance if lightning_strike_count and 
> lightning_strike_count > 0 else None
> lightning_last_det_time = lightning_last_det_time if 
> lightning_strike_count and lightning_strike_count > 0 else None
>
> lightning_first_distance = lightning_distance if lightning_strike_count 
> and lightning_strike_count > 0 else None
> lightning_first_det_time = lightning_last_det_time if 
> lightning_strike_count and lightning_strike_count > 0 else None
>
> lightning_min_distance = lightning_distance if lightning_strike_count and 
> lightning_strike_count > 0 else None
>
> lightning_distance = lightning_distance if lightning_strike_count and 
> lightning_strike_count > 0 else None
>
> With these ‘corrections’, WeeWX now accumulates the lightning data into 
> multiple fields. In the loop packet, all of the distance fields have the 
> same value. Same with the time fields. Using the accumulator function, the 
> first, last, and min values can be extracted and put into the archive 
> record.
>
> My [Accumulator] section looks like the following.
> # Additional lightning data, note lightning_last_det_time is below in 
> the GW1000 section
> [[lightning_last_distance]]
> extractor = last
> [[lightning_first_distance]]
> extractor = first
> [[lightning_first_det_time]]
> extractor = first
> [[lightning_min_distance]]
> extractor = min
> # 'override' the setting that GW1000 driver has (I decided to set it 
> here and delete from the GW1000 section)
> [[lightning_distance]]
> extractor = avg
>
> Next, I used weectl database to add the new fields to the database.
>
> Finally I updated the bin/user/extensions.py with the units for the new 
> fields.
> import weewx.units
> weewx.units.obs_group_dict['lightning_last_distance'] = 'group_distance'
> weewx.units.obs_group_dict['lightning_last_det_time'] = 'group_time'
> weewx.units.obs_group_dict['lightning_first_distance'] = 'group_distance'
> weewx.units.obs_group_dict['lightning_first_det_time'] = 'group_time'
> weewx.units.obs_group_dict['lightning_min_distance'] = 'group_distance'
>
> Known limitations.
> If there is more than one strike is in a loop packet interval (20 
> seconds), the loop packet will have the number of strikes and the packet 
> will have the distance to and time of the last strike.
>
> Now to get some real data to experiment with displaying the data…
> rich
>

-- 
You received this message because you are subscrib

[weewx-user] Re: GW1000 driver doesn't show values from WH46

2024-07-31 Thread j.fri...@gmail.com
Hi Gary,

the  v0.6.3b1 works wery well. There is only one possible issue with PMI 4. 
index.html page shows it in other way then others values .

Thank you very much for your help.

Jarda

*Outout from the driver :*
'pm1_0': '9.5', 'pm1_0_24h_avg': '1.5', 'pm2_55': '10.6', 'pm2_55_24h_avg': 
'2.5', 'pm4_0': '11.0', 'pm4_0_24h_avg': '3.2', 'pm10_0': '11.2', 
'pm10_0_24h_avg': '3.6'

*Database values :*
PM1.0  = 10.6
PM2.5  = 11.7
PM4.0  =  12.06667
PM10 =  12.26667

*Index.html page :*
[image: Výstřižek.PNG]



Dne úterý 30. července 2024 v 13:51:16 UTC+2 uživatel gjr80 napsal:

You can try v0.6.3b1 which includes support for the WH46 air quality 
sensor. If a WH46 is connected the v0.6.3 driver should emit the same 
temperature, PM2.5, PM10 and CO2 fields as with a WH45. Additional fields 
pm1_0, pm1_0_24h_avg, pm4_0, pm4_0_24h_avg should also be emitted with the 
WH46 PM1 and PM4 data and 24hour averages respectively. v0.6.3 should also 
automatically determine whether a WH45 or WH46 is present and correctly 
name WH45/WH46 battery and signal state fields.

Note that I have had to change the names of a the PM10 fields emitted by 
the driver when used with a WH45 sensor. This will only affect you if you 
previously used a WH45 sensor. The driver now emits pm10_0 and 
pm10_0_24h_avg fields (previously the fields were pm10 and pm10_24h_avg). 
Users who have previously used a WH45 sensor will need to either change 
their field map if mapping these fields to some other WeeWX field, or if 
the pm10 and pm10_24h_avg fields are used in the database schema the 
database fields will need to be renamed to the new field names.

v0.6.3 also includes support for the WS85 sensor array as well as including 
a revised approach to device discovery that is much more reliable than the 
previous approach. Note the recommended approach remains to specify the 
device IP address in the WeeWX config file rather than have the driver rely 
on discovery

I have not released v0.6.3 yet, rather I have kept it at b1 until someone 
verifies it's use it with a WH45/46. If you wish to try v0.6.3b1 the 
following instructions should be used:

1. Rename your existing gateway driver to gw1000_0_6_1.py so you can easily 
revert if necessary:
$ cp /etc/weewx/bin/user/gw1000.py /etc/weewx/bin/user/gw1000_0_6_1.py

2. Download the v0.6.3b1 driver file and save it to /etc/weewx/bin/user:
$ wget -P /etc/weewx/bin/user 
https://raw.githubusercontent.com/gjr80/weewx-gw1000/v0.6.3/bin/user/gw1000.py

3. You can run the driver directly as you did in you OP, you should see the 
WH46 obs fields as well as WH46 battery and signal state data. You might 
also find using the --live-data option useful when running the driver 
directly.

4. If you are happy running the driver directly you can restart WeeWX and 
it will pick up the v0.6.3 driver.

Note the above commands may require prefixing with sudo. If you need to 
revert to your original driver just delete /etc/weewx/bin/user/gw1000.py and 
rename /etc/weewx/bin/user/gw1000_0_6_1.py to /etc/weewx/bin/user/gw1000.py
. 

If any problems please let me know.

Gary

On Monday 29 July 2024 at 22:55:21 UTC+10 j.fri...@gmail.com wrote:

Hello,

I added new WH46 to my Ecowitt system. I can view data in ecowitt.net and 
in mobile application too.

My main system is weewx https://pocasi.frimlovi.com but the new WH46 data 
didn't appear automatically in dashboard.

If I run PYTHONPATH=/usr/share/weewx:/etc/weewx/bin python3 
/etc/weewx/bin/user/gw1000.py --test-service --ip-address=my_IP it shows 
data from all measures correctly but from WH46 it shows only data about 
battery and signal -  'wh45_batt': '5', 'wh45_sig': '4'

I use the latest version of GW1000 driver - 0.6.1

I tryed to add data in weewx.conf - [[field_map_extensions]] and in 
skin.conf in appearance but nothing changed.

Can you help me please ?

Thank you in advance.

Jarda

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5d259c56-7ed4-46aa-8185-3b7fcb55c289n%40googlegroups.com.