Closed bparruck closed 11 months ago
Thanks for the report, I just pushed a change that will deduce the timezone from installation_date
if installation_time_zone
is not available.
Please pull and give it another try.
I'm still getting another error:
Traceback (most recent call last):
File "./tesla_solar_download.py", line 289, in
What's happening is that it is pulling my older Solarcity install which doesn't have the timezone definition. However, because of th failure it is not pulling the second site, which is the Tesla installation. If I manually set the siteid to be Tesla site, it works.
Does it download any data for the older install? I pushed a change to keep going when there's an exception, so I'm curious if it's just some days that are missing data, or if there's a broader issue. Please try with this new version and if no data is downloaded I'll add some more debug logging so figure out how the data is different for the older install.
Thanks for your help in debugging this!
Yes, it was downloading but bailing out on the error. It should work, unfortunately it has a different problem: File "./tesla_solar_download.py", line 51 return f'download/{site_id}/energy/{str_date}{suffix}' ^ SyntaxError: invalid syntax
I should have some time tomorrow to debug it.
return f'download/{site_id}/energy/{str_date}{suffix}' ^ SyntaxError: invalid syntax
This looks like you might be running an older python version, can you try upgrading to 3.8 or later?
Look at this: python --version Python 2.7.14
python3 --version Python 3.7.3
My MacBook Pro uses python3 for newer version and keeps older python 2.7 around. I'll try later with python3.
@zigam It now runs, ignoring them missing data: 2023-06-03.csv Traceback (most recent call last): File "./tesla_solar_download.py", line 234, in _download_power_data _download_power_day(tesla, site_id, timezone, date, partial_day=partial_day) File "/Users/bparruck/code/tesla-solar-download/venv/lib/python3.7/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/Users/bparruck/code/tesla-solar-download/venv/lib/python3.7/site-packages/retry/api.py", line 74, in retry_decorator logger) File "/Users/bparruck/code/tesla-solar-download/venv/lib/python3.7/site-packages/retry/api.py", line 33, in __retry_internal return f() File "./tesla_solar_download.py", line 211, in _download_power_day _write_power_csv(response['time_series'], date, site_id, partial_day=partial_day) File "./tesla_solar_download.py", line 167, in _write_power_csv raise ValueError(f'No timeseries for {date}') ValueError: No timeseries for 2023-06-03 00:00:00-07:00
It would be good if it just showed the warning "No timeseries for 2023-06-03 00:00:00-07:00" instead of the entire stack.
Also, perhaps you can clarify the installation documentation.
For installations where python refers to Python 2.7, use the following: python3 -m venv venv source venv/bin/activate pip3 install --upgrade pip pip3 install -r requirements.txt python3 ./tesla_solar_download.py --email my_tesla_email@gmail.com
Thanks, I updated the readme. Virtualenv usually updates the python path to make sure python3 is used, but it doesn't harm to be explicit.
I get this error while running Downloading energy data for solar site ***9431 to download/energy/ Traceback (most recent call last): File "./tesla_solar_download.py", line 274, in
main()
File "./tesla_solar_download.py", line 263, in main
_download_energy_data(tesla, site_id, debug=args.debug)
File "./tesla_solar_download.py", line 93, in _download_energy_data
timezone = site_config['installation_time_zone']
KeyError: 'installation_time_zone'