just having that one will not work. it seems to be /www/button-card.js and then /local/button-card.js which is the one that makes it work.
How did you install the cards? By default hacs installs the cards to this location:
\www\community\button-card\button-card.js
which maps to
\local\community\button-card\button-card.js
if you have your file in
\www\button-card.js
then you’d use
\local\button-card.js
but that means you didn’t install through hacs.
Well thats the strange thing of this issue indeed. I installed it through hacs. Which indeed puts the files in /www/community/button-card But if I then add the resource /hacsfiles/button-card/button-card.js
and/or /local/community/button-card/button-card.js
it just wont work. It works fine in a normal browser but not on the Google Hub with a cast.
If I however copy the button-card.js to the root /www folder and then add /local/button-card.js as resource it does work in both a normal browser and on the Google Hub.
that seems like a caching issue then, which means this question i asked earlier will help
Once you know the device name, google the device name & reset cache
Its the Google Nest Hub Google Nest Hub Review | PCMag
Afaik there is no way to reset the cache. You can factory reset the device, which would be a bit overkill. I can also reboot the device using the google Home app. I assume/hope that a reboot cleans the cache.
I don’t have the device, but does this look like your UI?
Thanks for searching, but unfortunately no, that’s not the interface.
The device is quite limited in changing any setting on the Google Nest Hub itself. All is done through the app. But there is no option to clean the cache.
Unfortunately I just wanted to add a 2nd custom card to my dashboard and rebooted the Google Nest Hub again. Only to see that the button-card is now not working again …
So I guess it does seem to be a cache issue, but its an issue with the Google Nest Hub, so probably not something that can be fixed in HA.
Well, you know the correct community path, and you have 3 options for making it work, all 3 are the same location. at a minimum, the 2nd one should work for everything.
\hacsfiles\button-card/button-card.js
\local\community\button-card\button-card.js
\www\community\button-card\button-card.js
adding a ? to them usually forces the browsers to reload every time. It’ll be a little slower.
\hacsfiles\button-card/button-card.js?
\local\community\button-card\button-card.js?
\www\community\button-card\button-card.js?
I think the browser in the Google Nest Hub does not really follow the standards very well. I had tried the “?” at the end in the past, but it does not change anything.
I think I am just stuck with the standard cards.
Would you know why the standard cards work without any issue? Why does that not have the cache issue that I have with custom cards.
The cache issues you are seeing are self inflicted. the built in cards have the correct resources layed out from the beginning. Custom cards do not if you put them in wrong. You trying all these random urls are what is causing the problems. Just using the correct url the first time through and you wouldn’t have the issue. Hence why I keep hammering the “Keep it one of these urls and it should work with the safest route being # 2”
I think its more something in the Google Nest Hub.
Because the button-card worked fine at first. Then I added a second custom card to the dashboard, without changing anything to the button-card. But on a reboot of the Google Nest Hub, it cant find the button-card.js anymore.
but if you’re pointing to the wrong resource location… It’s not going to work and it’s going to hold that location until it’s cleared.
Hi, I have the same problem… the custom card did work but now it stoped working with the same error… have tried the resources fix but nothing…is working…
normal cards works and all custom cards works in the browser on the PC.
I totally gave up on any custom components. They just won’t work with google cast. I think it has to do with the cache of the google hub, so not much probably that can be done about it.
Ok, the thing is that i had it working but it just stoped to do so.,.
Any progress with this?
I’m noticing that card-mod and browser-mod both don’t work when I cast to my Nest Hub 2. I’ve added the HTTP CORS section and also added the resources: section to my YAML for browser-mod its instructions.
But still, neither of them work. I’m not really sure what the issue is…
Also button-card seems to be working just fine for me. It’s the associated browser-mod/card-mod stuff in my dashboard that isn’t working (so no popups, etc).
Any news about this?
I’m having the same issue and it’s quite annoying.
Any news about this?
You can just use CATT again. The Cast will no longer be removed after 10 minutes. CATT also gives you way more control. More info here: Using CATT - Configuration - Home Assistant Community (home-assistant.io)
I don’t know if this will help others here, but I was using card-mod and noticed that my custom styling didn’t get picked up unless I manually made changes while the dashboard was live, which forced a refresh.
I’m pretty sure it’s a caching/ordering issue on the Nest Hub side, but I got around it by first casting a custom empty dashboard to force the dependencies to load, then immediately cast the thing I intended, and the custom styling does seem to get loaded. I haven’t tested it rigorously enough to know that I’m not still getting lucky from cache hits, but it seems promising.
Here’s the empty dashboard I cache first to ensure that the Nest Hub browser has all the dependencies cached first, then I cache my real dashboard immediately after.
views:
- title: Home
cards:
- type: markdown
content: <!-- comment -->
card_mod: |
.ignore { }
type: panel
I tested it by rebooting the hub to get clean caches, then manually invoking the service twice. Both dashboards are single-panel for simplicity:
service: cast.show_lovelace_view
data:
entity_id: media_player.kitchen_display
dashboard_path: empty-dashboard
view_path: "0"
service: cast.show_lovelace_view
data:
entity_id: media_player.kitchen_display
dashboard_path: mycustom-dashboard
view_path: "0"
I’m curious - does this trick end up working reliably for anyone else?