home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.78k stars 30.88k forks source link

Improvement to AccuWeather Integration #40183

Closed ejalal closed 4 years ago

ejalal commented 4 years ago

The problem

Accuweather integration returns an error message on all Accuweather sensors saying unavailable something when the max requests per day is reached, which could be improved.

Could be nicer to just ignore that error message and keep displaying whatever weather info was previously there until the next successful update.

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Source: helpers/update_coordinator.py:165
Integration: AccuWeather (documentation, issues)
First occurred: 3:06:19 PM (1 occurrences)
Last logged: 3:06:19 PM

Error fetching accuweather data: The allowed number of requests has been exceeded

Additional information

bverkron commented 4 years ago

This is a philosophical thing that could apply to any sensor. I have desired the same thing for other weather services or even temperature sensors, etc. But the risk is that you would get false data and believe it's correct unless there is a way in the UI to indicate that the data is stale. A config option for sensors in general to keep the last value when an error occurs might be handy assuming there was another attribute or something added to the sensor to indicate the age of the data or whether there was an error during the last update, etc.

bieniu commented 4 years ago

I don't agree with you. If the integration cannot get up-to-date data, the entities should be unavailable. This is a limitation of free access to the AccuWeather API, and we can't do anything about it. If you restart your HA less frequently, the problem will not occur.

ejalal commented 4 years ago

I believe this already provided by the last-changed attribute, for automations relying on weather data or any other sensor, one could add verification in automations on the last-changed attribute and figure out what to do with it. I mean you know the AccuWeather data should be updated every 32 or 64 minutes, if the current data is older than that then you have the choice to rely on it or not.

It's just weather data not some sort of nuclear reactor temperature :D

bieniu commented 4 years ago

Do you really believe that an inexperienced user will check when the entity's state was last updated to conclude if the weather data is up-to-date or not?

frenck commented 4 years ago

Thank you for reaching out. We use GitHub for tracking issues, not for providing support or tracking feature requests.

The current state is correct as per general implementation design @ Home Assistant. If integration has an error communicating, the entities affected need to be put into unavailable.

If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍

ejalal commented 4 years ago

Thanks @frenck for taking the time to respond to my silly request.

frenck commented 4 years ago

There are no silly questions @ejalal