core icon indicating copy to clipboard operation
core copied to clipboard

Weatherflow Cloud KeyError: 'feels_like'

Open chasut opened this issue 1 year ago • 14 comments

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

chasut avatar Sep 14 '24 15:09 chasut

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)

home-assistant[bot] avatar Sep 14 '24 15:09 home-assistant[bot]

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

jeeftor avatar Sep 14 '24 15:09 jeeftor

Just confirming that I am seeing the same errors

ckuykendall81 avatar Sep 14 '24 15:09 ckuykendall81

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_arg_param(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 decode_generic(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'

chasut avatar Sep 14 '24 15:09 chasut

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 avatar Sep 14 '24 15:09 jeeftor

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 avatar Sep 14 '24 16:09 jeeftor

Issue Status:

  • [x] - Update backing lib (https://github.com/jeeftor/weatherflow4py/commit/88313b60406766d7cc6688837958a1545b58ce4f)
  • [X] - Home Assistant Pull Request Submitted: https://github.com/home-assistant/core/pull/125966

Turns out uv was also missing..

jeeftor avatar Sep 14 '24 16:09 jeeftor

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.

chasut avatar Sep 14 '24 17:09 chasut

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

jeeftor avatar Sep 14 '24 18:09 jeeftor

Looks to be down again

ckuykendall81 avatar Sep 14 '24 21:09 ckuykendall81

Down agin for me today

cbandy7777 avatar Sep 15 '24 18:09 cbandy7777

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

HarlemSquirrel avatar Sep 15 '24 19:09 HarlemSquirrel

image

Thanks intermittent bug :)

jeeftor avatar Sep 16 '24 02:09 jeeftor

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

HarlemSquirrel avatar Sep 16 '24 13:09 HarlemSquirrel

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

IceBotYT avatar Sep 27 '24 13:09 IceBotYT

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

jeeftor avatar Sep 27 '24 13:09 jeeftor

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

IceBotYT avatar Sep 27 '24 13:09 IceBotYT

@home-assistant close

jeeftor avatar Sep 27 '24 19:09 jeeftor

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.