Restore weewx Database from Ecowitt.net

260 views
Skip to first unread message

Tim Tuck

unread,
Nov 1, 2023, 12:23:33 AM11/1/23
to weewx-user
Hi all,

For the life of me I cannot get this to work :(

https://github.com/comes/ecowitt2weewx#restore-weewx-database-from-ecowittnet

I've poked around and paths are just not where they are expected to be i.e.

__DIR__.'/vendor/autoload.php' which I think expands to {current
directory}/vendor/autoload.php

when it is actually in  ~/.config/composer/vendor/autoload.php

I'm not a coder so just getting here has caused me grief. I shouldn't
have to install anything beyond php to run a script let-alone composer
and Laravel ( wtf? why all this just for a script!! )

It would be really nice if this was just a standalone script that didn't
require anything more than php

Some nice straight forward instructions about how to get it to run would
be greatly appreciated.

or.... some other method to retrieve my records from the Ecowitt DB in a
sensible fashion for import.

Any help appreciated.

thanks

Tim





vince

unread,
Nov 1, 2023, 1:04:59 AM11/1/23
to weewx-user
Perhaps you might open a github issue at the repo you mentioned..,,

Tim Tuck

unread,
Nov 1, 2023, 2:29:50 AM11/1/23
to weewx...@googlegroups.com
HI Vince,

I might do that.

But I've posted here since this was script originally announced here so
the developer should see this anyway.

Also there are many weewx user who have Ecowitt kit and repopulating the
db from the Ecowitt server is something that others may have done, hence
my question :)

regards

Tim

Marlon

unread,
Nov 1, 2023, 2:53:01 AM11/1/23
to weewx-user
Hi Tim
I recently pushed a PR to that repo, which isn't merged yet which got things working for me.
With this, I managed to extract my ecowitt data and then used wee_import to bring it into weewx.
https://github.com/notnullxyz/ecowitt2weewx - a fork from @comes with my fixes and his latest changes from yesterday
I hope that this will help you. It's for me really, but if anyone else find it useful, that's cool.

Rainer Lang

unread,
Nov 1, 2023, 3:44:47 AM11/1/23
to weewx...@googlegroups.com

the download from the Ecowitt cloud is not fully based on their public http-API - it rather offers a "canon ball" solution as the author says

for details about the API see https://doc.ecowitt.net/ 
if you want to develop your own thing or create a more specific solution using the accounts APP and API keys (to be created in the account)

the link provided by @Marlon seems to be a working solution, however it has some caveats you might want to consider
(like other things you might do)

- it downloads data from all devices connected to your user account (if you have only once console, then there's no issue here)
=> if you have more devices, you will get several CSV files with the device-ID (=MAC address I guess, that's what the device ID is on ecowitt.net) as file name

- you have to consider the resolution and retention times at ecowitt.net
=> you may have to run the script let's say every two months to have a 5 minute resolution of the data on ecowitt.net as CSV as potential backup
see https://www.wxforum.net/index.php?topic=40730.0 chapter 14

- the download will not be complete if you have extra sensors beyond the basic sensors - its "field map" would need to be extended, especially for a WS90 outdoor array and its "piezo data" if you have one and for the battery values (depends on what you store in your weewx database


A more specific method would be using the APP and API keys together with the device ID and providing a starting and ending time stamp (down to a 5 minute slice) - e.g. a (still to be created) weewx extension with an automatic refill from ecowitt.net at restart when needed (i.e. when there was a - wanted or unwanted- interruption of the data logging bigger than the weewx archiving intervall) as already implemented ever since the API was published in the CumulusMX software.

Benedict

unread,
Jun 1, 2025, 4:07:49 PM6/1/25
to weewx-user
How did you config the import for the csv? I have a wittboy and a lot of extra sensors, like leaf wetness, soil moisture (2x) and extra temperature sensors, and would like to have them imported too, but the descriptions in that weewx_import.conf are (again) not very descriptive, and without (current-day) examples.
Could you provide your conf that you've used, so I can base mine on that?
Thanks in advance!

Regards,

Ben

Rainer Lang

unread,
Jun 2, 2025, 1:48:24 AM6/2/25
to weewx-user

Hi Benedict
you need two files 

1. the very file to import which contains the data with a headline giving a name to each field (between two separators, delimiters, in the example a ";") and having the same sequence below where the data are
2. the .conf file where the weewx import program is told which fields to import into which fields of your database

the ecowitt2weewx example is very primitive and only handles the basic weather observations, no extra sensors

my attached examples contains also extra sensors, not existing or used ones being commented out (with a leading "#")
what is missing for you you can add yourself - the weewx database names to be used (left side of the assignments) you find in
the database schema - location (in my case): /usr/share/weewx/schemas and there it is the wview_extended.py file
your location may be different depending on your weewx version and installation method

I attach two examples of a .conf file and a data file which should make the story clear

you will have to use of course your own data file and modified conf file - and e.g. the path to your data file in the .conf file has to be adapted to your situation 🙂
make sure that the date-time format from your to-be-imported data file is properly described in your .conf file header section

you can do this all manually for a test
download the xlsx file from your account at ecowitt.net (Export button), load it into Excel, save it again as a csv text file

good luck

--
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/3bb24aa9-e4cf-4bc4-ab8f-f530c788c49dn%40googlegroups.com.
all-sensors-import.conf
weewx-import-MB-20220131-1425-1725.txt
Message has been deleted

Benedict

unread,
Jun 3, 2025, 9:50:49 AM6/3/25
to weewx-user
Wow, this is exactly what I hoped for. Thanks! I will manage from here. I had already successfully exported from ecowitt cloud/api, which by the way is a lot better than netatmo with old weather-data on their servers (in case people are deciding between the two..).
Reply all
Reply to author
Forward
0 new messages