GithubHelp home page GithubHelp logo

Comments (7)

AitorDB avatar AitorDB commented on May 31, 2024

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?

from home-assistant-sun-card.

rct avatar rct commented on May 31, 2024

(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

  1. remove /community/ from URL,
  2. add note about possibly needing to create www folder
  3. clarify use/location for config directory.

Manual install

Manually

  1. Download the home-assistant-sun-card.js file from the latest release available and save it in the www 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 create www, you must restart Home Assistant before using Sun Card.
    • See notes below.
  2. Go to Configuration > Lovelace dashboard > Resources in Home Assistant and click on Add resource.
    1. In the URL field, enter /local/home-assistant-sun-card.js
    2. Choose Javascript Module as Resource type.

Notes

  1. 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
  2. The files in <config-dir>/www/* are accessed as http://<home assistant host>:8123/local/*.
  3. After putting home-assistant-sun-card.js in your config/www folder you should be able to see the JavaScript file via http://<home assistant host>:8123/local/home-assistant-sun-card.js
  4. Troubleshooting, try to access http://<home assistant host>:8123/local/. You should get a 403: Forbidden. If you get a 404: Not found instead, you need to restart Home Assistant after creating the www directory.

from home-assistant-sun-card.

Aresitoo avatar Aresitoo commented on May 31, 2024

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 )

from home-assistant-sun-card.

AitorDB avatar AitorDB commented on May 31, 2024

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?

from home-assistant-sun-card.

Aresitoo avatar Aresitoo commented on May 31, 2024

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

from home-assistant-sun-card.

A7F avatar A7F commented on May 31, 2024

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

from home-assistant-sun-card.

patrickcollins12 avatar patrickcollins12 commented on May 31, 2024

@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.

from home-assistant-sun-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.