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

Ambient Weather Station Integration - Retrying Setup #94205

Closed
shawnhaywood opened this issue Jun 8, 2023 · 139 comments
Closed

Ambient Weather Station Integration - Retrying Setup #94205

shawnhaywood opened this issue Jun 8, 2023 · 139 comments

Comments

@shawnhaywood
Copy link

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
Copy link

home-assistant bot commented Jun 8, 2023

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
Copy link
Contributor

bachya commented Jun 8, 2023

Will need to see logs.

@shawnhaywood
Copy link
Author

image

@codydaig
Copy link

codydaig commented Jun 8, 2023

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

@maddox
Copy link
Contributor

maddox commented Jun 8, 2023

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
Copy link
Contributor

bachya commented Jun 8, 2023

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
Copy link
Author

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

@alexmarsaudon
Copy link

alexmarsaudon commented Jun 8, 2023

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
Copy link
Author

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

@alexmarsaudon
Copy link

Seems to reenforce the theory that subsets of users sporadically lose API access
#94205 (comment)
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
Copy link

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
Copy link
Author

shawnhaywood commented Jun 8, 2023

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

@sassa4ras
Copy link

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
Copy link

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
Copy link
Contributor

maddox commented Jun 8, 2023

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
Copy link

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
Copy link

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
Copy link

wpnelson commented Jun 8, 2023

Same issue here. definitely something new in this version.

@david-kelleher
Copy link

Same problem here. Definitely the new version for me

@decompil3d
Copy link
Contributor

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
Copy link

SnoFox commented Jun 8, 2023

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
Copy link

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
Copy link

losip commented Jun 8, 2023

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
Copy link

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

@balucanb
Copy link

balucanb commented Jun 8, 2023

Ditto. same issue after updating to 2023.6

@jdhgmann04
Copy link

jdhgmann04 commented Jun 8, 2023

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
Copy link

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

@terryhonn
Copy link

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.

@DarkWolf7
Copy link

DarkWolf7 commented Jun 9, 2023

@bdraco I'm seeing the same issue. rt2.ambientweather.net won't allow WebSocket connections (which is the hostname aioambient uses), however rt.ambientweather.net seems to connect fine.

I changed line 18 in /usr/local/lib/python3.11/site-packages/aioambient/websocket.py from:

WEBSOCKET_API_BASE = "https://rt2.ambientweather.net"

to

WEBSOCKET_API_BASE = "https://rt.ambientweather.net"

And restarted HA and all seems to be fine again. For now... :)

This worked for me as well. Looks like that's the REST endpoint, not the realtime one:

Websockets

The realtime API uses Websockets and is based on Socket.io (https://socket.io/). The easiest way to use the API is to use a Socket.io helper library. They are available in most languages.

Socket.io Endpoint: https://rt2.ambientweather.net/?api=1&applicationKey=....

  • The realtime subdomain is different than the REST subdomain (realtime = rt2, REST = rt).

(emphasis mine). Not sure if that would cause delays in getting accurate values... but then again data > null, lol.

@davel4wa
Copy link

davel4wa commented Jun 9, 2023

Morning of 8-Jun-2023, Ambient Weather was returning all sensors as 'unavailable.' The AW integration showing 'Retrying setup:connection error.' During the rest of the day the integration would intermittently be connected or not connected. Apparently, overnight into 9-Jun, it was not connected as scripts dependent on AW sensir data were failing. Currently 9-Jun, 6:45 AM PST it is disconnected.
Will this be corrected or is installing the 'local' integration going to be the only solution?

@KruseLuds
Copy link

KruseLuds commented Jun 9, 2023

@bdraco I'm seeing the same issue. rt2.ambientweather.net won't allow WebSocket connections (which is the hostname aioambient uses), however rt.ambientweather.net seems to connect fine.

I changed line 18 in /usr/local/lib/python3.11/site-packages/aioambient/websocket.py from:

WEBSOCKET_API_BASE = "https://rt2.ambientweather.net"

to

WEBSOCKET_API_BASE = "https://rt.ambientweather.net"

And restarted HA and all seems to be fine again. For now... :)

