Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card not available for setup in Dashboard #6

Closed
screenagerbe opened this issue Aug 8, 2023 · 12 comments · Fixed by #7
Closed

Card not available for setup in Dashboard #6

screenagerbe opened this issue Aug 8, 2023 · 12 comments · Fixed by #7

Comments

@screenagerbe
Copy link

Version of the custom_component

v1.0.0
HA 2023.8.1 (did not work on 2023.7.x)

Configuration

Installed it through HACS as described in the README

Describe the bug

The integration is installed via HACS without errors, but the card is just not available when trying to add a new card to any dashboard. I don't see the card, and I don't have a pop-up asking which inverter to add.

Debug log

There is nothing 🤷‍♂️

@screenagerbe
Copy link
Author

FYI,
I managed to configure it once on a dev device running HAOS, but now it says
image

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

Does /config/www/foxess-modbus-charge-period-card.js exist?

Did you click the button to reload the UI when prompted by hacs?

@screenagerbe
Copy link
Author

No not really.
Unless you mean /config/www/community/foxess-modbus-charge-period-card/foxess-modbus-charge-period-card.js

yes HA was reloaded, restarted and has even been updated too

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

If you navigate to HACS on the sidebar, do you see this message?

https://hacs.xyz/docs/faq/status_not_loaded/

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

(I managed to reproduce what I think is the issue you're seeing, and saw that message. Going to the 3 dots -> redownload fixed it)

@screenagerbe
Copy link
Author

Everything looks OK in HACS, I don't see the "not loaded error", seen it before in other integrations, never in this though.
I have redownloaded the integration several times, to no avail

I have currently 3 HA systems running, and all three of them are having issues with the integration. As other users do not encounter these issues I'm starting to think it might have something to do with my FoxESS - Modbus setup

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

I'm starting to think it might have something to do with my FoxESS - Modbus setup

No, the card is entirely independent of foxess-modbus, up to the point where it's up and running and tries to read your charge periods.

Are you using a custom ui-lovelace.yaml file by any chance?

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

Are you able to install (and use) any other lovelace cards through HACS?

Do you get any errors in the Console of your browser's developer tools when trying to add the charge period card to a dashboard?

@screenagerbe
Copy link
Author

Ok, that last tip gave it away
It looks like you're side loading js from an external domain?
image

Once I allowed unpkg.com in NoScript it started working.
Not sure if I like this setup though, because the side loaded js needs to be enabled to have a usable card at all, not only for configuration 🤔🤨

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

My options are basically:

  1. Have a single vanilla JS file in the repo, which imports Lit from unpkg (which is what the hass docs do)
  2. Set up a whole JS packaging pipeline which bundles together Lit and this card, and commit the minified results to the repo (because HACS can't handle loading custom cards from release artifacts)

I wouldn't call it sideloading: loading a common library from a CDN is fairly standard practice (although admittedly it's less in fashion today than it was a few years ago)

@screenagerbe
Copy link
Author

It still is a fairly common practice on websites, but I'm using NoScript for a reason 😅
It also means it'll stop working once your internet connection goes down (and you refresh your browser).

I can always clone this repo and add the whole JS packaging. Need to think about that one. 😏

@canton7
Copy link
Collaborator

canton7 commented Aug 8, 2023

Looks like HACS does support using release assets, so I'll get this change in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants