dahlb / ha_hatch

Home Assistant Integration for Hatch Rest Mini
MIT License
89 stars 17 forks source link

AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. #10

Open escapethewormhole opened 1 year ago

escapethewormhole commented 1 year ago

Running X86-64. I have been following this project and noticed the newest update supports this version now.

I successfully login but then the integration shows this error:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/ha_hatch/init.py", line 112, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/init.py", line 88, in setupconnection , mqtt_connection, rest_devices, expiration_time = await get_rest_devices( File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 55, in get_rest_devices mqtt_connection.connect().result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 446, in result return self.get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 391, in get_result raise self._exception awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.

dahlb commented 1 year ago

is it possible you are trying to run this integration on two instances of HA? that seems the most likely cause based on upstream issues that match your logs' error https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues/110

escapethewormhole commented 1 year ago

No, I only have one computer and it’s being ran natively on its own on that hardware by itself. No other computers involved.

I will try power cycling it fully and see what that does

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Brendan Dahl @.> Sent: Saturday, September 24, 2022 5:25:02 PM To: dahlb/ha_hatch @.> Cc: escapethewormhole @.>; Author @.> Subject: Re: [dahlb/ha_hatch] 1.7.0 - Error (Issue #10)

is it possible you are trying to run this integration on two instances of HA? that seems the most likely cause based on upstream issues that match your logs' error aws/aws-iot-device-sdk-cpp-v2#110https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues/110

— Reply to this email directly, view it on GitHubhttps://github.com/dahlb/ha_hatch/issues/10#issuecomment-1257081827, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZRSSIFUMXZ2U6DZII7OYTTV76EU5ANCNFSM6AAAAAAQUYDXHI. You are receiving this because you authored the thread.Message ID: @.***>

tpansino commented 1 year ago

I'm having the same issue, running HA in a Docker container.

I can see the package is definitely installed in the container, I can load it, and it's the latest version. This suggests it might be an issue with Hatch's certificates?

dahlb commented 1 year ago

sorry but it seems unlikely to be caused by hatch's certificates as not everybody is experiencing this issue, maybe your router's firewall is blocking websockets?

qqaatw commented 1 year ago

https://github.com/dahlb/hatch_rest_api/blob/1745d9c97e477ae540f7ec3e21eaedde2c49dc8f/src/hatch_rest_api/util_bootstrap.py#L36-L40

Not sure if this is the cause, but if you're interested in eliminating periodical reconnecting to the MQTT endpoint in order to have the credentials unexpired, you can provide a callable delegation, which does it automatically, to the credential provider instead of feeding static credentials.

https://awslabs.github.io/aws-crt-python/api/auth.html#awscrt.auth.AwsCredentialsProvider.new_delegate

dahlb commented 1 year ago

thanks for the improvement, I'll track it in https://github.com/dahlb/ha_hatch/issues/12 but I don't think it's the cause of this error since the described experience doesn't seem to have worked even for a little while

escapethewormhole commented 1 year ago

Just tried 1.8.0 with the same result.

One question, how does it pick what device? I only have the one but in the app when I login I then have to tell it what hatch I want to control. This integration never does that. Could that be where it is hanging up?

dahlb commented 1 year ago

I expect from your error that it is caused by your internet connection. But this integration doesn't pick it just controls all the devices on your account

escapethewormhole commented 1 year ago

Any idea what one would look at for my internet connection should that be the culprit?

I have gigabit fiber, through a Unifi UDM-Pro. I don't have any of my ISP hardware in between either.

dahlb commented 1 year ago

I don't know much about firewall settings. Though I also use a fiber to UDM pro router, but it doesn't cause me this error. I just don't know another reason your aws connection would be getting unexpectedly discounted.

nderrico1223 commented 1 year ago

@escapethewormhole, were you able to resolve this? I'm having the same issue and @dahlb marked my issue #27 as a duplicate of this one.

tpansino commented 1 year ago

@nderrico1223 - you're the fourth person in this thread who has indicated they're using a Unifi router (I've got a Dream Machine). I feel like that's a pattern here.

@dahlb, since you have a UDM Pro and it's working for you - do you have Threat Management enabled by chance? I do, and I suspect that's what's blocking AWS here, but even when I disable it I don't see any change in the error message. Maybe I'll try that again now that there's more logging.

nderrico1223 commented 1 year ago

@tpansino I do not have Threat Management enabled, for reference.

tpansino commented 1 year ago

Ah, thanks, theory is dead then... 🤔

fcfort commented 1 year ago

I just installed this integration (v1.9.7) via HACS in my Raspberry Pi Home Assistant installation. I also got this error immediately after setting up my credentials in the integration.

I pasted the error messages I saw below.

My Raspberry Pi is only running Home Assistant and is directly wired to my Ubiquiti EdgeRouter X using Verizon FiOS.

First error This error originated from a custom integration. Logger: homeassistant.config_entries Source: custom_components/ha_hatch/__init__.py:111 Integration: Hatch Rest Mini/Plus (documentation, issues) First occurred: 3:21:47 PM (2 occurrences) Last logged: 3:46:51 PM Error setting up entry (REDACTED)@gmail.com for ha_hatch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/[config_entries.py](http://config_entries.py/)", line 372, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/ha_hatch/__init__.py", line 135, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/__init__.py", line 111, in setup_connection _, mqtt_connection, rest_devices, expiration_time = await get_rest_devices( File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/[util_bootstrap.py](http://util_bootstrap.py/)", line 64, in get_rest_devices raise e File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/[util_bootstrap.py](http://util_bootstrap.py/)", line 60, in get_rest_devices mqtt_connection.connect().result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.__get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
Second error This error originated from a custom integration. Logger: hatch_rest_api.util_bootstrap Source: custom_components/ha_hatch/__init__.py:111 Integration: Hatch Rest Mini/Plus (documentation, issues) First occurred: 3:21:47 PM (2 occurrences) Last logged: 3:46:51 PM MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
bblicke1 commented 1 year ago

I believe I may be in a similar boat... I also have a UDM-Pro, threat management is turned on. I initially had some sort of permissions issue but have since set up HA to run as root (temporarily) which solved the permissions issue. Now this is the only remaining issue.

Error 1:

Logger: homeassistant.config_entries Source: .local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py:60 First occurred: 8:23:05 PM (1 occurrences) Last logged: 8:23:05 PM

Error setting up entry xxxxxxxxx@gmail.com for ha_hatch Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/ha_hatch/init.py", line 148, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/init.py", line 120, in setupconnection , mqtt_connection, rest_devices, expiration_time = await get_rest_devices( File "/config/.local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices raise e File "/config/.local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 60, in get_rest_devices mqtt_connection.connect().result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.get_result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in get_result raise self._exception awscrt.exceptions.AwsCrtError: AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE: Failed to upgrade HTTP connection to Websocket.

Error 2: Logger: hatch_rest_api.util_bootstrap Source: .local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py:63 First occurred: 8:23:05 PM (1 occurrences) Last logged: 8:23:05 PM

MQTT connection failed with exception AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE: Failed to upgrade HTTP connection to Websocket.

tallmega commented 1 year ago

Well I'll join the list. USG-3P, threat management off. Same issue.

awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. 2023-01-18 16:40:18.857 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140201106029872] 2023-01-18 18:23:02.423 WARNING (SyncWorker_5) [urllib3.connectionpool] Retrying (Retry(total=5, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f830268d180>, 'Connection to timed out. (connect timeout=3.0)')': /upnp/control/basicevent1 2023-01-18 19:15:56.808 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. 2023-01-18 19:15:56.808 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for ha_hatch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/ha_hatch/init.py", line 148, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/init.py", line 120, in setupconnection , mqtt_connection, rest_devices, expiration_time = await get_rest_devices( File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices raise e File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 60, in get_rest_devices mqtt_connection.connect().result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in get_result raise self._exception

FuzzyMistborn commented 1 year ago

Me too. Had some internet issues this morning and now when I restart HASS i'm getting this error. I also can't seem to connect to the Hatch via the app now, so I'm not sure this is related to the integration? Has anybody found a workaround? Whether it's waiting/time, resetting the hatch, or anything else?

dahlb commented 1 year ago

@FuzzyMistborn I also experienced this for the first time this morning after I unplugged/forced ha to restart from an apparent lockup last night. I am no longer seeing the error, are you still getting it or does it work for you now too?

FuzzyMistborn commented 1 year ago

Thanks! Just reloaded and it's working now. Maybe some kind of outage on Hatch's end then?

dahlb commented 1 year ago

my guess is this is related to https://github.com/dahlb/hatch_rest_api/issues/4 and potentially a missing throttling when network connectivity is compromised or if multiple instances of this integration are configured to use the same hatch account.

hatch likely improved their response after filing the old bug above in cases where throttling causes a connection flood they are at least temporary banning ips to prevent paying the bill on connection storms.

unfortunately I lost all my logs due to my haos restarting, but I will try to experiment with connection retry attempts in a few weeks when I might have time.

FuzzyMistborn commented 1 year ago

That would make sense. I have an automation reload the integration at 6:30am because I ran into a few issues where the integration seemed to lose it's connection/stop working. I was debugging something this morning with an automation involving the sound machine's availability and reloaded the integration 1 more time and then also ended up rebooting HASS for an unrelated reason. Probably hit a limit so it's like a fail2ban type block.

qqaatw commented 1 year ago

I would like to mention my previous reply, which might not be the direct fix but provides a IMO pretty reliable reconnecting mechanism, and the MQTT client id is possibly the cause, where I use a random uuid for each new connection instead of a user-dependent pattern.

FYI, our integration, in which the connected server is also built on AWS iot infra, has stably worked for several months without any connection issue like this (MQTT hung up) on my side. I've been using a Unifi router for two years.

Hope this info helps.

dahlb commented 1 year ago

I found some new documentation that helped me fix a few of the causes for this error, v1.12.4 might fix everybody in this threads issues.

one of the problems that likely affected a number of these users was that hatch uses multiple aws regions and until now the api this project uses was locked to us-west2 and if you are assigned a different region you would've gotten the HANGUP error

another problem was caused by resetting connections with overlapping ids so I've appended a uuid to the connection ids to allow both api ops easy identification while allowing multiple connections per user when needed.

another possible error that I am not sure anybody was experiencing but also could've caused this error was special characters in the username/email so those have been stripped from the client id if they exist.

the really annoying thing I've found in today's research is a lot of, if not all aws iot errors just through this catch all instead of providing better detail ...

escapethewormhole commented 1 year ago

That would make some sense. I am not in western US, I am western Canada and I believe Amazon has a data center near me that I would be assigned to most likely

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Brendan Dahl @.> Sent: Wednesday, January 25, 2023 6:44:28 PM To: dahlb/ha_hatch @.> Cc: escapethewormhole @.>; Mention @.> Subject: Re: [dahlb/ha_hatch] AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. (Issue #10)

I found some new documentation that helped me fix a few of the causes for this error, v1.12.4 might fix everybody in this threads issues.

one of the problems that likely affected a number of these users was that hatch uses multiple aws regions and until now the api this project uses was locked to us-west2 and if you are assigned a different region you would've gotten the HANGUP error

another problem was caused by resetting connections with overlapping ids so I've appended a uuid to the connection ids to allow both api ops easy identification while allowing multiple connections per user when needed.

another possible error that I am not sure anybody was experiencing but also could've caused this error was special characters in the username/email so those have been stripped from the client id if they exist.

the really annoying thing I've found in today's research is a lot of, if not all aws iot errors just through this catch all instead of providing better detail ...

— Reply to this email directly, view it on GitHubhttps://github.com/dahlb/ha_hatch/issues/10#issuecomment-1404459710, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZRSSICL2XVBFXCCDONEV6LWUHJHZANCNFSM6AAAAAAQUYDXHI. You are receiving this because you were mentioned.Message ID: @.***>

tallmega commented 1 year ago

Unfortunately still no joy for me on 1.12.4 - I'm also in Canada.

2023-01-25 22:07:29.238 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. 2023-01-25 21:50:13.588 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry x@gmail.com for ha_hatch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/ha_hatch/init.py", line 148, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/init.py", line 120, in setupconnection , mqtt_connection, rest_devices, expiration_time = await get_rest_devices( File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 67, in get_rest_devices raise e File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 63, in get_rest_devices mqtt_connection.connect().result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in get_result raise self._exception

nderrico1223 commented 1 year ago

I found some new documentation that helped me fix a few of the causes for this error, v1.12.4 might fix everybody in this threads issues.

one of the problems that likely affected a number of these users was that hatch uses multiple aws regions and until now the api this project uses was locked to us-west2 and if you are assigned a different region you would've gotten the HANGUP error

another problem was caused by resetting connections with overlapping ids so I've appended a uuid to the connection ids to allow both api ops easy identification while allowing multiple connections per user when needed.

another possible error that I am not sure anybody was experiencing but also could've caused this error was special characters in the username/email so those have been stripped from the client id if they exist.

the really annoying thing I've found in today's research is a lot of, if not all aws iot errors just through this catch all instead of providing better detail ...

Mine is not working still, same errors.

fcfort commented 1 year ago

Likewise. Just updated to v1.12.4 and got the same error I got in https://github.com/dahlb/ha_hatch/issues/10#issuecomment-1367604323. Full debug dump:

Debug logging
2023-01-25 21:50:19.833 DEBUG (MainThread) [custom_components.ha_hatch] async setup entry: {'email': '***@gmail.com', 'password': '***'}:{}
2023-01-25 21:50:20.702 DEBUG (MainThread) [custom_components.ha_hatch] updating credentials: initial setup
2023-01-25 21:50:20.713 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/public/v1/login requestsending https://data.hatchbaby.com/public/v1/login request with {'email': '***@gmail.com', 'password': '***'}
2023-01-25 21:50:21.150 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:
2023-01-25 21:50:21.152 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Successful login', 'payload': {'id': 420267, 'createDate': '2019-06-10 16:13:03', 'updateDate': '2019-12-25 17:16:20', 'active': True, 'email': '***@gmail.com', [REDACTED] 'appType': 'Android', 'firstName': '***', 'lastName': None, 'signupSource': 'app', 'timezone': 'America/New_York', 'timeZoneAdjust': -5, 'stage': 49}, 'sync': 1674701416018, 'token': 'AAA'}
2023-01-25 21:50:21.152 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/iotDevice/v2/fetch request
2023-01-25 21:50:21.246 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:
2023-01-25 21:50:21.246 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1674701416189}
2023-01-25 21:50:21.248 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/restPlus/token/v1/fetch request
2023-01-25 21:50:21.351 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:
2023-01-25 21:50:21.352 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Got Cognito OpenId token', 'payload': {'endpoint': 'https://aacsjje0gbbcc-ats.iot.us-west-2.amazonaws.com', 'identityId': 'us-west-2:06ae5904-7636-4564-9475-5645dfd8f59b', 'region': 'us-west-2', 'cognitoPoolId': 'us-west-2:5651fc22-f313-49d5-b379-fdab2c535d9c', 'token': 'BBB'}, 'sync': 1674701416282}
2023-01-25 21:50:21.352 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://cognito-identity.us-west-2.amazonaws.com requestheaders: {'content-type': 'application/x-amz-json-1.1', 'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity'}sending https://cognito-identity.us-west-2.amazonaws.com request with {'IdentityId': 'us-west-2:06ae5904-7636-4564-9475-5645dfd8f59b', 'Logins': {'cognito-identity.amazonaws.com': 'BBB'}}
2023-01-25 21:50:21.745 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:
2023-01-25 21:50:21.760 DEBUG (MainThread) [hatch_rest_api.util_http] response raw: {"Credentials":{"AccessKeyId":"CCC","Expiration":1.674705021E9,"SecretKey":"DDD","SessionToken":"EEE"},"IdentityId":"us-west-2:06ae5904-7636-4564-9475-5645dfd8f59b"}
2023-01-25 21:50:22.395 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
2023-01-25 21:50:22.434 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ***@gmail.com for ha_hatch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/ha_hatch/__init__.py", line 148, in async_setup_entry
    await setup_connection("initial setup")
  File "/config/custom_components/ha_hatch/__init__.py", line 120, in setup_connection
    _, mqtt_connection, rest_devices, expiration_time = await get_rest_devices(
  File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 67, in get_rest_devices
    raise e
  File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 63, in get_rest_devices
    mqtt_connection.connect().result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
owenfi commented 1 year ago

I'm hitting this error also. My wife has the app and had to reset her password to figure out what it was, and when she did the device was gone from the app, so I feel like that could be a root cause/related. I feel like previously it might've only been on Bluetooth and not WiFi but I haven't looked into this yet.

My networking gear is Mikrotik, so not Ubiquiti, but perhaps similarly configured.

bblicke1 commented 1 year ago

Looks like my problem was resolved.

I was troubleshooting an issue with the Tuya integration and realized the issue with it was that my time was incorrect as it was 7 minutes slow. I messed around trying to correct it in HA, but later realized that somehow the whole unRAID server was off by 7 minutes.

Long story short, manually setting my time to the correct time fixed the Tuya issue and seems to have resolved my Hatch integration issue as well!

jefflewis commented 1 year ago

Just to add another data point. I have a dream machine (not pro) and see this same error with v1.14.0. I have HA running in a linux VM via the HA OS build.

nathang21 commented 1 year ago

This is also happening to me on my Hatch Rest 1st gen. FWIW I am using an Unify Dream Machine Pro, but i'm not doing anything fancy with the Firewall that should interfere. I'm not having any other issues with addons/integrations and I'm running a lot. Happy to provide more details as requested.

Regarding Websockets, i've never had issues before, and found a quick browser test (https://websocketstest.com/) and everything passed, but perhaps Websockets from this Integration/HA use different ports/configuration than a browser.

Env:

Home Assistant 2023.4.4
Supervisor 2023.04.0
Operating System 9.5
Frontend 20230411.1 - latest
ha_hatch integration Version: v1.15.0

Logs:

Home Assistant Core
2023-04-16 13:11:33.235 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ha_hatch which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-04-16 13:12:06.588 DEBUG (MainThread) [custom_components.ha_hatch] async setup
2023-04-16 13:12:07.562 DEBUG (MainThread) [custom_components.ha_hatch] updating credentials: initial setup
2023-04-16 13:12:07.585 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/public/v1/login requestsending https://data.hatchbaby.com/public/v1/login request with {'email': '***', 'password': '***'}
2023-04-16 13:12:12.363 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sun, 16 Apr 2023 17:12:10 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '618', 'Connection': 'keep-alive', 'X-Hatch-Request-Id': 'gpRACkmb3S')>
2023-04-16 13:12:12.363 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Successful login', 'payload': {'id': 3554716, 'createDate': '2023-02-27 13:31:41', 'updateDate': '2023-02-27 13:31:41', 'active': True, 'email': '***', 'babies': [], 'defaultUnitOfMeasure': 'imperial', 'appType': 'iOS', 'firstName': 'NAMEr', 'lastName': None, 'signupSource': 'rest', 'timezone': 'America/New_York', 'timeZoneAdjust': -4, 'stage': -10000}, 'sync': 1681665123267, 'token': 'MzU1NDcxNjoxODM5MzQ1MTMwMjc2OjIxNGM0MDM5MzY0ODM5NDkyODBhMTkzNjM4ZWEwYWI0'}
2023-04-16 13:12:12.363 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/iotDevice/v2/fetch request
2023-04-16 13:12:12.505 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sun, 16 Apr 2023 17:12:12 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '116', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '1; mode=block', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"080e1cd3bdf63acb33b90f868ab06e19b"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': '9Ix4q59Wqq')>
2023-04-16 13:12:12.505 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1681665127423}
2023-04-16 13:12:12.506 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/restPlus/token/v1/fetch request
2023-04-16 13:12:12.878 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sun, 16 Apr 2023 17:12:12 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '1439', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '1; mode=block', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"08ce8d7cf1382bac820f42ce27dbf436d"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'Rj1FmgYoiT')>
2023-04-16 13:12:12.878 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Got Cognito OpenId token', 'payload': {'endpoint': 'https://aacsjje0gbbcc-ats.iot.us-west-2.amazonaws.com', 'identityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'region': 'us-west-2', 'cognitoPoolId': 'us-west-2:5651fc22-f313-49d5-b379-fdab2c535d9c', 'token': 'eyJraWQiOiJ1cy13ZXN0LTIzIiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTY4MTY2NzIzMiwiaWF0IjoxNjgxNjY1MTMyfQ.I9zHBj_B0-ifv4ic0W3UPZE7RhFce0Xfd8g_kPjGCq1gAV0_gi0KolOBSOszy5B2reXbzrUSjctiCLFjZPs4idxWHpq12Dr0OcmQIFwMSI1Y5WNpkEHqubhRGRY76u39oq__84-ZCCIAVlfVgRsODlNTI2_2gnYuM0mKNd29pYlTaDxL6ATVXksaV4UaKIaEYsOLOxSA913ZwX_DDKbHJoQzDUSJWv427cO-7cHno6Nj0TchcZp8aZTNgC_9BIhSl6s64YMfiZM_Ce87nOEbBaLbT_v-yOhO3pDQYonA1t04AXlQGEoMfcozOM0yvTmlEWkeUH95IDTCWZkeXh76bg'}, 'sync': 1681665127559}
2023-04-16 13:12:12.879 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://cognito-identity.us-west-2.amazonaws.com requestheaders: {'content-type': 'application/x-amz-json-1.1', 'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity'}sending https://cognito-identity.us-west-2.amazonaws.com request with {'IdentityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'Logins': {'cognito-identity.amazonaws.com': 'eyJraWQiOiJ1cy13ZXN0LTIzIiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTY4MTY2NzIzMiwiaWF0IjoxNjgxNjY1MTMyfQ.I9zHBj_B0-ifv4ic0W3UPZE7RhFce0Xfd8g_kPjGCq1gAV0_gi0KolOBSOszy5B2reXbzrUSjctiCLFjZPs4idxWHpq12Dr0OcmQIFwMSI1Y5WNpkEHqubhRGRY76u39oq__84-ZCCIAVlfVgRsODlNTI2_2gnYuM0mKNd29pYlTaDxL6ATVXksaV4UaKIaEYsOLOxSA913ZwX_DDKbHJoQzDUSJWv427cO-7cHno6Nj0TchcZp8aZTNgC_9BIhSl6s64YMfiZM_Ce87nOEbBaLbT_v-yOhO3pDQYonA1t04AXlQGEoMfcozOM0yvTmlEWkeUH95IDTCWZkeXh76bg'}}
2023-04-16 13:12:14.493 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sun, 16 Apr 2023 17:12:14 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1404', 'Connection': 'keep-alive', 'x-amzn-RequestId': '15e3aaa7-fa1e-42eb-9c5b-11e561dc40e6', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains')>
2023-04-16 13:12:14.493 DEBUG (MainThread) [hatch_rest_api.util_http] response raw: {"Credentials":{"AccessKeyId":"ASIA6CHTNMDRJG645I52","Expiration":1.681668734E9,"SecretKey":"GjHqHpMAJX6jcRIUopwc+5NZbfgCciuzmT/G7bNS","SessionToken":"IQoJb3JpZ2luX2VjEDkaCXVzLXdlc3QtMiJHMEUCIQDwU89O2atEXHlmfAakAkZp3B7jGXD2V/ijV1n+j8AFbAIgTaXl3hQBR6LDm+ydkGKxPu3eo6k8qi8//k/WvESMFMUqiQQIMhAAGgw5NjY4NzgxMjYzMDYiDO/Uoj9pnV7WTKiVLirmAxteyc2KXC1DRR8nQA9KTUxe3fJEb7PBcu2yS9FOtE2itsjCSj5DMPug34eUFOSRLIsSPshqFnh2UwjHUKs+y3NJ/lxJ7dbSyiun3haSBBKWr4c81aQEAnZdxzn2dpVZZORkswCUqrnH1MqEpU3JS8C3M20Fw+olyf1zNME1J93gwQ/MvDtMcrAsjAsubz1J8IAP44actpB+3SHepDnrzonGioRXYEpCjfmPsRimOm3O3mt9o9O4Ld7odBFaLl2keWPSi4X7uP0eFNt1FlhDAske2iFRhFTfv1rMrpDqKBWt46oVsCIJlPJYiB/nvY3Qe6K/kTNuSfess+DcgO0TwxHgm0j8FyRhPkGhRcZn4h6M9ja5idx0AxZvLnvLKPq2tVPiJPAdJ0Pala5oDYWookZeXrXmOVE0O4I62vBomVwaQh1EeqmI4yvFS5GJg6hpy7X76U+IISOOhAe3g/Ky2dxumh7WzhZLcFVbSAjnrpKDc8Xfuh59A0ov1IkXkKwNqEb6L+RV9WVY5xjGAXAqzSyjA1OC9dRcKbUMID1wK8Ynq9YgXppOQhpcIDI0wGtv00fT0VUFM3n16U9hWPk6Z+6FonIMKsyrmf9gcYeOmjG1Nfl2FAZXaGeDZAzXQiOJ7Tf7A2/uszDu2PChBjqEAtqouWb23dNxWxg9TtrIVzwVVD4HdRmDy83tOY22lcqohCEEZBZRcusvqn5a6HAP0kHHiPOvwj5RrNFqqrZLvQGrJU4GeX8a8ulE2UeaTPrppF/w5C4mPsT0VrTQcE7uxKCkWqdDodY/xzPWGNK7gx7Z78MSsgly4xGb8mwZoq/Wf4bMLB95L9K5ESNIgTBJhw6Qp0AlnDOi5+lYo1+sxzeHX8KSfIxnf5YvctfeGrkLK+7A+OXuBdVsd5Cjr3HQkhxP0ILsnn32SToVG/2qNwVS2aXO2jTLefpF5eBrGV6dHt9GFtOL/gQ9HRuxK3igfa7wzuqxab5eNLES1v/yEyaovl+r"},"IdentityId":"us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b"}
2023-04-16 13:12:15.304 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
2023-04-16 13:12:15.310 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry *** for ha_hatch
File "/config/custom_components/ha_hatch/__init__.py", line 164, in async_setup_entry
File "/config/custom_components/ha_hatch/__init__.py", line 136, in setup_connection
File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 68, in get_rest_devices
File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices
jakeledwards commented 1 year ago

I'm having this same issue. I'm running HA OS on a VM. My network is Eero and I turned off threat protection and ad blocking. I would post my logs, but they are the exact same as above.

jdsebo15 commented 9 months ago

I also have this issue.

jam313 commented 8 months ago

I know this has been closed for some time now but I am getting this issue after setting up a new device.

Env

Hatch Rest Gen1

HA Core 2023.12.1
Supervisor 2023.11.6
Operating System 11.2
Frontend 20231208.2
ha_hatch integration Version: v1.16.3 (installed via HACS

Running in a VM on Proxmox v8.1.3

Unifi Setup with USG3

I have a Unifi set up but don't have any rules that I think should cause this. I also have Pi-Hole running but I don't see any traffic that seems like it could be causing the Hatch issues. I also have the Mosquitto broker installed through HA add-ons for some local stuff; not sure if that could be doing anything?

I've tried removing and re-adding the integration. Restarted HA and the VM. Nothing seems to have helped. Anyone been able to diagnose what is actually happening here or ways to fix it?

nathang21 commented 8 months ago

@jam313 This issue is still open, although a bit stale. I have the same issue, but have not been able to debug it much, the logs don't really offer much to go on.

Latest env details + debug logs (no significant changes).

env:

Core 2023.12.1
Supervisor 2023.11.6
Operating System 11.2
Frontend 20231208.2
ha_hatch integration Version: v1.16.3

debug logs:

2023-12-10 20:45:51.276 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ha_hatch which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-10 20:46:19.571 DEBUG (MainThread) [custom_components.ha_hatch] async setup
2023-12-10 20:46:19.614 DEBUG (MainThread) [custom_components.ha_hatch] updating credentials: initial setup
2023-12-10 20:46:19.708 DEBUG (MainThread) [hatch_rest_api.hatch] api_session_version: 3.9.1
2023-12-10 20:46:19.709 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/public/v1/login requestsending https://data.hatchbaby.com/public/v1/login request with {'email': '<email>', 'password': '***'}
2023-12-10 20:46:20.523 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Mon, 11 Dec 2023 01:46:20 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '670', 'Connection': 'keep-alive', 'X-Hatch-Request-Id': 'lWIPIlQiIj')>
2023-12-10 20:46:20.524 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Successful login', 'payload': {'id': 3554716, 'createDate': '2023-02-27 13:31:41', 'updateDate': '2023-02-27 13:31:41', 'active': True, 'email': '<email>', 'babies': [], 'defaultUnitOfMeasure': 'imperial', 'appType': 'iOS', 'firstName': 'Nathan Guenther', 'lastName': None, 'signupSource': 'rest', 'timezone': 'America/New_York', 'timeZoneAdjust': -5, 'stage': -10000}, 'sync': 1702259175369, 'token': 'MzU1NDcxNjoxODU5OTM5MTgwNDU2OlNIQTI1NjpmNjhkNzdlOGQxMTUxZDIxMjc4YTg2M2FiYmViNDJhZDE3NGFlN2Y2ZGQ0ZWM1MzllMDgzZTI3ZWEyZDJiNTEz'}
2023-12-10 20:46:20.524 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/iotDevice/v2/fetch request
2023-12-10 20:46:20.782 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Mon, 11 Dec 2023 01:46:20 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '116', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"0e75849e898cff43df27d325004758f76"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'ucPz5atWQc')>
2023-12-10 20:46:20.782 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1702259175571}
2023-12-10 20:46:20.782 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/restPlus/token/v1/fetch request
2023-12-10 20:46:21.382 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Mon, 11 Dec 2023 01:46:20 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '1439', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"07026e8ba2ffd83b911e5094820ab16bb"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'lVqRmgQGhk')>
2023-12-10 20:46:21.382 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Got Cognito OpenId token', 'payload': {'endpoint': 'https://aacsjje0gbbcc-ats.iot.us-west-2.amazonaws.com', 'identityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'region': 'us-west-2', 'cognitoPoolId': 'us-west-2:5651fc22-f313-49d5-b379-fdab2c535d9c', 'token': 'eyJraWQiOiJ1cy13ZXN0LTI0IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcwMjI2MTI4MCwiaWF0IjoxNzAyMjU5MTgwfQ.OmuJvghyhyy1oMkWC-OxHxOqgyQX7F82BrQkdDPfPfFHAUWSfLgGUKO9iOPNysOO8KzRerP0_zVuNevwybVAr8K8_p6xbnOucz2I9U7SF0GOlAma_Jn2lB1aL85SzerGLNNF-ucISTPRDnqqkkBFgvjaxofIFqW6RhabNrng1YtLHCkruHKciWmTHSWJKdfGpV0vK_cbbCkYE3IxTD45T1UQOx_4Izlc57BdZUd3TkCKX1bBcgBNFyvX3_FL45_z52jNOmgGdHqRxCMzW7IBKuV_n8yFfLcjEQUTSxLR9q5baVS3L2YivQtfngtnLJ71WacNDOcHH_Y-Mo61OsEyTg'}, 'sync': 1702259175825}
2023-12-10 20:46:21.382 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://cognito-identity.us-west-2.amazonaws.com requestheaders: {'content-type': 'application/x-amz-json-1.1', 'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity'}sending https://cognito-identity.us-west-2.amazonaws.com request with {'IdentityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'Logins': {'cognito-identity.amazonaws.com': 'eyJraWQiOiJ1cy13ZXN0LTI0IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcwMjI2MTI4MCwiaWF0IjoxNzAyMjU5MTgwfQ.OmuJvghyhyy1oMkWC-OxHxOqgyQX7F82BrQkdDPfPfFHAUWSfLgGUKO9iOPNysOO8KzRerP0_zVuNevwybVAr8K8_p6xbnOucz2I9U7SF0GOlAma_Jn2lB1aL85SzerGLNNF-ucISTPRDnqqkkBFgvjaxofIFqW6RhabNrng1YtLHCkruHKciWmTHSWJKdfGpV0vK_cbbCkYE3IxTD45T1UQOx_4Izlc57BdZUd3TkCKX1bBcgBNFyvX3_FL45_z52jNOmgGdHqRxCMzW7IBKuV_n8yFfLcjEQUTSxLR9q5baVS3L2YivQtfngtnLJ71WacNDOcHH_Y-Mo61OsEyTg'}}
2023-12-10 20:46:22.641 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Mon, 11 Dec 2023 01:46:22 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1428', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'd3301928-3f26-4d4d-9d48-765aaaf17b84', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains')>
2023-12-10 20:46:22.641 DEBUG (MainThread) [hatch_rest_api.util_http] response raw: {"Credentials":{"AccessKeyId":"ASIA6CHTNMDREDQKP5P7","Expiration":1.702262782E9,"SecretKey":"d5QF8kObrsmm6RlsLU0l3Oe0c+gVdaoxyRks1/9T","SessionToken":"IQoJb3JpZ2luX2VjEJL//////////wEaCXVzLXdlc3QtMiJHMEUCIDQhJrfxwpuJbpHymixW9a+QofjnD9gY6Ek6BpDcA/isAiEAq7GD+nvHRZMte1NEVMrlooKKt8tTbBO/GIVMwliZ4PsqkgQI+///////////ARAAGgw5NjY4NzgxMjYzMDYiDA2pTfxkydR9UNp+iyrmA4KzQwx5aSenGS0YUkrfLkjrKqGSzTBVpHqkBvDc00dDrehHBC6poSIv7D81KywFgSE4vCM6BxfnGf5mOXt1SEh0XpTWWKZthkmGSTKEvL0PjywE8ec1xk2S09JnUKZpFtDG8bZn/oM2Ck2diQ9vySg/sFA2EAjWyM93Qnx6VPsGNLvhMYMMxsDP9YpBFdFgmPpKVhMor1x2sVL4YIK3/9moO6eljT4SgThHXmbb2Xi2kFDDN07d1FU79JfHnNTObiTn92uRjq1vyuJ8BFIIF4oxH4ERnJDGVk4Nle06HZ6+V63dimh411UzoDuKPYYUvEtIj3hHLGmFbBDAeNymP12wdjuWlnb8r6vo48H+vTEuitSf11co56LzCKFaRt2WpPNhJgzXhfXFQxZoAyjOP7BmYsR36q1m9ByiOSaeuf15v5ucDpBisq9WgIX0DFJTJryjpOYiMvZKoI8r9d00Zlsyc8g2rA8aZkdX6YIK5WAVnnZ/SodqiDo+O5cJ1vJM3hLOr3Fw3bR0FbNNMYA0kHFdOsqjnmuMMc9SWNtM9EdprQnxYulD/k2e7UX5F1uolkr8/nr9VV2Cwzs9LbZ0pNfaWLDTyhpJV4qih2MwU6cW9IwzfGc93Dq6wLNBrNB33AMmfvofXzDu09mrBjqEAhpDtT2E6pQHidpck2A+skddUZYUS9/3VrLR13k2pCjf9vWlcIPB0WFBPHuSMjiKamEFhAii6XtL/b6fhRqVDB/jpWslbDR9jvRviIl8tg5GAq4cH8xYQNOSHhWJWl+5opPWR1uSHpT5fVyFvaoDNbg/soobySHTwBmuPU9mJjAZS6iSeKWhwIy68lRNg0q9hMTj0QNIpOV1pdeGHahTXPhnpzwOU4JFILHEvG6xS3BioZd1igalxS/Pr3zY2nxiivKLbW+WTxW1SEcxg468FlJkfDzwpYayb30W++zImyVJFBwAVd75nL8EUJ9WDhoi93wKtjvW5fT64wKmVq6/ZlvwzFWH"},"IdentityId":"us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b"}
2023-12-10 20:46:23.292 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
2023-12-10 20:46:23.292 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <email> for ha_hatch
File "/config/custom_components/ha_hatch/__init__.py", line 105, in async_setup_entry
File "/config/custom_components/ha_hatch/__init__.py", line 77, in setup_connection
File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_bootstrap.py", line 68, in get_rest_devices
File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices
2023-12-11 10:48:28.285 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration ha_hatch which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-12 21:47:45.171 WARNING (SyncWorker_15) [homeassistant.loader] We found a custom integration ha_hatch which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-13 09:32:54.710 DEBUG (MainThread) [custom_components.ha_hatch] updating credentials: initial setup
2023-12-13 09:32:54.720 DEBUG (MainThread) [hatch_rest_api.hatch] api_session_version: 3.9.1
2023-12-13 09:32:54.721 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/public/v1/login requestsending https://data.hatchbaby.com/public/v1/login request with {'email': '<email>', 'password': '***'}
2023-12-13 09:32:55.140 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Wed, 13 Dec 2023 14:32:55 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '670', 'Connection': 'keep-alive', 'X-Hatch-Request-Id': 'o1LNrk11gx')>
2023-12-13 09:32:55.141 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Successful login', 'payload': {'id': 3554716, 'createDate': '2023-02-27 13:31:41', 'updateDate': '2023-02-27 13:31:41', 'active': True, 'email': '<email>', 'babies': [], 'defaultUnitOfMeasure': 'imperial', 'appType': 'iOS', 'firstName': 'Nathan Guenther', 'lastName': None, 'signupSource': 'rest', 'timezone': 'America/New_York', 'timeZoneAdjust': -5, 'stage': -10000}, 'sync': 1702477970027, 'token': 'MzU1NDcxNjoxODYwMTU3OTc1MDk5OlNIQTI1NjoxNTM1YWM3YzE1Njg2ZTc4YzU2YjY2ZmI4NDQyMWQ2NzhkYzU5MzIwOTAzYmZjMzlhNWRhM2I4YThjNjBiNGZk'}
2023-12-13 09:32:55.141 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/iotDevice/v2/fetch request
2023-12-13 09:32:55.228 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Wed, 13 Dec 2023 14:32:55 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '116', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"036a8ea14f6c9426515c39032f36bec37"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'OWbLp12WsC')>
2023-12-13 09:32:55.228 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1702477970183}
2023-12-13 09:32:55.228 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/restPlus/token/v1/fetch request
2023-12-13 09:32:55.359 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Wed, 13 Dec 2023 14:32:55 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '1439', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"007b32c8f53df970045d23b22328b61ca"', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'fQ9ovIVrQc')>
2023-12-13 09:32:55.359 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Got Cognito OpenId token', 'payload': {'endpoint': 'https://aacsjje0gbbcc-ats.iot.us-west-2.amazonaws.com', 'identityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'region': 'us-west-2', 'cognitoPoolId': 'us-west-2:5651fc22-f313-49d5-b379-fdab2c535d9c', 'token': 'eyJraWQiOiJ1cy13ZXN0LTI0IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcwMjQ4MDA3NSwiaWF0IjoxNzAyNDc3OTc1fQ.FndAETfmaaNe_4MtnnIhpomkvRanM3LHo6RD2Al_VZijxBLvhcloLLnQv6sIwv_UHcxgpkwUWF3q6znObINO7unI1lI6Pyn3giLURh4N4sozNSPCpQZb9nJF21q5-KFEgXF96zUyYJKuc56qiTjfHtgoHmkGfbyoqtbyb4BdJd0MU2tKLMj0WDcVn13b77KbcHyXwOM1HnrHpG2LjJDimzm1ITG2TFSf7eIF4R9nc1xOA21JrgG3LrLPMP8iIvxrIVR8sU3RxisTO8MxCG117qMmaGJ0trJjseT9-HuMpskY4OIjXPRf_wJjVS6K89GUpMy_w_oM-WTlFQSktyeInQ'}, 'sync': 1702477970272}
2023-12-13 09:32:55.359 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://cognito-identity.us-west-2.amazonaws.com requestheaders: {'content-type': 'application/x-amz-json-1.1', 'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity'}sending https://cognito-identity.us-west-2.amazonaws.com request with {'IdentityId': 'us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b', 'Logins': {'cognito-identity.amazonaws.com': 'eyJraWQiOiJ1cy13ZXN0LTI0IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6NjkxNmFmZDItNTkxZi00OTQyLThlY2EtYjE3MTNiOGIxYzRiIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0zNTU0NzE2Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcwMjQ4MDA3NSwiaWF0IjoxNzAyNDc3OTc1fQ.FndAETfmaaNe_4MtnnIhpomkvRanM3LHo6RD2Al_VZijxBLvhcloLLnQv6sIwv_UHcxgpkwUWF3q6znObINO7unI1lI6Pyn3giLURh4N4sozNSPCpQZb9nJF21q5-KFEgXF96zUyYJKuc56qiTjfHtgoHmkGfbyoqtbyb4BdJd0MU2tKLMj0WDcVn13b77KbcHyXwOM1HnrHpG2LjJDimzm1ITG2TFSf7eIF4R9nc1xOA21JrgG3LrLPMP8iIvxrIVR8sU3RxisTO8MxCG117qMmaGJ0trJjseT9-HuMpskY4OIjXPRf_wJjVS6K89GUpMy_w_oM-WTlFQSktyeInQ'}}
2023-12-13 09:32:55.722 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Wed, 13 Dec 2023 14:32:55 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1416', 'Connection': 'keep-alive', 'x-amzn-RequestId': '8ccbe59f-4272-41af-96a8-1dc34ed82ae7', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains')>
2023-12-13 09:32:55.722 DEBUG (MainThread) [hatch_rest_api.util_http] response raw: {"Credentials":{"AccessKeyId":"ASIA6CHTNMDRDQ3E5TUK","Expiration":1.702481575E9,"SecretKey":"Wj9EIcL6R+x9e4MBNPQPX+fjJeZZ8GekRdB5ndRj","SessionToken":"IQoJb3JpZ2luX2VjEM///////////wEaCXVzLXdlc3QtMiJHMEUCIChozUZRp+k4QAWV3qTwXWgF6JTPI5yul4QtDH5+h7rtAiEAtBKqjSzPalYHCG+KhVlOmGvNJiOSj0QztAlX27J8x9gqiQQISBAAGgw5NjY4NzgxMjYzMDYiDNU5I/0VvaVeMnG+JSrmA0uhxewHOl7kRC/1Noi7QDqKSI4egRN/LYNiuQUxeEy0pcK0JMPpy+ST5syA0mrR96VotV5OmsjqKqRhxa9aO6mTUCasQMziczQHqZ0YcrSXBCY2Fl0k0kEKNv8WGWMwXQihHhWUlCMFXbpPc3daidURM223tp7u6xCi8jFSUZ3zgcgtfcoLIaQ5TNMOAoOKAHngPx79ZFjsEyp7HHKwLpsY7JQFhdwGjFy/hIgbOOUnpj4LzxbZ81VtGvQmx1+HdNoJhxbdhXR2BkxsXKQkUJ24697M4TpUdslpB6TQyvrfVvD1d8OMAL0pzy9wRLVGg7n2IfA80QocMvHNqCC9+bWSpibAgeqUgxeukzHDBl/XF1DhEWSlaNjWmo4Ia2Leqze0fGegz2JCMBULMlpKPh4bcTt4Pqgedgsd+bjDuStAVR2IuWU0sScWG+zIFGvzOXCPqwHiQhoLdSG8kSKhS0P2LA9ZOwOTCAGCwxfS/wGPbHw/nEZCgQQgrPGFwfatyi88bNRIy5H+LWovQsDKHS4gIfeGRoBf4XNw1fIFecANZzhFR128yTzhcxR+6suZWOgjN2OxB1/mMw+Sj31nkyvinrAKhROuxkmHdMXJ43RDzE023lQSMLy8O/LW9qY409PdJWo9tjCXgeerBjqEAod6mRzMQZPa/tkPvmUBa+IBOxowtS1BvjnaW4x6v6ViBZJ2Kec0xewArb5KISTXcecYYRw7uF0a98cxMgr49jmKaaIHduF9QnJnkdUr10LrNUX6jmDqTf7Z+LPlq1NFRTPVxn90vN4VGSw2yvNFR2rr1Jh52JAi4eRHpqODefQ3/lIfITC/67sNmUPy7LZYBFINj/NmY5uXc6R7zg0y834CWpaN7OC+7uwP0Zn0Q/i30LiSDGOYvZkyZ8R1BYAqUtvWZ3g6MZG0bCFT9LHVk0MInAD4JlT/7iAczqgnHYfpz+GNdvN3LCCDvE/6oXMqD5faa0O6Yu0SvYTLQ8rh+jehijS3"},"IdentityId":"us-west-2:6916afd2-591f-4942-8eca-b1713b8b1c4b"}
2023-12-13 09:32:56.391 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
2023-12-13 09:32:56.391 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <email> for ha_hatch
File "/config/custom_components/ha_hatch/__init__.py", line 105, in async_setup_entry
File "/config/custom_components/ha_hatch/__init__.py", line 77, in setup_connection
File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_bootstrap.py", line 68, in get_rest_devices
File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices
jam313 commented 8 months ago

@nathang21 one thing I noticed in both our debug logs is that the request to https://data.hatchbaby.com/service/app/**iotDevice**/v2/fetch returned

{'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1702477970183}

So I seems it might be because there is an empty payload. I also saw form an earlier comment that you are also using a gen 1 Rest an I did not see anyone else mention that one . Technically the readme does not list it as tested/supported so I'm hoping someone can confirm either way

lxe commented 8 months ago

Just piggybacking on this:

awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
thunderwood19 commented 5 months ago

Also running into this issue. Fresh install of the custom integration.

HA 2024.3.0

Logger: hatch_rest_api.util_bootstrap Source: custom_components/ha_hatch/init.py:77 integration: Hatch Rest Mini/Plus (documentation, issues) First occurred: 15:29:18 (4 occurrences) Last logged: 15:33:43

MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.

thunderwood19 commented 3 months ago

Still running into this. Have attempted fresh install of the integration and still getting MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.

zarzycki commented 3 months ago

Same issue:

2024-05-25 18:38:14.664 DEBUG (MainThread) [custom_components.ha_hatch.config_flow] user input in option flow : {'turn_on_light': False, 'turn_on_media': False}
2024-05-25 18:38:18.694 DEBUG (MainThread) [custom_components.ha_hatch] updating credentials: initial setup
2024-05-25 18:38:18.696 DEBUG (MainThread) [hatch_rest_api.hatch] api_session_version: 3.9.5
2024-05-25 18:38:18.696 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/public/v1/login requestsending https://data.hatchbaby.com/public/v1/login request with {'email': '***@gmail.com', 'password': '***'}
2024-05-25 18:38:19.197 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sat, 25 May 2024 22:38:19 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '654', 'Connection': 'keep-alive', 'X-Hatch-Request-Id': 'j14Os2sO7C')>
2024-05-25 18:38:19.198 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Successful login', 'payload': {'id': 1514928, 'createDate': '2021-03-29 15:45:08', 'updateDate': '2022-03-06 16:25:12', 'active': True, 'email': '***@gmail.com', 'babies': [], 'defaultUnitOfMeasure': 'imperial', 'appType': 'iOS', 'firstName': 'Colin', 'lastName': None, 'signupSource': 'rest', 'timezone': 'America/New_York', 'timeZoneAdjust': -4, 'stage': -10000}, 'sync': 1716676694072, 'token': 'MTUxNDkyODoxODc0MzU2Njk5MTQ1OlNIQTI1Njo3NDgwZWZjOWU2MzQzYTBhOTQ0YjQzY2NjY2FlYTc2ODFhMjQ3MmE5ZWFjZTY0MzhjM2VlMmNlOTE5MzFmYTE1'}
2024-05-25 18:38:19.199 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/iotDevice/v2/fetch request
2024-05-25 18:38:19.300 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sat, 25 May 2024 22:38:19 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '116', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"06b7841a27488e579c329f6f2ae14ff2b"', 'Vary': 'Origin', 'Vary': 'Access-Control-Request-Method', 'Vary': 'Access-Control-Request-Headers', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'POvnKQEzLz')>
2024-05-25 18:38:19.301 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Fetched list of IoT Devices', 'payload': [], 'sync': 1716676694244}
2024-05-25 18:38:19.302 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://data.hatchbaby.com/service/app/restPlus/token/v1/fetch request
2024-05-25 18:38:19.419 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sat, 25 May 2024 22:38:19 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '1439', 'Connection': 'keep-alive', 'Expires': '0', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'X-XSS-Protection': '0', 'Pragma': 'no-cache', 'X-Frame-Options': 'DENY', 'Etag': '"0f27b4d6bb12f6f5ec74888eb17e1ae63"', 'Vary': 'Origin', 'Vary': 'Access-Control-Request-Method', 'Vary': 'Access-Control-Request-Headers', 'X-Content-Type-Options': 'nosniff', 'X-Hatch-Request-Id': 'Whbs3soNaM')>
2024-05-25 18:38:19.420 DEBUG (MainThread) [hatch_rest_api.util_http] response json: {'status': 'success', 'message': 'Got Cognito OpenId token', 'payload': {'endpoint': 'https://aacsjje0gbbcc-ats.iot.us-west-2.amazonaws.com', 'identityId': 'us-west-2:e11e6d60-e200-c07d-f380-4937b892f81d', 'region': 'us-west-2', 'cognitoPoolId': 'us-west-2:5651fc22-f313-49d5-b379-fdab2c535d9c', 'token': 'eyJraWQiOiJ1cy13ZXN0LTI1IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6ZTExZTZkNjAtZTIwMC1jMDdkLWYzODAtNDkzN2I4OTJmODFkIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0xNTE0OTI4Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcxNjY5ODI5OSwiaWF0IjoxNzE2Njc2Njk5fQ.Hv_-7HzL_GWLDO3TlnH_jv77KVdWSow7gR5yKfOQ6Zy54EGhDHXP8-xv0MCsHHTJgxcX5J79O92YbumLg00Lvf5196yDFHC8cml65MRMl20IEyQGc4snvmf03hk2Q_4QQzB3xX0rHc0yb25cd-vfJN4syf_DgZSeVLUEHIurOs4HzV_gt_3Pz3XlJQAhFdf2Vs5EunKMoY9TiARf_cqRp9uzzzLK_jQRdQn_WkUwealk4DjExogYzSak4WDxqHPuvv4wdW_1tX1yrKbRk03_rtNBy2kIpJZ4Dy7W5etu1_BMPnyMs7pHMxxjCPD5R0dkLrizif-GZCTA4PF9x5u3og'}, 'sync': 1716676694350}
2024-05-25 18:38:19.421 DEBUG (MainThread) [hatch_rest_api.util_http] sending https://cognito-identity.us-west-2.amazonaws.com requestheaders: {'content-type': 'application/x-amz-json-1.1', 'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity'}sending https://cognito-identity.us-west-2.amazonaws.com request with {'IdentityId': 'us-west-2:e11e6d60-e200-c07d-f380-4937b892f81d', 'Logins': {'cognito-identity.amazonaws.com': 'eyJraWQiOiJ1cy13ZXN0LTI1IiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy13ZXN0LTI6ZTExZTZkNjAtZTIwMC1jMDdkLWYzODAtNDkzN2I4OTJmODFkIiwiYXVkIjoidXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luIiwiaGF0Y2gud2lmaS5yZXN0LmxvZ2luOnVzLXdlc3QtMjo1NjUxZmMyMi1mMzEzLTQ5ZDUtYjM3OS1mZGFiMmM1MzVkOWM6cHJvZC0xNTE0OTI4Il0sImlzcyI6Imh0dHBzOi8vY29nbml0by1pZGVudGl0eS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly9jb2duaXRvLWlkZW50aXR5LmFtYXpvbmF3cy5jb20vaWRlbnRpdHktcG9vbC1hcm4iOiJhcm46YXdzOmNvZ25pdG8taWRlbnRpdHk6dXMtd2VzdC0yOjk2Njg3ODEyNjMwNjppZGVudGl0eXBvb2wvdXMtd2VzdC0yOjU2NTFmYzIyLWYzMTMtNDlkNS1iMzc5LWZkYWIyYzUzNWQ5YyIsImV4cCI6MTcxNjY5ODI5OSwiaWF0IjoxNzE2Njc2Njk5fQ.Hv_-7HzL_GWLDO3TlnH_jv77KVdWSow7gR5yKfOQ6Zy54EGhDHXP8-xv0MCsHHTJgxcX5J79O92YbumLg00Lvf5196yDFHC8cml65MRMl20IEyQGc4snvmf03hk2Q_4QQzB3xX0rHc0yb25cd-vfJN4syf_DgZSeVLUEHIurOs4HzV_gt_3Pz3XlJQAhFdf2Vs5EunKMoY9TiARf_cqRp9uzzzLK_jQRdQn_WkUwealk4DjExogYzSak4WDxqHPuvv4wdW_1tX1yrKbRk03_rtNBy2kIpJZ4Dy7W5etu1_BMPnyMs7pHMxxjCPD5R0dkLrizif-GZCTA4PF9x5u3og'}}
2024-05-25 18:38:19.778 DEBUG (MainThread) [hatch_rest_api.util_http] response headers:<CIMultiDict('Date': 'Sat, 25 May 2024 22:38:19 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1416', 'Connection': 'keep-alive', 'x-amzn-RequestId': '417a02f7-2e8f-4b93-ac67-6ce7b56bde9b', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains')>
2024-05-25 18:38:19.778 DEBUG (MainThread) [hatch_rest_api.util_http] response raw: {"Credentials":{"AccessKeyId":"ASIA6CHTNMDRHUHBMLKZ","Expiration":1.716680299E9,"SecretKey":"nR5rrmjx2wwSagqOYK9gvmPIQCXzABnWVOH8DVTS","SessionToken":"IQoJb3JpZ2luX2VjEDcaCXVzLXdlc3QtMiJHMEUCIQD/esoyhD8qDe11UJCRAwcN8vqVN36LBUm+wn0ro7oO5gIgfeGKQXBmdKazLr6rPDVED5KPo7ZgvLqul30ZmgZqjLwqkgQIsP//////////ARAAGgw5NjY4NzgxMjYzMDYiDLNGP5QO7QLZ0ISXzCrmA1EdmGl3VI922kqPpRDj2tsQaU5P66meAxxJ2wReEMLg7xOPzNXgtilZZYe5m8iWCa3Uc+hWt9IEcmvobuS8bTivQ6hJbVh+MfCQjAnLtxc7v7z4amRh/RToAU1tyJZKq3z2194pbMdCOFxqsrBYV6wSY4N1G8cnR8bt9rUPxlL3afvEAcss0ylhS0FwqtY1F+LQIpO4qJT66uJouCAygrza3SSOPakVlLcu/aZZ1PZoTL9zy+1bzTl1E2AcKR7JN9OR6hgHh5hvGA6YgyF3frn+rvL0h+Y766E59qz2dcaLRI/2mOjc1/zhZ4G9EKfdpOHTeJul6uyzCR4ZwTA/+7ZxfI/97UvV2+ZkxJpOSlcNpSS7dQNdAslPB3FGVe1l9ZLptccyj1skm0zC7MKousuq6wYtYcOAy4gJZfnsQwmZYky/iQ1diN4RsAG7k6dp2QgNfKZ2n6p34X0G9z0fyXLlDe5YA3v4MY7fYJq74FcZ2YHSgnIr1Sk1/7Zljfi3OqSUhHJQb2pEYoP/7cHPgeH4oWsuaFUgWCXLWWIwnIqMVrUZ3FgkxN0uJGZWDdWIgp2w4RMXGK69q32lAXxeJdklE2qlzEysrjZB4vUqfhIo8LyToVvsT4GQNHchgG9V/ZymKN1h/DDb0MmyBjqEAvsKWV8wzi1PhZbkfpM6WlZQpb5kGnEaKzUpi6EMuhNhNHj2lVuxSrrIdNhXQDT3jtp/qIFmGe8gD2IBkeIr2DYhrISx0HTpezTXr06jqNFsttzyMNYtsf/3jf6ZycDVqhGprH21b14rL6ySFAtxOXLxaPu1N5mK5czJ1Y9r6deQw10hvSVoBABeGamG+hFl0GWsBUKIh5pFKRGiIEVGF9r0ZaU62Lw6WC3XxWFbKt4TDQr+CcMgntoFDBrOlsgVhnkN8bJuiBAFDVTZFRgoYzpcBWw/o1CXquHglwPQDYIamXbGSA2TMNa0MSy8ulEoMEn5sAN89bV4GejLB/5zQNXMmgvV"},"IdentityId":"us-west-2:e11e6d60-e200-c07d-f380-4937b892f81d"}
2024-05-25 18:38:20.441 ERROR (MainThread) [hatch_rest_api.util_bootstrap] MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
2024-05-25 18:38:20.442 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ***@gmail.com for ha_hatch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 584, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ha_hatch/__init__.py", line 105, in async_setup_entry
    await setup_connection("initial setup")
  File "/config/custom_components/ha_hatch/__init__.py", line 77, in setup_connection
    _, mqtt_connection, rest_devices, expiration_time = await get_rest_devices(
                                                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hatch_rest_api/util_bootstrap.py", line 68, in get_rest_devices
    raise e
  File "/usr/local/lib/python3.12/site-packages/hatch_rest_api/util_bootstrap.py", line 64, in get_rest_devices
    mqtt_connection.connect().result()
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.

However, I suspect it is because the only Rests on my account are the Gen1 Bluetooth ones. So that may be a datapoint supporting @jam313's hypothesis in https://github.com/dahlb/ha_hatch/issues/10#issuecomment-1855978475