Pirate-Weather / pirate-weather-ha

Replacement for the default Dark Sky Home Assistant integration using Pirate Weather
https://pirateweather.net/
Apache License 2.0
369 stars 26 forks source link

Pirate Weather stopped working setup entry fails #290

Closed WvanWaas closed 2 months ago

WvanWaas commented 2 months ago

Describe the bug

Core 2024.8.2 Supervisor 2024.08.0 Operating System 13.0 Frontend 20240809.0

Pirate Weather Version 1.5.6

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: August 16, 2024 at 10:27:15 PM (3 occurrences)
Last logged: 9:40:07 AM

Error setting up entry PirateWeather for pirateweather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pirateweather/__init__.py", line 56, in async_setup_entry
    pw_scan_Int = _get_config_value(entry, CONF_SCAN_INTERVAL)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pirateweather/__init__.py", line 168, in _get_config_value
    return config_entry.options[key]
           ~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'scan_interval'

Expected behavior

Load integration and show weather data

Actual behavior

Screenshot from 2024-08-17 09-43-00

Home Assistant version

2024.8.2

Integration version

1.5.6

Other details

No response

Troubleshooting steps

fenty17 commented 2 months ago

Also having this issue - still on 2024.7 here HAOS on RPi 4. Before updating to the latest PW release I was seeing wildly inaccurate data in the forecast sensors (wind speeds of 1000s mph). Not sure if related.

Ameglialuna commented 2 months ago

Same here

Bloodpack commented 2 months ago

You can try to go to configuration again (do not change anything) an then press OK. This worked for me

I see that you picture shows version 1.5.5 but you did write integration version 1.5.6 , it seems to be a bug i have the same problem i did the update but it shows version 1.5.5 and i can´t update to version 1.5.6

fenty17 commented 2 months ago

Good spot. Mine said 1.5.5 too. If you edit manifest.json in the custom_components folder and change the version to 1.5.6, then reload the integration, it starts ok.

However, I’m still getting wild forecast data that’s orders of magnitude out. E.g

Screenshot 2024-08-17 at 12 05 47

Of course this may be a completely separate issue. Any of you in this thread seeing this issue too?

Ameglialuna commented 2 months ago

You can try to go to configuration again (do not change anything) an then press OK. This worked for me

Thanks Bloodpack it worked for me too!

Bloodpack commented 2 months ago

@fenty17

Good spot. Mine said 1.5.5 too. If you edit manifest.json in the custom_components folder and change the version to 1.5.6, then reload the integration, it starts ok.

i have opened a new issue #291

kwithus commented 2 months ago

@fenty17

Good spot. Mine said 1.5.5 too. If you edit manifest.json in the custom_components folder and change the version to 1.5.6, then reload the integration, it starts ok.

i have opened a new issue #291

Changing from 1.5.5 to 1.5.6 in json didn’t work out for me, same issue still

cloneofghosts commented 2 months ago

Hi guys sorry about the issues here. In V1.5.5 an option to change the scan_interval was added to the configuration options which if you were running the integration before then it didn't exist which is why the error occurs. As stated above if you edit the configuration and click OK it will add in the scan_interval KeyValue and everything works as normal.

I've added a notice to the latest release the steps on how to fix the issue and will look to see if there's a way to fix this issue after updating.

EDIT: I realized I probably should have included a notice about this in the release notes so sorry about not including that.

kwithus commented 2 months ago

doing a slight edit to the config did the trick. Thanks for taking care and generally thanks for all the work the contributors do, without you my (our) HomeAssistant would not work as it should.

coldburn89 commented 2 months ago

doing a slight edit to the config did the trick. Thanks for taking care and generally thanks for all the work the contributors do, without you my (our) HomeAssistant would not work as it should.

How did you fix it?

cloneofghosts commented 2 months ago

doing a slight edit to the config did the trick. Thanks for taking care and generally thanks for all the work the contributors do, without you my (our) HomeAssistant would not work as it should.

How did you fix it?

Open the integration configuration options and then click OK. You don't need to make any changes to the configuration to fix the issue.

kwithus commented 2 months ago

doing a slight edit to the config did the trick. Thanks for taking care and generally thanks for all the work the contributors do, without you my (our) HomeAssistant would not work as it should.

How did you fix it?

Open the integration configuration options and then click OK. You don't need to make any changes to the configuration to fix the issue.

Actually for me it didn’t work without doing an actual change (just open and click ok), So I changed the Scan Intervall by 5sec and click then ok, then it was ok

cloneofghosts commented 2 months ago

If anyone here is running into the scan_interval KeyError issue could they try the v1.5.7 beta that I just released? I think I fixed the issue but am unable to test as I've already fixed the error on my devcontainer and my HA setup.

WvanWaas commented 2 months ago

Also having this issue - still on 2024.7 here HAOS on RPi 4. Before updating to the latest PW release I was seeing wildly inaccurate data in the forecast sensors (wind speeds of 1000s mph). Not sure if related.

I have had a day with 500C around 12:00AM indeed for a few seconds. Later the integration killed itself.

X8Haz commented 2 months ago

If anyone here is running into the scan_interval KeyError issue could they try the v1.5.7 beta that I just released? I think I fixed the issue but am unable to test as I've already fixed the error on my devcontainer and my HA setup.

I did update to v1.5.7 beta, and it worked fine.

cloneofghosts commented 2 months ago

I was able to get a HA install up and running and was able to test upgrading to the v1.5.7 beta and can confirm that this issue is fixed. I've released the stable version which should fix the KeyError issues people have been seeing.

WvanWaas commented 2 months ago

Thanks for fixing it. Still very happy with the integration and hickups can happen!