Since upgrade to 0.115.1 the custom_ui component is not working anymore:
2020-09-19 10:01:30 ERROR (MainThread) [homeassistant.setup] Error during setup of component customizer
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/customizer/__init__.py", line 71, in async_setup
add_extra_html_url('/local/custom_ui/state-card-custom-ui')
File "/config/custom_components/customizer/__init__.py", line 63, in add_extra_html_url
frontend.add_extra_html_url(
AttributeError: module 'homeassistant.components.frontend' has no attribute 'add_extra_html_url'
can confirm though it is working quite nicely on 115.1
please be sure you update to the latest version, and do so correctly. I see an error about ‘add_extra_html_url’ which shouldn’t be used as the setup method for some time now.
customizer is no longer part of the correct procedure
(see your error
Hi, what’s this directory that’s mention in the github page? It’s nowhere to be found in my installation. I have a supervised installation on Raspbian.
/local/lovelace/resources/
In hassio ssh, my custom_ui used to be in /config/www/custom_ui.
Is that /local at the same level as /config or is it within /config such as /config/local?
Tx @Mariusthvdb , keep up the good work, can confirm it also works with HACS as Custom repositories, also have made myself addicted to @andrey solution. Thumbs up to both of You.
Not really sure what you’re saying here, but the icon wasn’t a template, and the other stuff is just regular js, where the ‘else’ is never needed in this form of template.
LOL, yeah, I’ll rephrase. Reading it again gave me a seizure, lol
So you’re replacing the else if statements by simply if statements since they are all returning a value, hence ending the if code. The else statement isn’t necessary for the same reason. I’ll give it try.
That’s what I thought you meant. Now I understand you meant something completely different lol. So, you’re saying that in the code I posted earlier, the templates: statement above icon: doesn’t apply to the icon_color statement below it?
well, no, I dont think that’s what I tried to say.
You’re customizing the sensor with a fixed icon, so it shouldn’t be under the 'templates:' key
of course, if you do want a state dependent icon, you’d have to put in under the templates: key . But that’s not what your first post suggested…
but, why don’t you try it, hit reload customizations and see if this is what you need.
There was no point to make. Just to answer why I had templates: before the icon: line.
I did write the code like you mentioned but all the ...energy_apparentpower are still behaving the same way as before. Just to be sure, I rewrote all the lines in customized.yaml like you showed. All other entities within that file aren’t producing any errors.
Those devices are Tasmota devices with power reading learned through MQTT autodiscovery if it matters.
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:61 TypeError: entities['sensor.foyer_powermonitor_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:10 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:12 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
2020-09-25 21:45:12 ERROR (MainThread) [frontend.js.latest.202009180] http://192.168.2.84:8123/local/custom_ui/custom-ui.js line 1533 > Function:3:5 TypeError: entities['sensor.tvcavepower_energy_apparentpower'] is undefined
not sure, but without your actual templates, we can t do much. The error still seems to indicate you have an undefined entity (which is a correct error message, and mostly user error in the template guard). Meaning if it is at all possible the entities you try to customize are not yet available at startup, you need to add a ‘guard’ for that.
Of course it could also be a user error, which most like is the omission of the .state
You could also have a look in the Chrome inspector, which most of the time reveals what’s wrong with the entity you are trying to use.
You say, a startup. Does this mean after that the error goes away, and the customizations works as expected?