ha-solcast-solar: Pre Release 4.1.4 fails to load with Exception

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: Update to 4.1.4 and restart HA. The integration throws an exception.

Expected behavior The integration should start.

Screenshots N/A

Logs

Exception in load_saved_data(): Tracebak (most recent call last):
File "/config/custom_components/solcast_solar/solcastapi.py". line 559. in load_saved_data
  for a, _api_key in ks:
  
  ValueError: too many values to unpack (expected 2)

Solcast Integration Version

  • 4.1.4

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (8 by maintainers)

Most upvoted comments

FYI @sh00t2kill, I was able to repro your original error by changing my resource_id - the GUID-like ID assigned by Solcast when you create a PV system on their website.

Changing (or adding) a PV system caused 4.1.4 to choke a little.

I also lost forecast history before 27 August.

I’ve just tested the fix and it works, so you found a bug and we’ve fixed it - so thanks!

FWIW I dont really care about restoring history either – i did it because I can not because i really felt the need. I was curious that its just stored in that json file more than anything else.

Thanks. I restored some. That was easier than expected, so I went back and restored the data from when i lost it first time around too!

Some potentially useful info re that: “version”: “v4.0.22”: this has all my historical data “version”: “4.0.26”: this seemed to have reset some data again. However, i cant be certain that wasnt when i patched the json data change in manually to test it originally, so it could be related to that.

Im pretty sure the data went missing somewhere in between 4.0.22 and 4.0.26, so it may have happened before .31.

I will see if i can make that haystack smaller as now I am curious.

It should be:

559:                                for a, _api_key in ks.items():

Code on line 614 is still for a, _api_key in ks: https://github.com/BJReplay/ha-solcast-solar/blob/Fix-usage-cache-timestamp/custom_components/solcast_solar/solcastapi.py#L614

Is that why I was able to repro by adding a new site?

Not that I recall. It’s possible I logged in and made changes when the old integration stopped working, but I dont remember doing anything.

I thought it might be some weird migration thing too.

Will try and replicate it.