Hey I am running HA Supervised on a RPI4 (in docker on debian) and was only able to resolve it this way - my main issue was finding the freaking directory (what a PITA!). These docker container directory names are crazy:

pi@kruse-pi:~$ sudo find / -type d -name aioambient -print

Resulted in:

find: '/proc/3064/task/3064/net': Invalid argument
find: '/proc/3064/net': Invalid argument
/var/lib/docker/overlay2/0a9d79944c7f764becfe58ac8796d1d276e2e2b73fdf0e583043d3a3d075bf7c/diff/usr/local/lib/python3.11/site-packages/aioambient
/var/lib/docker/overlay2/b405b4ac6bde887d565b2aff0834a50bf32eec79becc5e0b3880669e31e8c41d/merged/usr/local/lib/python3.11/site-packages/aioambient

So, editing this puppy from "rt2" to rt":

pi@kruse-pi:~$ sudo nano /var/lib/docker/overlay2/0a9d79944c7f764becfe58ac8796d1d276e2e2b73fdf0e583043d3a3d075bf7c/diff/usr/local/lib/python3.11/site-packages/aioambient/websocket.py

And then trying this one, it was already changed so it must just have been a symbolic link:

pi@kruse-pi:~$ sudo nano /var/lib/docker/overlay2/b405b4ac6bde887d565b2aff0834a50bf32eec79becc5e0b3880669e31e8c41d/merged/usr/local/lib/python3.11/site-packages/aioambient/websocket.py

I believe my weird combination of pretty good aptitude for this stuff combined with being a noob in linux/python (much easier than C++ !!) makes for odd forum entries, but maybe this would help someone :-)

@jdhgmann04
Copy link

I think where this is leading is the 2902 series at least has an ESP device in it with a Lora radio. There should be a project started to reflash the hardware to use an mqtt broker whether local or remote and be able to use a secure port or unsecure for local vs remote broker. Maybe this already exists?

@losip
Copy link

losip commented Jun 9, 2023

Mine's just started working again. No intervention

@dellock6
Copy link

dellock6 commented Jun 9, 2023

Same here, I just checked after I saw your post.
So, all good until the next outage, as I have a ws1550 that doesn't support the custom server.

@moutansos
Copy link

Mine just started working as I was reading this thread

@ziptbm
Copy link

ziptbm commented Jun 9, 2023

Mine just started working as I was reading this thread

Same here.

@alexmarsaudon
Copy link

Same here, broken over 48 hours, changed nothing on my end, randomly started working 10m ago

@Codelica
Copy link

Codelica commented Jun 9, 2023

It's odd all around. The official API docs claim rt is for REST API and rt2 is for "realtime" API (aka Websocket/Socket.io), yet rt seems to handle WebSocket connections fine and rt2 had issues for 2 days(?). Seems like rt may be a good fallback regardless of the docs. ;)

@KruseLuds
Copy link

KruseLuds commented Jun 9, 2023

Yes I just changed the "rt" back top "rt2" and restarted HA, I stll have the regular ping-pong heartbeat in the syslogs so it is fixed on their end:

Jun  9 12:53:17 kruse-pi homeassistant[597]: #033[32m2023-06-09 12:53:17.412 INFO (MainThread) [aioambient] Sending packet PING data None#033[0m
Jun  9 12:53:17 kruse-pi homeassistant[597]: #033[32m2023-06-09 12:53:17.493 INFO (MainThread) [aioambient] Received packet PONG data None#033[0m

So what can be done to make this into a configurable variable - or maybe even better yet, have both and configurable with primary/preferred and secondary, and the integration would automatically try if the preferred one doesn't work, use the other one, but still keep trying the primary until it works and then switch back it on the fly?

This is where HA shines, in that to some extent people can actually jump through hoops and program around hardware issues to make the whole thing more resilient! Let's push really hard for the above functionality - no?

@Viss
Copy link

Viss commented Jun 9, 2023

wow so this whole thing was because ambientweathers end had a rapid unplanned disassembly, and it was just timed perfectly with the recent upgrade?

wonderful.mp4

@shawnhaywood
Copy link
Author

Thanks everyone for the input and help! Even though the API is back up, I figured out how to do the local connection with the new integrations for my WS-2000.

