home-assistant-sun-card
home-assistant-sun-card copied to clipboard
Manual installation steps clarifications
I tried following the manual installation steps from the README.md, but I'm getting custom:sun-card
can't be found. I've got some questions about the installation steps.
I'm using a 'supervised' install, so the HA configuration directory is /usr/share/hassio/homeassistant
. I created www
and put the latest release of home-assistant-sun-card.js
in that directory. So it's full path on the host is
/usr/share/hassio/homeassistant/www/home-assistant-sun-card.js
From README.md
Add /local/community/home-assistant-sun-card.js to the URL
Should community
be part of the URL if HACS isn't being used?
By 'Add .. to the URL', do you mean to just add only that to the URL field, or do I need to put the base URL for hass and /local/...
in the URL field for the resource?
Is a Home Assistant restart required after adding the custom component?
Should I be able to access http://<hass-hostname>:8123/local/home-assistant-sun-card.js
via the browser? I'm getting a 404 for that. (If I understand things correctly, config/www
on the host should map to baseurl/local
.)
Thanks for opening the issue! I just saw that I wrote configuration/www
instead config/www
, can you confirm that putting it inside config/www
mades it accesible from the browser through baseUrl/local
?
(disclaimer - this is the first time I've tried to use a custom card.)
Thanks for opening the issue! I just saw that I wrote configuration/www instead config/www, can you confirm that putting it inside config/www mades it accesible from the browser through baseUrl/local?
This is an area where the home assistant documentation leaves a lot to be desired.
Note: The name of the configuration folder varies both by install type and were you happen to be observing it from. It looks like in many HA documentation cases "config" is a placeholder to indicate where your configuration files are.
When looking from outside the HA container (on the host system) on certain types of installs (like supervised [docker on Linux]), /config/www
is accessed via /usr/share/hassio/homeassistant/www
. If one uses the web terminal/ssh that puts you inside a container, the path to those files is /config/www
.
can you confirm that putting it inside config/www mades it accesible from the browser through baseUrl/local?
It looks like by default, there is no www
folder. The user needs to create it when adding the first custom card or whatever.
The theory I have now, is that after creating www
Home Assistant will need to be restarted before /local/
is accessible. Testing that theory now.
The clue is that baseUrl/local/ is returning a 404 instead of a 403. (This could be a troubleshooting step.)
After restarting baseUrl/local/
returns 403 and baseUrl/local/home-assistant-sun-card.js
returns the .js
file.
Ok, I've got it working now and it looks great~ Thanks for creating this!
Documentation fixes for manual install
- remove /community/ from URL,
- add note about possibly needing to create
www
folder - clarify use/location for
config
directory.
Manual install
Manually
- Download the
home-assistant-sun-card.js
file from the latest release available and save it in thewww
folder where your Home Assistant configuration files are located.- Typically this will be
config/www
but is installation specific. - The
www
folder may need to be created if you haven't used any other custom UI components. It does not exist in a default install. If you createwww
, you must restart Home Assistant before using Sun Card. - See notes below.
- Typically this will be
- Go to Configuration > Lovelace dashboard > Resources in Home Assistant and click on Add resource.
- In the URL field, enter
/local/home-assistant-sun-card.js
- Choose Javascript Module as Resource type.
- In the URL field, enter
Notes
- The location for Home Assistant configuration files depends both on what type of installation you are using and how you are accessing them (via web terminal/ssh, host system files, or file sharing). Possible locations:
-
/config
-
/usr/share/hassio/homeassistant
-
/home/homeassistant/.homeassistant
-
- The files in
<config-dir>/www/*
are accessed ashttp://<home assistant host>:8123/local/*
. - After putting
home-assistant-sun-card.js
in yourconfig/www
folder you should be able to see the JavaScript file viahttp://<home assistant host>:8123/local/home-assistant-sun-card.js
- Troubleshooting, try to access
http://<home assistant host>:8123/local/
. You should get a403: Forbidden
. If you get a404: Not found
instead, you need to restart Home Assistant after creating thewww
directory.
Somehow the ''automatic instalation'' did not work, even when refreshing and clearing cache of chrome, I did the manual instal guide and now the card is show. But in Configuration > Lovelace dashboard > Resources I now have two lines
- /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js ( installed by the auto instal )
- /local/home-assistant-sun-card.js ( the manual instal one )
Somehow the ''automatic instalation'' did not work, even when refreshing and clearing cache of chrome, I did the manual instal guide and now the card is show. But in Configuration > Lovelace dashboard > Resources I now have two lines
- /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js ( installed by the auto instal )
- /local/home-assistant-sun-card.js ( the manual instal one )
Have you faced any other issue with any other HACS card or only this one?
Sorry for the delayed reply, your card is the first I ever install into HA, so no idea if it was a HACS card issue or only this one
I have the same issue @Aresitoo had, it's my very first card I try to install and the path where HACS searches the component is /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js
but actually it is in the path
/config/www/community/home-assistant-sun-card/home-assistant-sun-card.js
@rct 's suggestion here saved me. I now have this up and running. Definitely need to incorporate his notes. In particular in my case it was the suggestion that ha needs to be restarted.