I've patched wee_import to handle the changed WU API response. The patched 
code will appear in the v5.0.0 (when released). In the meantime if you wish 
to use it now with any other the v5.0.0 beta releases you can by 
downloading the patched wuimport.py and replacing your existing version. 
The location of the v5 WeeWX files is significantly different to that for 
v4. You indicated you installed v5 via pip, so the following instructions 
should work in this case (or until I have a better approach for installing 
patched file):

1. download the patched wuimport.py:

$ wget -P /var/tmp 
https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/wuimport.py

2. locate your existing wuimport.py. If you followed the v5 install 
instructions and installed via pip you may find wuimport.py in something 
like ~/weewx-venv/lib/python3.9/site-packages/weeimport . If you used a 
different virtual environment name to weewx-venv or are running a different 
python version change the path accordingly, or depending on your system the 
path may be different again. Either way you need to find wuimport.py. 

3. If you cannot find wuimport.py on your system or are not sure do not 
proceed or guess - stop and seek clarification. Once you have found 
wuimport.py copy the downloaded version in /var/tmp over the existing 
version. 

4. you can now use wee_import to import from WU.

Gary

On Wednesday, 25 October 2023 at 09:22:06 UTC+10 gjr80 wrote:

> It's is not your config, it looks like WU has changed the header content 
> in one (or more) of their API responses. I should be able to have a look 
> tonite and provide a fix.
>
> Gary
>
> On Wednesday, 25 October 2023 at 08:06:04 UTC+10 weewx-user wrote:
>
> The most annoying thing is that I have errors with wee_import to feed my 
> mysql database:
>
> *sylvain@gandalf:~/weewx-venv/lib/python3.11/site-packages>** python3 
> wee_import.py --config=/home/sylvain/weewx-data/weewx.conf 
> --import-config=/home/sylvain /weewx-data/util/import/wu-example.conf 
> --dry-run --from=2022-7-12 --to=2023-10-24 --verbose*
> Using WeeWX configuration file /home/sylvain/weewx-data/weewx.conf
> Starting wee_import...
> Observation history for Weather Underground station 'I********' will be 
> imported.
> The following options will be used:
>       config=/home/sylvain/weewx-data/weewx.conf, 
> import-config=/home/sylvain/weewx-data/util/import/wu-example.conf
>       station=I*******, from=2022-7-12, to=2023-10-24
>       apiKey=****************************0b80
>       dry-run=True, calc_missing=True, ignore_invalid_data=True
>       slice=250, interval=x, wind_direction=[0.0, 360.0]
> Using database binding 'wx_binding', which is bound to database 'weewx'
> Destination table 'archive' unit system is '0x11' (METRICWX).
> Missing derived observations will be calculated.
> Observations timestamped after 2022-07-12 00:00:00 CEST (1657576800) and 
> up to and
> including 2023-10-25 00:00:00 CEST (1698184800) will be imported.
> This is a dry run, imported data will not be saved to archive.
> Starting dry run import...
> Records covering multiple periods have been identified for import.
> Period 1...
> Obtaining raw import data for period 1 ...
> Traceback (most recent call last):
>    File 
> "/home/sylvain/weewx-venv/lib/python3.11/site-packages/wee_import.py", line 
> 899, in <module>
>      hand()
>    File 
> "/home/sylvain/weewx-venv/lib/python3.11/site-packages/wee_import.py", line 
> 829, in main
>      source_obj.run()
>    File 
> "/home/sylvain/weewx-venv/lib/python3.11/site-packages/weeimport/weeimport.py",
>  
> line 375, in run
>      _raw_data = self.getRawData(period)
>                  ^^^^^^^^^^^^^^^^^^^^^
>    File 
> "/home/sylvain/weewx-venv/lib/python3.11/site-packages/weeimport/wuimport.py",
>  
> line 249, in getRawData
>      _raw_data = f.read().decode(char_set)
>                  ^^^^^^^^^^^^^^^^^^^^^^^
> TypeError: decode() argument 'encoding' must be str, not None
>
>
> What did I configure incorrectly?
>
>

-- 
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/568e9341-20e3-48e8-b81f-b3b1b44cd723n%40googlegroups.com.

Reply via email to