@Viss
Copy link

Viss commented Jun 9, 2023 via email

@ziptbm
Copy link

ziptbm commented Jun 9, 2023

If anyone comes up with a way to swap to the local, non cloud version, and have it "just pick up where the cloud one left off" I am TOTALLY ALL EARS. The less cloud with this stuff the better, but I dont want to lose like, 3+ years of data.
On 2023-06-09 13:08, shawnhaywood wrote: Thanks everyone for the input and help! Even though the API is back up, I figured out how to do the local connection with the new integrations for my WS-2000. -- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>
Links: ------ [1] #94205 (comment) [2] https://github.com/notifications/unsubscribe-auth/AANMYXYGIOVGDJMRXBXHN73XKN7E5ANCNFSM6AAAAAAY6U4JBU

Couldn’t you just delete the cloud version, install the local, and then manually rename every entity to what you had previously in the cloud version? You’d have to grab all those entity names first, but I think this would do it despite the super manual process.

@Viss
Copy link

Viss commented Jun 9, 2023 via email

@jduckles
Copy link

jduckles commented Jun 10, 2023

@Viss

If anyone comes up with a way to swap to the local, non cloud version, and have it "just pick up where the cloud one left off" I am TOTALLY ALL EARS.

I named the local version the same as the previous. So if all your sensors were like "sensor.mystation_inside_temp" and "sensor.mystation_temp" then your station name is "mystation" and you put that in as your station name for the local one. Then the names pick up where they left-off and the history is intact.

image

You also want to delete the Ambient Weather Station Integration so you don't have two integrations trying to name entities at the same time.

@Viss
Copy link

Viss commented Jun 10, 2023 via email

@tlskinneriv
Copy link

this sort of .. wrecks ... stuff. for history and everything else. Unless there's a way to like "swap out an old sensor for a new one (i've asked on the forums here: https://community.home-assistant.io/t/is-it-possible-to-have-a-new-sensor-take-over-an-old-sensors-history/579936) then we're boned, and we're gonna hafta completely reconfigure everything that touched the old sensors.

I’m unsure as of how as it’s the same sensors and is working fine for me. I can run history for 90 days back on all sensors. Awnet is just a copy of the main integration. Ambient weather uses a prefix for each station, your name. Meaning the entity names are constant as long as you keep the same prefix by adding it in. Maybe it’s a fluke in the way this integration broke but worked so I’ll take it.

In my case it didnt do that. It created a whole second integration, and just added _2 after everything so now i have copies.

image

I wonder if this is happening because the friendly names are different even though the entity IDs are the same. I personally can't confirm/deny that this is the case with the migration from the cloud-based integration since I haven't set my station up with AmbientWeather.net. You could try renaming one of the old entities with a matching friendly name before trying the migration and see if that works.

@ehbush
Copy link

ehbush commented Jun 12, 2023

For what it's worth, my Ambient Weather integration began working again around 8:30 AM on June 9th. I made no changes, and didn't do any of the recommended workarounds/actions in this thread.

image

@gavilaso
Copy link

Quick question…. I moved to the local integration… but now I’m noticing that my last time rain sensor is showing unknown… it register the rain live but it’s not keeping the data of when was the last time it rained… any suggestions??

@tlskinneriv
Copy link

Quick question…. I moved to the local integration… but now I’m noticing that my last time rain sensor is showing unknown… it register the rain live but it’s not keeping the data of when was the last time it rained… any suggestions??

There was a regression in the code for the calculated sensors in the local integration. The fix is in version 1.1.2 released yesterday. See this issue tlskinneriv/awnet_local#28 for details.

@shawnhaywood
Copy link
Author

Sorry for the dumb question - normally HA indicates there is an upgrade available to an integration. How do I upgrade mine to 1.1.2?

@tlskinneriv
Copy link

Sorry for the dumb question - normally HA indicates there is an upgrade available to an integration. How do I upgrade mine to 1.1.2?

The integration is available in HACS, which should show updates available.

@shawnhaywood
Copy link
Author

Thanks so much!

@issue-triage-workflows
Copy link

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.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests