Add offline support
Category
- [X] Backend/Integration
- [ ] Frontend
- [ ] Documentation
- [ ] Bot
- [ ] Other
The idea
It would be great to be able to use my HASS instance offline, with components that I already have installed. I see no reason why HACS would not work offline with already installed components. I get it that for downloading and updating internet is needed, but why break the whole instance if running offline? It seems like completely artificial limitation.
Implementation
No idea
Alternatives
Additional context
There was another issue that never got traction and didn't get proper response from the maintainers: https://github.com/hacs/integration/issues/334
Make sure you have read the issue guidelines and that you filled out the entire template.
What does not work?
Sorry, thought it was a well known thing. Basically none of my HACS downloaded components work, I get red squares with error messages inside them:
Custom element doesn't exist: vertical-stack-in-card.
I aslo get a notification error about HACS token not being configured:
The following integrations and platforms could not be set up: hacs
Please check your config.
And lastly these two logs from the system log:
Logger: homeassistant.setup
Source: setup.py:131
First occurred: 4:07:02 PM (1 occurrences)
Last logged: 4:07:02 PM
Setup failed for hacs: Requirements for hacs not found: ['semantic_version==2.8.5'].
Logger: homeassistant.util.package
Source: util/package.py:88
First occurred: 4:07:02 PM (1 occurrences)
Last logged: 4:07:02 PM
Unable to install package semantic_version==2.8.5: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7195fbd850>: Failed to establish a new connection: [Errno -3] Try again')': /simple/semantic-version/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719611e510>: Failed to establish a new connection: [Errno -3] Try again')': /simple/semantic-version/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719601fa90>: Failed to establish a new connection: [Errno -3] Try again')': /simple/semantic-version/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719601ff50>: Failed to establish a new connection: [Errno -3] Try again')': /simple/semantic-version/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719612dd90>: Failed to establish a new connection: [Errno -3] Try again')': /simple/semantic-version/ WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719612de50>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.11/amd64/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719611eb50>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.11/amd64/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f719601f8d0>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.11/amd64/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7195fdde90>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.11/amd64/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7195fdfe10>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.11/amd64/ ERROR: Could not find a version that satisfies the requirement semantic_version==2.8.5 (from versions: none) ERROR: No matching distribution found for semantic_version==2.8.5
Those ONLY happen when internet is out.
Setup failed for hacs: Requirements for hacs not found: ['semantic_version==2.8.5'].
and
The following integrations and platforms could not be set up: hacs
is the reason you see Custom element doesn't exist: vertical-stack-in-card.
HACS is not set up properly, it is missing requirements.
Those are downloaded from the internet the first time you run HACS.
When those requirements exsists, it should not be an issue.
Problem is I've been using the instance for quiet some time now think a few months, it's definitely not the first time running HACS. It's been restarted a few times and works like a charm. Does hacs download the files every time when the system is restarted? Last boot was offline.
HACS does not handle any requirement installations, HA does that.
if it downloads semantic_version every time, you probably have one of these;
- a
/config/depsdirectory with a old version. - another custom component with a conflicting version.
Got it, thank you and sorry for wasting your time in that case. Will check what's wrong.
I re-use that one rather than creating a new ticket as the problem is basically the same. I restarted HA with no internet connection and HACS failed to load:
2020-09-03 11:45:22 INFO (MainThread) [backoff] Backing off call_api(...) for 3.3s (aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.github.com:443 ssl:default [Try again])
2020-09-03 11:45:30 INFO (MainThread) [backoff] Backing off call_api(...) for 5.2s (aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.github.com:443 ssl:default [Try again])
2020-09-03 11:45:41 ERROR (MainThread) [backoff] Giving up call_api(...) after 5 tries (aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.github.com:443 ssl:default [Try again])
2020-09-03 11:45:41 ERROR (MainThread) [custom_components.hacs.custom_components.hacs.remaining_github_calls] Cannot connect to host api.github.com:443 ssl:default [Try again]
2020-09-03 11:45:41 CRITICAL (MainThread) [custom_components.hacs] Your GitHub token is not valid
2020-09-03 11:45:41 WARNING (MainThread) [homeassistant.components.frontend] Removing unknown panel hacs
2020-09-03 11:45:41 INFO (MainThread) [custom_components.hacs] Could not setup HACS, trying again in 15 min
2020-09-03 11:45:41 INFO (MainThread) [homeassistant.setup] Setup of domain hacs took 100.2 seconds
Inconvenience per-se is limited, but the problem is that no frontend custom component installed through HACS, ie the /hacsfiles/... ones, load, then