New error for state-card-custom-ui

@andrey

updated to 0.67.1 and now my entities that use custom icons in my www folder aren’t displaying on the frontend.

here is the error:

2018-04-28 16:58:34 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:58:34 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:58:37 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:58:37 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:58:45 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:58:45 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:59:16 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-28 16:59:16 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:10041 Uncaught TypeError: Cannot read property 'state' of undefined

all of the entities are customized to use a local .png file as the icon.

i have already updated the andrey-git files to version 20180427 and cleared the browser cache.

i’ve still not got those entities displayed. everything else that uses customizations seem to be working.

here is the customize section for the entities:

switch.master_bedroom_fan_low:
  entity_picture: /local/my-fan-small.png
switch.master_bedroom_fan_medium:
  entity_picture: /local/my-fan-medium.png
switch.master_bedroom_fan_high:
  entity_picture: /local/fan-large.png

the entities still exist in the states display.

anything in this update i’m missing?

That is not a custom_ui issue. You are not adding any custom_ui elements in your config. If the images are still there, it is a browser cache issue.

:10041 doesn’t seem to match the latest version.

If you use customizer try to use debug instead of local.
If you don’t - try to load https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui-dbg.html

I was going by the fact that the error specifically referenced the custom-ui. I’ve applied the cusom-ui to everything in config yaml using a customize_glob entry:

customize_glob:
  "*.*":
    custom_ui_state_card: state-card-custom-ui

i’m not really sure how that affects things i haven’t specifically defined any elements for tho.

I’ve cleared the cache several times. It also displays that way on all my devices, all refreshed. the picture files still exist in the same location.

i do have one other customized entity_picture that still works (for a garage door display animated using a template).

all of the entities that won’t display are created using the broadlink component.

However, I still have some broadlink switches that are still displayed (but don’t use “entity_picture” just a straight mdi icon also defined in the customize section) so i don’t think the problem is there.

yes, sorry the error snippet was from before i updated to the latest version.

here is the current error:

2018-04-29 15:00:52 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:11656 Uncaught TypeError: Cannot read property 'state' of undefined

And I again apologize but I’m not sure what you mean by loading the referenced html (I don’t use the customizer). where do i load it?

Ok…

I’ve added the customizer to the config yaml:

customizer:
  custom_ui: debug

and i have the customizer directory in the right place:

ex

I’ve restarted HA and cleared the cache again.

and I’m still having the same issue.

2018-04-29 15:54:05 ERROR (MainThread) [frontend.js.latest.201804040] https://xxxx.duckdns.org/local/custom_ui/state-card-custom-ui.html:1:11656 Uncaught TypeError: Cannot read property 'state' of undefined

how do I know which version of custom-ui is running?

Remove extra_html_url (and extra_html_url_es5) lines from the config, as now

customizer:
  custom_ui: debug

is taking care of that.

Also make sure you are on latest 2018-04-29 version of CustomUI

removed those two lines from config and updated to the newest verson:

ex2

ex

restarted HA & cleared cache.

still the same error and those entities are still not displayed.

2018-04-29 16:44:22 ERROR (MainThread) [frontend.js.latest.201804040] https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui-dbg.html:601:7 Uncaught TypeError: Cannot read property 'state' of undefined
2018-04-29 16:44:22 ERROR (MainThread) [frontend.js.latest.201804040] https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui-dbg.html:601:7 Uncaught TypeError: Cannot read property 'state' of undefined

The error is reported from one of your JS templates.
Please list them here.
I’ll improve the error reporting in the next version.

OK…

Apparently the issues I was seeing were caused by two things that happened coincidentally…

I had removed an android IP camera that I was using that used an extra_data_template for the battery state. I assume that since the camera didn’t exist the custom-ui couldn’t read the state and then threw the error. Getting rid of the camera in the config got rid of the error but I still didn’t have the entities displayed in the frontend.

AND!!!..

Somehow the update to 0.67.1 caused the broadlink component to stop using the friendly name as the entity id and instead use the name that was used to create the entity in the component. The ones that broke were so close (they ended in a number when created but not in the friendly name) that I didn’t notice they were different until I looked at them several times. Then I realized the differences.

There was a note about a breaking change in the release note for 0.67.1 but it was worded very vaguely and, when I read it, didn’t seem to apply to me. And following the link to the broadlink docs didn’t help clarify the breaking change either. Now knowing the issue and going back to re-read it I can kind of see the connection.

neither had anything to do with the other. they just happened at the same time and led me (and, hence, us…) on a wild goose chase.

Thanks for the help. At least it gave you the idea for an improvement! :grinning: