If you are running WeeWX v4.10.2 under python3 you should be able to use 
(untested) the patched wee_import files mentioned in this thread 
<https://groups.google.com/g/weewx-user/c/VoD9swS21UU/m/E2lJn8f5BgAJ> and 
replace the v4.10.2 versions. Since you are running WeeWX v4.x the process 
(and instructions) are a little less complicated:

1. Rename /usr/share/weewx/weeimport/wuimport.py and 
/usr/share/weewx/weeimport/weeimport.py so you can revert the files if 
needed:

$ mv /usr/share/weewx/weeimport/wuimport.py 
/usr/share/weewx/weeimport/wuimport_orig.py
$ mv /usr/share/weewx/weeimport/weeimport.py 
/usr/share/weewx/weeimport/weeimport_orig.py

2. Download the patched files wuimport.py and weeimport.py:

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

3. You can now use wee_import.

If you need to revert the files just delete 
/usr/share/weewx/weeimport/wuimport.py and 
/usr/share/weewx/weeimport/weeimport.py and move the renamed originals back 
in place:

$ mv /usr/share/weewx/weeimport/wuimport_orig.py 
/usr/share/weewx/weeimport/wuimport.py
$ mv /usr/share/weewx/weeimport/weeimport_orig.py 
/usr/share/weewx/weeimport/weeimport.py

Gary
On Monday, 30 October 2023 at 17:59:08 UTC+10 [email protected] wrote:

> Last night I tried to import data from wunderground and I got this error. 
> I read here that wunderground has changed something in its API. I wonder if 
> I can do what Sylvain did, but I have installed v.4.10.2
> Here's the error:
>
> :~ $ sudo wee_import --import-config=/etc/weewx/import/wu-example.conf 
> --from=2023-10-10T23:59 --to=2023-10-29T23:59 --verbose --dry-run
> Using WeeWX configuration file /etc/weewx/weewx.conf
> Starting wee_import...
> Observation history for Weather Underground station 'IPAGAL1' will be 
> imported.
> The following options will be used:
>      config=/etc/weewx/weewx.conf, 
> import-config=/etc/weewx/import/wu-example.conf
>      station=IPAGAL1, from=2023-10-10T23:59, to=2023-10-29T23:59
>      apiKey=****************************69c5
>      dry-run=True, calc_missing=False, ignore_invalid_data=True
>      tranche=500, interval=5, wind_direction=[0.0, 360.0]
> Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
> Destination table 'archive' unit system is '0x11' (METRICWX).
> Observations timestamped after 2023-10-10 23:59:00 EEST (1696971540) and 
> up to and
> including 2023-10-29 23:59:00 EET (1698616740) 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 "/usr/share/weewx/wee_import", line 900, in <module>
>     main()
>   File "/usr/share/weewx/wee_import", line 830, in main
>     source_obj.run()
>   File "/usr/share/weewx/weeimport/weeimport.py", line 382, in run
>     _raw_data = self.getRawData(period)
>   File "/usr/share/weewx/weeimport/wuimport.py", line 258, in getRawData
>     _raw_data = f.read().decode(char_set)
> TypeError: decode() argument 1 must be str, not None
>
>

-- 
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/abc0cd51-4530-448c-a270-7b0e6a2e3134n%40googlegroups.com.

Reply via email to