custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.97k stars 242 forks source link

after use browser_mod,use entity_picture error #869

Open flamestsui opened 2 months ago

flamestsui commented 2 months ago

Checklist

Describe the bug ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'if (entity.state == "on") return "/local/house/samba.png"; else return "/local/house/samba_clo...' Ti.eval (/hacsfiles/button-card/button-card.js:434:2161) Ti._evalTemplate (/hacsfiles/button-card/button-card.js:434:2257) Ti._getTemplateOrValue (/hacsfiles/button-card/button-card.js:434:2877) /hacsfiles/button-card/button-card.js:559:2699 l (/hacsfiles/button-card/button-card.js:559:2641) /hacsfiles/button-card/button-card.js:559:2681 l (/hacsfiles/button-card/button-card.js:559:2641) /hacsfiles/button-card/button-card.js:559:2681

Version of the card Version: 4.1.2

To Reproduce This is the configuration I used:

See Attachment

button.txt Screenshots If applicable, add screenshots to help explain your problem.

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

dkirby-ms commented 2 months ago

I've got a similar issue with button card that started after the September HA update.

Homeboy05 commented 2 months ago

Same here

riegera2412 commented 2 months ago

Same here!

Just updated to 2024.9.1 from 2024.8.3 yesterday. After that the card wasnt loaded on either browser or the companion app. A google search and older issues here seem to link this to the availability of the hass object. In the issues I found here it seems that it requires some changes in the depths of button-card. Unfortunately I am not much of a programming guy who could do that.

Would really appreciate any insight that might help.

Beste regards, André