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.94k stars 30.99k forks source link

Weatherflow Cloud KeyError: 'feels_like' #125959

Open chasut opened 2 months ago

chasut commented 2 months ago

The problem

Just started this morning. The integration is not returning data, including updated forecast. The integration reports:
Failed setup, will retry: 'feels_like. Similar error in the logs. I am pretty sure it was working until this morning, so it could be issues with the rest response.

What version of Home Assistant Core has the issue?

2024.9.1

What was the last working version of Home Assistant Core?

2024.9.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

WeatherflowCloud

Link to integration documentation on our website

https://www.home-assistant.io/integrations/weatherflow_cloud/

Diagnostics information

HA log snip.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @jeeftor, mind taking a look at this issue as it has been labeled with an integration (weatherflow_cloud) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `weatherflow_cloud` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign weatherflow_cloud` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


weatherflow_cloud documentation weatherflow_cloud source (message by IssueLinks)

jeeftor commented 2 months ago

I think if you turn on debugging, you can see the rest response

ckuykendall81 commented 2 months ago

Just confirming that I am seeing the same errors

chasut commented 2 months ago

I think if you turn on debugging, you can see the rest response

I did turn on debug. Should be in the log snippet I attached. If not, happy to do so again.

edit: Interesting. it looks like the value is fine ->... ,"feels_like":25.0,... but then get -> ... || to || <class 'weatherflow4py.models.rest.forecast.WeatherDataForecastREST'> -- 'feels_like' 2024-09-14 08:49:42.149 ERROR (MainThread) [homeassistant.components.weatherflow_cloud] Unexpected error fetching weatherflow_cloud data Traceback (most recent call last) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/weatherflow_cloud/coordinator.py", line 35, in _async_update_data return await self.weather_api.get_all_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/weatherflow4py/api.py", line 168, in get_all_data weather=await self.async_get_forecast(station_id=station.station_id), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/weatherflow4py/api.py", line 99, in async_get_forecast return await self._make_request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/weatherflow4py/api.py", line 61, in _make_request raise e File "/usr/local/lib/python3.12/site-packages/weatherflow4py/api.py", line 56, in _make_request return response_model.from_json(data) if response_model else None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/api.py", line 63, in from_json return cls.from_dict(kvs, infer_missing=infer_missing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/api.py", line 70, in from_dict return _decode_dataclass(cls, kvs, infer_missing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 229, in _decode_dataclass value = _decode_dataclass(field_type, field_value, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 233, in _decode_dataclass init_kwargs[field.name] = _decode_generic(field_type, ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 315, in _decode_generic xs = _decode_items(_get_type_argparam(type, 0), value, infer_missing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 410, in _decode_items return list(_decode_type(type_args, x, infer_missing) for x in xs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 410, in return list(_decode_type(type_args, x, infer_missing) for x in xs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 247, in _decode_type return _decodegeneric(type, value, infer_missing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 321, in _decode_generic res = _decode_dataclass(origin, value, infer_missing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dataclasses_json/core.py", line 185, in _decode_dataclass field_value = kvs[field.name]


KeyError: 'feels_like'
jeeftor commented 2 months ago

image

I like tempest because they make their APIs available but the list of REQUIRED fields is 100% NOT accurate. The patch will be to make it optional which I dont love.

jeeftor commented 2 months ago

So I just pulled down a result.

image

feels_like exists in current conditions but right now its missing in the forecast data.

{
  "current_conditions": {
    "air_density": 0.94,
    "air_temperature": 21.0,
    "brightness": 77371,
    "conditions": "Clear",
    "delta_t": 8.0,
    "dew_point": 8.0,
    "feels_like": 21.0,
    "icon": "clear-day",
    "is_precip_local_day_rain_check": true,
    "is_precip_local_yesterday_rain_check": true,
    "lightning_strike_count_last_1hr": 0,
    "lightning_strike_count_last_3hr": 0,
    "lightning_strike_last_distance": 30,
    "lightning_strike_last_distance_msg": "28 - 32 km",
    "lightning_strike_last_epoch": 1726094932,
    "precip_accum_local_day": 0,
    "precip_accum_local_yesterday": 0,
    "precip_minutes_local_day": 0,
    "precip_minutes_local_yesterday": 0,
    "pressure_trend": "steady",
    "relative_humidity": 45,
    "sea_level_pressure": 1024.0,
    "solar_radiation": 645,
    "station_pressure": 797.3,
    "time": 1726329646,
    "uv": 6,
    "wet_bulb_globe_temperature": 18.0,
    "wet_bulb_temperature": 13.0,
    "wind_avg": 1.0,
    "wind_direction": 212,
    "wind_direction_cardinal": "SSW",
    "wind_gust": 2.0
  },
  "forecast": {
    "daily": [
      {
        "air_temp_high": 25.1,
        "air_temp_low": 9.5,
        "conditions": "Clear",
        "day_num": 14,
        "day_start_local": 1726293600,
        "icon": "clear-day",
        "month_num": 9,
        "precip_probability": 0,
        "sunrise": 1726317639,
        "sunset": 1726362505
      },
...

  "hourly": [
      {
        "air_temperature": 21.0,
        "conditions": "Clear",
        "icon": "clear-day",
        "local_day": 14,
        "local_hour": 11,
        "precip": 0,
        "precip_icon": "chance-rain",
        "precip_probability": 0,
        "precip_type": "storm",
        "relative_humidity": 22,
        "sea_level_pressure": 1014.0,
        "time": 1726333200,
        "wind_avg": 2.0,
        "wind_direction": 197,
        "wind_direction_cardinal": "SSW",
        "wind_gust": 3.0
      },

I may not be able to fix this until Monday - but - I'm going to say ... that something has clearly diverged from the documentation.

jeeftor commented 2 months ago

Issue Status:

Turns out uv was also missing..

chasut commented 2 months ago

I guess on the upside if they fix there $---, it will magically start working again. ... and it did. Now getting a forecast again. IIRC this has happened in the past. Been using the weatherflow2MQTT for years.

Thanks for jumping on this so fast.

jeeftor commented 2 months ago

Well, that's good now at least I can protect against it next time.

If I was going to start this all over again, I'd have every single field be optional

ckuykendall81 commented 2 months ago

Looks to be down again

cbandy7777 commented 2 months ago

Down agin for me today

HarlemSquirrel commented 2 months ago

Seems to be flappy. Screenshot_20240915-150339_Home_Assistant (1)

jeeftor commented 2 months ago

image

Thanks intermittent bug :)

HarlemSquirrel commented 2 months ago

It's been working OK for me since 11:22 pm ET last night. image

IceBotYT commented 1 month ago

I think this can be closed. It's been working great for the past few days for me

jeeftor commented 1 month ago

Whoever opened it shall have to close it ... or we just ignore it for like 60 days and it will auto close :)

IceBotYT commented 1 month ago

No.. :) You can say "@home-assistant close" if you're the codeowner

jeeftor commented 1 month ago

@home-assistant close