Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airvisual: api_key_expired is back #38262

Closed
Mariusthvdb opened this issue Jul 26, 2020 · 7 comments
Closed

Airvisual: api_key_expired is back #38262

Mariusthvdb opened this issue Jul 26, 2020 · 7 comments

Comments

@Mariusthvdb
Copy link
Contributor

The problem

seems this #34787 is back again.

Environment

  • Home Assistant Core release with the issue: 113.1
  • Last working Home Assistant Core release (if known): 110.4 ?
  • Operating environment (OS/Container/Supervised/Core): OS
  • Integration causing this issue: Airvisual
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/airvisual/

Problem-relevant configuration.yaml

none, configured via integration UI

Traceback/Error logs

2020-07-26 23:49:46 ERROR (MainThread) [homeassistant.components.airvisual] Error fetching 5redacted, 4.redacted data: Error while retrieving data: api_key_expired

Additional information

@bachya
Copy link
Contributor

bachya commented Jul 26, 2020

I've been running two AirVisual locations from the same API key for months without issue. Have you been restarting your HASS more frequently lately?

@Mariusthvdb
Copy link
Contributor Author

Well, maybe. Did have to update things here and there. Though, only 1 instance, so wouldn't know if I hit a threshold

@probot-home-assistant
Copy link

airvisual documentation
airvisual source
(message by IssueLinks)

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jul 27, 2020

Waiting for the next day didn't help...

resulting in this every 5 minutes:

2020-07-27 11:52:30 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 114, in _handle_refresh_interval
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 180, in async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/components/airvisual/__init__.py", line 394, in update
    self.update_from_latest_data()
  File "/usr/src/homeassistant/homeassistant/components/airvisual/sensor.py", line 166, in update_from_latest_data
    data = self.coordinator.data["current"]["pollution"]
TypeError: 'NoneType' object is not subscriptable

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jul 27, 2020

believed this to be solved... the key, though still active, truly was expired:
Schermafbeelding 2020-07-27 om 17 04 42

deleted it, and created a new one, and now get

Error while retrieving data: incorrect_api_key

maybe we have to wait a bit?
No, I didnt realize we have to delete the integration completely from the HA instance too..... Did so, restarted and rebuild the integration with the new Key, and it is back.

Would be very nice to be able to edit the key in the options settings of the integration...

so, closing, solved, and hope you will have a look at the option

@bachya
Copy link
Contributor

bachya commented Jul 27, 2020

@Mariusthvdb We do not allow security credentials to be modified via options screens.

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jul 27, 2020

could it be changed to allow an !include (referencing eg the secrets file) during setup? That way we would only have to change the key in the secrets.yaml and not completely delete and reinstall the integration.

seems a bit of a 'fake' security measure, since you do store the gps coordinates, and even show these in the default naming of the integration....

we can of course manually edit the /.storage/core.config_entries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants