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.57k stars 30.74k forks source link

Ambient Weather Station Integration - Retrying Setup #94205

Closed shawnhaywood closed 1 year ago

shawnhaywood commented 1 year ago

The problem

Performed the new update today, v. 2023.6.0. Now my Ambient Weather integration fails to load entities. On the integrations page, there is a message saying retrying setup. I tried to "reload". Any suggestion to fix?

image

What version of Home Assistant Core has the issue?

2023.6.0

What was the last working version of Home Assistant Core?

Previous

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Ambient weather station

Link to integration documentation on our website

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

Diagnostics information

No response

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 1 year ago

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

Code owner commands Code owners of `ambient_station` 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 ambient_station` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


ambient_station documentation ambient_station source (message by IssueLinks)

bachya commented 1 year ago

Will need to see logs.

shawnhaywood commented 1 year ago
image
codydaig commented 1 year ago

Same issue. However mine started before the upgrade on 2023.5.4. Continued after the upgrade.

maddox commented 1 year ago

Mine's doing this too. It was failing under 2023.4.x with another error message, so I updated to latest and it's reporting the same thing as OP.

bachya commented 1 year ago

I just updated and am not seeing any issue. We've seen moments in the past where their cloud API sporadically fails for a subset of users—it always seems to come back.

shawnhaywood commented 1 year ago

Hoping so, this is an integration I really use :)

alexmarsaudon commented 1 year ago

Came here to +1 this - seems to be the same exact issue following the jump to 2023.6.0 image home-assistant_ambient_station_2023-06-08T03-37-50.882Z.log

shawnhaywood commented 1 year ago

Interestingly, I restored last night's backup, but I'm still getting the same errors. Maybe a coincidence?

alexmarsaudon commented 1 year ago

Seems to reenforce the theory that subsets of users sporadically lose API access https://github.com/home-assistant/core/issues/94205#issuecomment-1581823201 Gonna try waiting this one out before I do anything drastic in my troubleshooting flail. I'll report back if it kicks into gear on its own!

whereizben commented 1 year ago

Mine's doing this too. It was failing under 2023.4.x with another error message, so I updated to latest and it's reporting the same thing as OP.

I’m having the same behavior; tried generating new API and application keys, which did not help.

shawnhaywood commented 1 year ago

i tried a new API/Application key also, but no luck.

sassa4ras commented 1 year ago

I will add that this happened for me as soon as I updated to 2023.6.0

May be an API error, but based on this thread it seems kind of suspicious.

whereizben commented 1 year ago

I will add that this happened for me as soon as I updated to 2023.6.0

May be an API error, but based on this thread it seems kind of suspicious.

I definitely noticed this problem pre-update to 2023.6.0, so for me at least it is unrelated to the update - in fact, I was hoping the update might fix it, but it remained unchanged.

maddox commented 1 year ago

I definitely noticed this problem pre-update to 2023.6.0, so for me at least it is unrelated to the update - in fact, I was hoping the update might fix it,

Same, I updated to hope it would get resolved, but instead just had a new error presentation 💅 🎉

gypsydangr commented 1 year ago

I am also having the same issue, all entities unavailable on 2023.5.4 I just updated to 2023.6.0 and nothing changed. I have 11 automations that rely on this so hopefully it resolves itself.

sassa4ras commented 1 year ago

If this is an issue on their end, is there any remedy other than waiting?

If not, does anyone know if a way to access this data locally and bypass the cloud component?

wpnelson commented 1 year ago

Same issue here. definitely something new in this version.

david-kelleher commented 1 year ago

Same problem here. Definitely the new version for me

decompil3d commented 1 year ago

I'm running 2023.5.4 and have the same issue. This is unlikely to be a problem in HA core. Most likely something wrong on the Ambient Weather API side.

SnoFox commented 1 year ago

Hi there, newish to HASS. I'm also having issues. This looks like it might be an API issue of sorts to me - nicely timed with the upgrade. I also upgraded today, but the integration was "working," with all sensors unavailable. As a first troubleshooting step, I enabled debug logging and tried to Reload the integration from /config/integrations/integration/ambient_station and got the following debug log:

Source: helpers/entity_component.py:194
First occurred: 10:41:56 PM (2 occurrences)
Last logged: 10:41:56 PM

Error unloading entry Home for binary_sensor
Error unloading entry Home for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 543, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 175, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Afterwards I downloaded the diagnostic data, which gave me this:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.6.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.3",
    "docker": true,
    "arch": "aarch64",
    "timezone": "America/Los_Angeles",
    "os_name": "Linux",
    "os_version": "6.1.21-v8",
    "supervisor": "2023.06.1",
    "host_os": "Home Assistant OS 10.2",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "opower": {
      "version": "0.0.7",
      "requirements": [
        "opower==0.0.8"
      ]
    },
    "huesyncbox": {
      "version": "1.23.0",
      "requirements": [
        "aiohuesyncbox==0.0.21"
      ]
    }
  },
  "integration_manifest": {
    "domain": "ambient_station",
    "name": "Ambient Weather Station",
    "codeowners": [
      "@bachya"
    ],
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/ambient_station",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "loggers": [
      "aioambient"
    ],
    "requirements": [
      "aioambient==2023.04.0"
    ],
    "is_built_in": true
  },
  "data": {
    "entry": {
      "entry_id": "d169d16f6487b4c64e0cdc1b10a7d142",
      "version": 2,
      "domain": "ambient_station",
      "title": "**REDACTED**",
      "data": {
        "api_key": "**REDACTED**",
        "app_key": "**REDACTED**"
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "**REDACTED**",
      "disabled_by": null
    },
    "stations": {}
  }
}

I then restarted the OS and saw Ambient Weather is stuck in a "Retrying Setup" loop with the following logs:

Logger: homeassistant.config_entries
Source: config_entries.py:429
First occurred: 10:48:07 PM (2 occurrences)
Last logged: 10:48:08 PM

Config entry 'Home' for ambient_station integration not ready yet: Connection error; Retrying in background
Config entry 'Home' for met integration not ready yet: Update failed: ; Retrying in background
Logger: homeassistant.components.ambient_station
Source: components/ambient_station/__init__.py:78
Integration: Ambient Weather Station (documentation, issues)
First occurred: 10:48:07 PM (6 occurrences)
Last logged: 10:52:01 PM

Config entry failed: Connection error

As it's stuck in a setup loop, I cannot seem to get further info. Also of note, met is also having similar-looking connection error logs.

JohanHardy commented 1 year ago

Currently on HomeAssistant 2023.4.6, same connection issue (reload does not solve the connection problem):

`Logger: homeassistant.components.ambient_station Source: components/ambient_station/init.py:78 Integration: Ambient Weather Station (documentation, issues) First occurred: 10:31:49 (1 occurrences) Last logged: 10:31:49

Config entry failed: Connection error`

losip commented 1 year ago

Definitely sounds like a change in the API. The Ambient Weather App is still working properly. The HA integration stopped working yesterday. I guess we just wait and see?

mikedrews commented 1 year ago

Having the same issue. For me this issue did not exist prior to 2023.6.0

balucanb commented 1 year ago

Ditto. same issue after updating to 2023.6

jdhgmann04 commented 1 year ago

Same issue

Logger: homeassistant.components.ambient_station Source: components/ambient_station/init.py:78 Integration: Ambient Weather Station (documentation, issues) First occurred: 5:45:57 AM (105 occurrences) Last logged: 6:44:21 AM

Config entry failed: Connection error

HA OS Pi 4b 2023.6.0 Core 10.2

Raptor607 commented 1 year ago

FWIW - I also run a Homeseer instance and the plugin for Ambient Weather in that is currently working correctly.

terryhonn commented 1 year ago

Am seeing this issue as well after 2023.6.0 update. Had been running the 2023.6.x betas and there was no problem until the .0 release.

harfordhawk commented 1 year ago

same here but I am still on 2023.5.4 so it seems to be not associated with the update, at least for me.

ottozone02 commented 1 year ago

Same as you here. It worked fine in 2023.5.4, and then stopped working yesterday. I updated the 2023.6.0 and the problem persist.

jameslauser commented 1 year ago

Seems pretty clear this is a problem on Ambient's end, but just to add another datapoint, I upgraded to 2023.6.0 yesterday and my integration was working post upgrade, then stopped working overnight.

whereizben commented 1 year ago

I put in a help request on Ambient Weather’s website, as I agree - it seems likely on their end - so maybe that will get something moving.

RLB7777 commented 1 year ago

I upgraded to 2023.6.0 and then noticed Ambient had stopped. Can't say for certain the upgrade was the problem, but it was definitely ok 24hrs ago.

heyitsyang commented 1 year ago

I'm still on 2023.5.4 and the integration stopped working for me just this morning, it has nothing to do with the 6.0 update.

I was planning to install awnet_local to get off the cloud dependency. I guess this just reinforces my decision.

jebutler commented 1 year ago

Same issue here. My weather station stopped communicating with HA around 2300 UTC yesterday (June 7). I was on 2023.5.4 then, just updated to "6" a few minutes ago hoping it might help. No change.

vassilisv commented 1 year ago

Same for me, issue started yesterday evening, I am on 2023.5.4.

Delron1 commented 1 year ago

Same issue for me as well. Last night around 7:15pm MST

scotte commented 1 year ago

Seeing the same issue for about the last 12 hours here on 2023.3.6 (with no changes to Home Assistant). I noticed that PVOutput, which uses my same Ambient Weather app and API keys doesn't have an issue. Indeed, if I curl https://api.ambientweather.net/v1/devices?applicationKey=12345&apiKey=ABCDE I get a reasonable response:

[{"macAddress":"XX:XX:XX:XX:XX:XX","lastData":{"dateutc":1686236220000,"tempf":64.6,"humidity":31,"windspeedmph":2.46,"windgustmph":5.14,"maxdailygust":16.55,"winddir":112,"winddir_avg10m":138,"uv":4,"solarradiation":451.38,"hourlyrainin":0,"eventrainin":0,"dailyrainin":0,"weeklyrainin":0,"monthlyrainin":0,"yearlyrainin":7.835,"battout":1,"battrain":"1","tempinf":72.5,"humidityin":26,"baromrelin":24.501,"baromabsin":24.501,"battin":1,"temp3f":72.1,"humidity3":23,"batt3":1,"lightning_day":0,"lightning_time":1685936074000,"lightning_distance":16.78,"batt_lightning":0,"feelsLike":64.6,"dewPoint":33.28,"feelsLike3":70.1,"dewPoint3":32.3,"feelsLikein":70.7,"dewPointin":35.7,"lastRain":"2023-05-20T08:14:00.000Z","lightning_hour":0,"tz":"Something","date":"2023-06-08T14:57:00.000Z"},"info":{"name":"Something","coords":{"coords":{"lat":XX.YYYYY,"lon":XX.YYYY},"address":"Something","location":"Something","elevation":1744.994262695312,"geo":{"type":"Point","coordinates":[XX.YYYY,XX.YYYY]}}}}]

Of course Home Assistant may not use the exact same Ambient Weather API URL, but perhaps this helps in finding a solution.

decompil3d commented 1 year ago

The HA Ambient Weather integration uses their websocket api. Based on the behavior we're seeing here, I'd suspect that something has changed or is wrong with login for that api. The issue probably starts when your HA instance needs to login again for a new socket. For many folks, that's when you installed a HA update and restarted. But it eventually happens to everyone.

etymotic commented 1 year ago

I'm still on 2023.5.4 and the integration stopped working for me just this morning, it has nothing to do with the 6.0 update.

I was planning to install awnet_local to get off the cloud dependency. I guess this just reinforces my decision.

@gypsydangr @sassa4ras @heyitsyang

I just did this for the same reason.

Only works with WS-2902A, WS-2902B, WS-2902C, WS-2000 And WS-5000

First you install this https://github.com/tlskinneriv/awnet_local (I did it with HACS) Add the service under Settings->Devices & Services -> Add Integration. All you need is the MAC address of the device. Then you add this repository to the add-on store: https://github.com/tlskinneriv/hassio-addons, and install the resulting add-on.

The add-on gives you instructions on how to configure your device using the awnet app on your phone.

madsci1016 commented 1 year ago

UGH ok so it's not just me. Guess i'm loosing an hour final switching to the local way.

madsci1016 commented 1 year ago

Switched to the local way with some tips here. To add mine. 1) Install Ambient Weather Station in HACS 2) Install addon by going to addons, add, the three little dots, add repo and paste in https://github.com/tlskinneriv/hassio-addons. Refresh addons page and scroll to bottom and you should see "AWNET to HASS". Add it. 3) Open the addon, go to documentation page and follow the lower half instructions to configure your weather station using the "awnet" smartphone app on your smartphone". This will also get you your MAC address you'll need next. 4) Go to the regular (not HACS) integrations page and add an integration "Ambient Weather Local". Put in your MAC address. 5) wait a few minutes. Sensors should show up.

I had to sprinkle in a few HA reboots but otherwise thats the full process. took me about 40 mins of fumbling but got all my sensors back. Was time sensative because i use weather station sensors to run my pool equipment.

Viss commented 1 year ago

I'm having this problem as well. From what I can tell, it appears to be some kind of API call issue. I enabled debug logging for the ambient weather integration, and I saw this:

2023-06-08 10:36:19.181 INFO (MainThread) [aioambient] Attempting WebSocket connection to wss://rt2.ambientweather.net/socket.io/?api=1&applicationKey=xxxxx&transport=websocket&EIO=3
2023-06-08 10:36:19.235 INFO (MainThread) [aioambient] Connection failed, new attempt in 4.76 seconds

so i tried the same in curl:

% curl "https://rt2.ambientweather.net/socket.io/?api=1&applicationKey=xxx&transport=websocket&EIO=3"
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/v52afc6f149f6479b8c77fa569edb01181681764108816" integrity="sha512-jGCTpDpBAYDGNYR5ztKt4BQPGef1P0giN6ZGVUi835kFF88FOmmn8jBQWNgrNd8g/Yu421NdgWhwQoaOPFflDw==" data-cf-beacon='{"rayId":"7d42f2ea3aa77d3b","version":"2023.4.0","b":1,"token":"cf2b52b7548542e690eb1f8dcefe430a","si":100}' crossorigin="anonymous"></script>
</body>
</html>

So either home assistant has changed the api call, and its not landing properly on their end, or ambientweather has changed their api and that has broken everyone trying to use it.

I saw the announcement about doing the local thing, and I've been meaning to do it forever, so I guess this the kick in the pants to get that done. It's a firmware upgrade that opens up a local api, right?

whereizben commented 1 year ago

Has anyone tested this AWNET local integration with an WS-1401-IP? I only see newer models listed, and haven't had a chance to try with mine yet.

On Thu, Jun 8, 2023 at 10:53 AM Viss @.***> wrote:

I'm having this problem as well. From what I can tell, it appears to be some kind of API call issue. I enabled debug logging for the ambient weather integration, and I saw this:

2023-06-08 10:36:19.181 INFO (MainThread) [aioambient] Attempting WebSocket connection to wss:// rt2.ambientweather.net/socket.io/?api=1&applicationKey=xxxxx&transport=websocket&EIO=3 2023-06-08 10:36:19.235 INFO (MainThread) [aioambient] Connection failed, new attempt in 4.76 seconds

so i tried the same in curl:

`% curl " https://rt2.ambientweather.net/socket.io/?api=1&applicationKey=xxx&transport=websocket&EIO=3 "

503 Service Temporarily Unavailable 503 Service Temporarily Unavailable ------------------------------ nginx ` So either home assistant has changed the api call, and its not landing properly on their end, or ambientweather has changed their api and that has broken everyone trying to use it. I saw the announcement about doing the local thing, and I've been meaning to do it forever, so I guess this the kick in the pants to get that done. It's a firmware upgrade that opens up a local api, right? — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you commented.Message ID: ***@***.***>
D34DC3N73R commented 1 year ago

An easy way to test is to download the awnet app and see if you can get the console to connect. If it won't connect then local isn't an option.

etymotic commented 1 year ago

@whereizben I don't think it'll work with the WS-1401-IP. If you can connect to it with the awnet Android app and change settings for a Customized server, that's the only way this method will work.

whereizben commented 1 year ago

@timnunes ok I figured it wouldn't work - I have had the awnet app for a while, and see nothing about customized server. Oh well. I did get an initial reply from ambient weather, so hopefully they can figure something on their end!

On Thu, Jun 8, 2023 at 11:29 AM timnunes @.***> wrote:

@whereizben https://github.com/whereizben I don't think it'll work with the WS-1401-IP. If you can connect to it with the awnet Android app and change settings for a Customized server, that's the only way this method will work.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/94205#issuecomment-1583139385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGDZRZHN4JK6V573BOXVVLXKIKYTANCNFSM6AAAAAAY6U4JBU . You are receiving this because you were mentioned.Message ID: @.***>

rog889 commented 1 year ago

I wonder if Ambient is requiring paid subscription to access their API. I noticed a new Credit Card section above my Ambient API Key section.

losip commented 1 year ago

I thought the subscriptions were just for their cameras but you could be right although it would be unfriendly towards those who have purchased the hardware

MrMcGyver commented 1 year ago

Seeing the same API issue here. Unfortunately, the local option will not work for WS-5000 as the awnet app does not include it for configuration.