Open Spirituss opened 2 years ago
Experiencing the same issue
@RomRider It would be great to fix the component. I widely use it and now it becomes almost non-working.
Any error in the javascript console?
As a side note, personally I have issues with all the cards which load other custom card. Something changed (again) in HA probably and it's hard to track down the reason...
As a side note, personally I have issues with all the cards which load other custom card. Something changed (again) in HA probably and it's hard to track down the reason...
auto-entities.js:210 ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'if (entity.state == 'Backed up') return 'var(--lovelace-good-color)';
else return 'var(--lovela...'
at Je.eval (eval at _evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9295), <anonymous>:4:14)
at Je._evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9379)
at Je._getTemplateOrValue (:8719/hacsfiles/button-card/button-card.js:425:9964)
at :8719/hacsfiles/button-card/button-card.js:425:12361
at Array.forEach (<anonymous>)
at Je._buildStyleGeneric (:8719/hacsfiles/button-card/button-card.js:425:12338)
at Je._getIconHtml (:8719/hacsfiles/button-card/button-card.js:519:143)
at Je._gridHtml (:8719/hacsfiles/button-card/button-card.js:499:511)
at Je._buttonContent (:8719/hacsfiles/button-card/button-card.js:499:433)
at Je._cardHtml (:8719/hacsfiles/button-card/button-card.js:479:18)
console.error @ auto-entities.js:210
auto-entities.js:210 ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'if (states['sensor.gdrive_backup_state'].state == 'Backed up') return 'var(--lovelace-good-color)'...'
at Je.eval (eval at _evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9295), <anonymous>:4:44)
at Je._evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9379)
at Je._getTemplateOrValue (:8719/hacsfiles/button-card/button-card.js:425:9964)
at :8719/hacsfiles/button-card/button-card.js:425:12361
at Array.forEach (<anonymous>)
at Je._buildStyleGeneric (:8719/hacsfiles/button-card/button-card.js:425:12338)
at Je._getIconHtml (:8719/hacsfiles/button-card/button-card.js:519:143)
at Je._gridHtml (:8719/hacsfiles/button-card/button-card.js:499:511)
at Je._buttonContent (:8719/hacsfiles/button-card/button-card.js:499:433)
at Je._cardHtml (:8719/hacsfiles/button-card/button-card.js:479:18)
console.error @ auto-entities.js:210
auto-entities.js:210 ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'if (entity.state > 0) return 'var(--lovelace-bad-color)';
if (entity.state == 0) return 'var(--...'
at Je.eval (eval at _evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9295), <anonymous>:4:14)
at Je._evalTemplate (:8719/hacsfiles/button-card/button-card.js:425:9379)
at Je._getTemplateOrValue (:8719/hacsfiles/button-card/button-card.js:425:9964)
at :8719/hacsfiles/button-card/button-card.js:425:12361
at Array.forEach (<anonymous>)
at Je._buildStyleGeneric (:8719/hacsfiles/button-card/button-card.js:425:12338)
at Je._getIconHtml (:8719/hacsfiles/button-card/button-card.js:519:143)
at Je._gridHtml (:8719/hacsfiles/button-card/button-card.js:499:511)
at Je._buttonContent (:8719/hacsfiles/button-card/button-card.js:499:433)
at Je._cardHtml (:8719/hacsfiles/button-card/button-card.js:479:18)
Seems like some of your JStemplates have issues (but this is for cards inside an auto-entities card):
if (entity && entity.state == 0)
instead of what you have.
Make sure your js templates are rock solid else this is also what can happen.
I'm going to check if I can reproduce in parallel.
Seems like some of your JStemplates have issues (but this is for cards inside an auto-entities card):
if (entity && entity.state == 0)
instead of what you have.Make sure your js templates are rock solid else this is also what can happen.
I'm going to check if I can reproduce in parallel.
I've checked, this message was not connected with the issue. Still is the case.
I've been experiencing this too and just put it down to a caching issue because sometimes a forced refresh works, also, having developer tools open and disabling the cache sometimes seems to work.
This also seems to manifest itself in the Card Configuration
window in Lovelace.
Anyway to help me see if the card just wasn't building I added a background colour to the stack-in-card
just to be safe. Here's what I have found so far...
button-card
elements the config for the card looks like this...So at first glance all the card info looks to be there, it just isn't rendering.
Hope that helps to track it down.
I see all of you hace stack-in-card as a parent. Could you remove it temporarily and see if that still happens? Might be related to stack-in-card
It's funny you mention that... I tested earlier today using horizontal-stack
instead and haven't had an issue yet. Was going to give it until tomorrow before posting back.
I also found that there is no issue inside horizontal-stack. But it does matter inside vertical-stack, custom: vertical-stack-in-card, custom: stack-in-card inside layout-card.
@RomRider Guys, any news here?
I have the same problem when trying to use it with the else
card in the auto-entities
card. It works fine if I wrap it inside a horizontal stack, it does not work if I wrap it in a vertical stack.
Checklist
Describe the bug Button cards inside conditional card/layout-card/custom:stack-in-card often doesn't appear on the screen. The places where it should be are just clear. Sometimes after page hard refresh (shift-F5) it appears again but not always. Such symptoms started from HA 2021.12, earlier it works fine for more than a year.
Version of the card Version: 3.4.2
To Reproduce This is the configuration I used: lovelace yaml:
Screenshots If applicable, add screenshots to help explain your problem. It works often like this:![Screen Shot 2022-02-01 at 15 44 09](https://user-images.githubusercontent.com/47206760/151976177-c3fce389-d53e-45e5-91be-d22216bbef89.jpg)
Expected behavior A clear and concise description of what you expected to happen. But should work like this:
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.