icloud3 icon indicating copy to clipboard operation
icloud3 copied to clipboard

Home Assistant may be Offline (Connection reset by peer)

Open UiharuKazari2008 opened this issue 7 months ago • 12 comments

iCloud3 Error > An error occurred connecting to the Internet, Home Assistant may be Offline > Error-('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

I am no longer able to use the intergration and it keeps saying "i dont have internet" when i do, I did lose internet for a extended period of time but HA was shutdown in that time. I also have 2 internet connections so going offline is just not really possible, just IP changes.

I have restarted the intergration and disabled IPv6 and nothing seens to change. I dont even see where it will say what it was using to check for access.

UiharuKazari2008 avatar May 05 '25 17:05 UiharuKazari2008

025-05-05 14:06:43.266 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry iCloud3 for device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 751, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 56, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 182, in async_setup_entry
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Config entry iCloud3 (01JT6MZAP40GX1XWN9098F7AG8) for icloud3.device_tracker has already been setup!
2025-05-05 14:06:43.537 ERROR (SyncWorker_9) [custom_components.icloud3] ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
    ~~~~~~~~~~~~~~^^^^^^^^^
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.13/http/client.py", line 1430, in getresponse
    response.begin()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 292, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
           ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
        method=request.method,
    ...<9 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 802, in urlopen
    retries = retries.increment(
        method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/util/retry.py", line 552, in increment
    raise six.reraise(type(error), error, _stacktrace)
          ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
    ~~~~~~~~~~~~~~^^^^^^^^^
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.13/http/client.py", line 1430, in getresponse
    response.begin()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 292, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
           ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/pyicloud_session.py", line 192, in request
    response = Session.request(self, method, url, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 682, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2025-05-05 14:06:43.544 ERROR (SyncWorker_9) [custom_components.icloud3] iCloud3 Error > An error occurred connecting to the Internet, Home Assistant may be Offline > Error-('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2025-05-05 14:06:43.548 ERROR (SyncWorker_9) [custom_components.icloud3] iCloud3 Error > Apple Acct > *******, Login Failed, Error--3, Unknown Error, AppleServerLocation-`usa`, Location Data not Refreshed

I cant make sense of anything its saying, Is it using a non-standard DNS, is it even using the DNS configured on the host?

UiharuKazari2008 avatar May 05 '25 18:05 UiharuKazari2008

Image Same issue. Just updated to the latest version of HA. Apple account is logged out. When trying to login again it states ther is no internet connection.

UPDATE: Reboot of HA VM fixes the issue.

mobiledude avatar May 08 '25 18:05 mobiledude

I don’t like to be that guy and just forget about issues but I have used the native iCloud intervration and it works for now. I would like to use iCloud3 for the extra data but the native one does work. Just login with your real account password NOT THE APP PASSWORD, they need to update that Sent from my iPadOn May 8, 2025, at 14:07, mobiledude @.***> wrote: mobiledude left a comment (gcobb321/icloud3#456) Same issue. Just updated to the latest version of HA. Apple account is logged out. Whentrying to login again it states ther is no internet connection.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

UiharuKazari2008 avatar May 08 '25 21:05 UiharuKazari2008

@mobiledude @UiharuKazari2008 Apple does not support App Specific Passwords with programs that access the Apple Account with a Web browser.

  1. I updated to HA 2025..5 yesterday and logged back into my Apple account without any problems.
  2. Does iCloud3 start if you restart HA? Do you have any other components that access the internet without a problem? I followed the Internet available error checking used by the Places custom component (download using HACS). It provides an actual address from the gps location. See if that works.
  3. Are you using IPv6? That it’s not supported.
  4. Any other error messages ! In Event Log?

gcobb321 avatar May 09 '25 08:05 gcobb321

Well I have some leads but ill answer u first

  1. The intergration "starts" but would fail on that error and would spam the logs
  2. No, IPv6 on any of my WANs, i have IPv6 disabled on the host and on the router cause I know how useless and service breaking it is Image
  3. I cleared it out but the native one gives the same error:
Logger: homeassistant.config_entries
Source: config_entries.py:749
First occurred: 8:13:21 PM (1 occurrence)
Last logged: 8:13:21 PM

Error setting up entry [email protected] for icloud
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
    ~~~~~~~~~~~~~~^^^^^^^^^
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.13/http/client.py", line 1430, in getresponse
    response.begin()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 292, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
           ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
        method=request.method,
    ...<9 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 802, in urlopen
    retries = retries.increment(
        method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/util/retry.py", line 552, in increment
    raise six.reraise(type(error), error, _stacktrace)
          ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
    ~~~~~~~~~~~~~~^^^^^^^^^
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.13/http/client.py", line 1430, in getresponse
    response.begin()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/http/client.py", line 292, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
           ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/icloud/__init__.py", line 100, in async_setup_entry
    await hass.async_add_executor_job(account.setup)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/icloud/account.py", line 111, in setup
    self.api = PyiCloudService(
               ~~~~~~~~~~~~~~~^
        self._username,
        ^^^^^^^^^^^^^^^
    ...<2 lines>...
        with_family=self._with_family,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyicloud/base.py", line 271, in __init__
    self.authenticate()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyicloud/base.py", line 287, in authenticate
    self.data = self._validate_token()
                ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyicloud/base.py", line 381, in _validate_token
    req = self.session.post("%s/validate" % self.SETUP_ENDPOINT, data="null")
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyicloud/base.py", line 78, in request
    response = super().request(method, url, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 682, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Now that being said, That was occurring when I was using my Comcast gateway (this is a DOCSIS modem not a double NAT) but when I switched on to my T-Mobile home internet connection via a firewall rule the native iCloud can login but not iCloud3 it does not look to even try to relogin just fail

UiharuKazari2008 avatar May 10 '25 00:05 UiharuKazari2008

The native iCloud integration does not catch Connection Errors like iCloud3 does. You said iCloud will let you log in but does it report location info correctly? And does its act like it normally does?

I googled Connection Reset by Peer 104, the error you are receiving, and got this:

How do I fix error connection reset?
AI Overview

+13
To fix the "ERR_CONNECTION_RESET" error, try restarting your router and checking your internet connection first. If that doesn't work, clear your browser's cache and cookies, disable any browser extensions, and temporarily deactivate your antivirus and firewall. You can also try disabling your VPN or proxy settings. If the issue persists, consider resetting your TCP/IP settings or contacting your internet service provider (ISP). 
Here's a more detailed breakdown of troubleshooting steps:
1. Basic Checks:
Restart your router: Unplug your router's power cable, wait 30 seconds, and plug it back in. 
Check your internet connection: Ensure you have a stable and strong internet connection. 
Try another device: See if the error occurs on other devices connected to the same network. 
Check the website: Make sure the website you are trying to access is working and not down. 
2. Browser-Specific Solutions:
Clear your browser's cache and cookies: This can remove corrupted data that might be interfering with the connection. 
Disable browser extensions: Some extensions can interfere with web connections. 
Try a different browser: If the error persists, try accessing the website with a different browser. 
3. Network and System Settings:
Disable your VPN or proxy: If you're using a VPN or proxy, try disabling it temporarily. 
Disable your antivirus and firewall: These security programs can sometimes block connections. 
Reset your TCP/IP settings: This can be done through the command line in Windows or through network settings in macOS. 
Flush your DNS cache: This can clear outdated DNS records that might be causing issues. 
4. Advanced Troubleshooting:
[Contact your ISP:](https://www.google.com/search?client=mobilesearchapp&sca_esv=87e46e2d1762fa07&channel=iss&cs=1&hl=en&rlz=1MDAPLB_enUS898US898&v=367.0.752095380&sxsrf=AHTn8zpwt5tNwCvItJss9UqJjKVpCgtYAw:1746864282750&q=Contact+your+ISP&sa=X&ved=2ahUKEwjl4avIuJiNAxUpSDABHZL7GEYQ4eYNegQIcBAD)
If none of the above steps work, your ISP may be able to help diagnose the issue. 
[Contact the website's support:](https://www.google.com/search?client=mobilesearchapp&sca_esv=87e46e2d1762fa07&channel=iss&cs=1&hl=en&rlz=1MDAPLB_enUS898US898&v=367.0.752095380&sxsrf=AHTn8zpwt5tNwCvItJss9UqJjKVpCgtYAw:1746864282750&q=Contact+the+website%27s+support&sa=X&ved=2ahUKEwjl4avIuJiNAxUpSDABHZL7GEYQ4eYNegUIlgEQAw)
If the error is specific to a particular website, their support team might be able to provide assistance. 


This video demonstrates how to fix ERR_CONNECTION_RESET on Chrome:

I wonder if iCloud3 is being too aggressive catching a 104 error when it should report it but continue. When iCloud3 gets a connection error, it retries the connection every 10-secs or so (each retry is dot on the Event Log). It checks to see if it is back up trying to connect with the Google dns server at 8.8.8.8. When it gets a good connection, everything continues. Before, it worked get a Connection Error and fill the Log files with error messages every 5-seconds

gcobb321 avatar May 10 '25 08:05 gcobb321

Image It works fine, like i said its only when on specific public IPs. In the time this happened i moved the router as it died and had to be migrated to vmware until i can afford hardware but that should not be a issue.

I do remember first tiring to switch network connection because I assume my IP was blocked by whatever polling iCloud3 was doing and on T-Mobile it still would not attempt to connect. I wiped everything even deleted the folder and i was able to login to my account (this it had the no internet banner) got the challenge completed, added the devices. Then as soon as it reloaded its self back to the same no internet access.

But if its trying to access 8.8.8.8 then that's going to fail as any DNS that's not the primary one (pihole), I mean if your checking internet it would make sense to check apple.com (that not only checks that DNS is working but the thing your going to be connecting to) not google dns (that lot of people block or 1:1 due to google home and such not respecting DHCP)

For now i will just deal with the native integration sense I mainly used icloud3 due to the outdated instructions, and i kind of prefer the lack of the spamming and number of entities that recorder that ic3 does

Now it not being able to connect may be a Comcast issue, that's not something I'm really looking to fix as i rather get in a car accident then be on the phone with them.....

UiharuKazari2008 avatar May 10 '25 09:05 UiharuKazari2008

  1. I’m using 8.8.8.8 so I do not have to do a dns lookup since I’m only trying to see if the internet it’s alive and can be connected to. Other code (I think since it gets complicated and it’s been a while since I was in that code) checks if iCloud.com is available. That is, if I can connect to 8.8.8.8 but not Apple, then Apple is down. I had not considered if 8.8.8.8 or CloudFlare at 1.1.1.1 might be blocked.

  2. A Session is created when iCloud3 starts to validate the username/password that is different than the one that gets data from Apple. If that Session is reset, than the 8.8.8.8 would always fail and iCloud3 would never know when the internet came back up. I wonder if another method of testing the connection would work. HA has a Ping integration. I’ll look at that.

  3. Another guy is also having 104-ConnectionReset issues.

  4. Restarting iCloud3 on the Event Log will not get a new Session but reloading will. Try Configure > Tools > Reload iCloud3 to see if it starts up correctly.

  5. A lot of the docs have been reorganized and a working on it. I just put up v3.2 on the Development repo. It contains a Dashboard Builder that simplifies the initial install a lot since it will automatically build the Lovelace Dashboard. No more cut and paste yaml code.

  6. Sensors can be turned off on Configure > Sensors

gcobb321 avatar May 12 '25 08:05 gcobb321

Hello, I’m the guy with similar issue and would like to share my experience here. In researches of my case I noticed that when use direct ip address in url I receive certificate error in connection, but when I switched to the dns name, then connection establishing normally (switch to utilize dns lookup). Followed by this, I’ve made little changes in the code (pyicloud_session.py) instead https://8.8.8.8 I use dns name for nearest web site, (obviously internet providers). So far it’s worked for me, for 2 days without offline messages (reload iCloud3 & restart HA). Hope this will helps.

Update: tonight was logged error which is not followed to the offline mode of the iCloud3, I believe reconnect succeeded

error.txt

romlisrl avatar May 15 '25 06:05 romlisrl

All I’m doing with that code is to see if the Internet is back up and have come up with a better way by using the HA ping integration. It has a routine that checks if an IP it’s available. I’m going to use it instead of the way it is being done now. Another’s problem I’ve come across is that 8.8.8.8 (Google DNS Server) is blocked in China so I’ll have several IPs to try.

I’ll post some updated code to test when it is ready.

gcobb321 avatar May 15 '25 09:05 gcobb321

I just think it would be nice to either have an advanced option buried in the menu to set the internet check URL, disable the internet check, or use a binary entity (one that can be templated off Pfsense intergration).

UiharuKazari2008 avatar May 18 '25 17:05 UiharuKazari2008

I am in the process of redoing that right now.

This is how it will work:

  1. Get your external ip address when iC3 starts and save it in the config file.
  2. Add your external ip address to the beginning of a table of ip addresses
  3. The table is: 'youridaddress','74.43.56.21', 'Google/P': '8.8.8.8', 'Google/S': '8.8.4.4', 'CloudFlare/P': '1.1.1.1', 'CloudFlare/S': '1.0.0.1', 'OpenDNS/P': '208.67.222.222', 'OpenDNS/S': '208.67.220.220', 'ChinaAlibaba/P1': '116.251.64.1', 'ChinaAlibaba/P2': '43.33.76.1', 'ChinaAlibaba/S': '65.22.132.9', 'ChinaOpen114/S': '114.114.115.115',
  4. HA has a Ping integration. Use this integration to Ping the table of ip addresses to find a Pingable one.
  5. When a connection error occurs, Ping the Pingable one until a connection is received.
  6. When iC3 starts, a connection error will be detected when getting the External ip address from ipify.org (the url that gets the external ip address in the Rest Integration sensor example) or ipinfo.io (a website that has been around for a long time). Use the last external ip address from the configuration file since we had a connection error trying to get the current ip address.

The module that gets the data from iCloud that originally got the connection error will not be used for getting the external ip address and checking to see if the internet is up when iC3 starts so it doesn't get wrapped up in all of that complicated code. Instead, it will be detected from a different module.

The code to get the external_ip is done and the routine to see if it is pingable is done. Next step is to incorporate it into the code to see when the internet comes back up and then test it under various problems.

I'll send it to you as a zip file when ready. You will need to be on v3.2 (just released)

Gary

gcobb321 avatar May 18 '25 17:05 gcobb321