Slack stops working randomly and home assistant needs restarting for it to work again

I have slack set up to notify that home assistant is alive every day at 9am:


After a seemingly random amount of time, the connection between home assistant and slack will be lost and it will never recover unless I restart home assistant. Sometimes it will last 2 or 3 days and others 11 days until eventually the issue repeats.

I’ve had a look at the logs, but I don’t really know what is causing the issue. It connects first time, every time on a restart, so I assume everything configuration side is fine.

# cat home-assistant.log | grep "slack"
2020-03-26 01:18:06 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform slack
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='slack.com', port=443): Max retries exceeded with url: /api/auth.test?token={REMOVED FOR PRIVACY}(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x72b9a490>: Failed to establish a new connection: [Errno -3] Try again'))
  File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 57, in get_service
  File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 82, in __init__
    self.slack.auth.test()
  File "/usr/local/lib/python3.7/site-packages/slacker/__init__.py", line 140, in test
  File "/usr/local/lib/python3.7/site-packages/slacker/__init__.py", line 120, in get
  File "/usr/local/lib/python3.7/site-packages/slacker/__init__.py", line 96, in _request
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='slack.com', port=443): Max retries exceeded with url: /api/auth.test?token={REMOVED FOR PRIVACY} (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x72b9a490>: Failed to establish a new connection: [Errno -3] Try again'))
2020-03-26 01:18:07 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.home_assistant_start. Service not found for call_serviceat pos 1: Unable to find service notify/slack
2020-03-27 01:00:00 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.home_assistant_alive. Service not found for call_serviceat pos 1: Unable to find service notify/slack