kevinblo
(Eugene)
June 22, 2020, 4:08pm
1
Hi, I took this example from a working config, and it gives me an error, but I can’t understand why. Maybe someone will explain where the error is?
I suspect that the error lies in
- type: 'custom:config-template-card'
card:
Because I can’t find card in mini-graph-card module
lovelace:
- id: hassio_status
type: custom:config-template-card
variables:
- states['sensor.current_version'].state
- states['sensor.disk_use_total'].state
- states['sensor.disk_use_home'].state
entities:
- sensor.current_version
- sensor.disk_free_home
- sensor.disk_use_home
card:
type: 'custom:hui-entities-card'
show_header_toggle: off
entities:
- type: section
label: "${ 'NUC --- Debian Buster 10.1 --- HA ' + vars[0] }"
- type: 'custom:config-template-card'
card:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: picture
image: /local/images/devices/nuc_5.png
- type: 'custom:button-card'
layout: icon_name_state2nd
show_icon: true
show_state: true
entity: sensor.nuc_uptime
name: Uptime
icon: 'mdi:clock-outline'
- type: 'custom:bar-card'
title_position: inside
show_icon: true
entity: sensor.disk_use_percent_home
title: "${ 'Disk (' + vars[2] + 'Gb/' + vars[1] + 'Gb)' }"
Error:
No entities defined
type: 'custom:config-template-card'
card:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: picture
image: /local/images/devices/nuc_5.png
- type: 'custom:button-card'
layout: icon_name_state2nd
show_icon: true
show_state: true
entity: sensor.nuc_uptime
name: Uptime
icon: 'mdi:clock-outline'
- type: 'custom:bar-card'
title_position: inside
show_icon: true
entity: sensor.disk_use_percent_home
title: Disk (10.6Gb/19.2Gb)
petro
(Petro)
June 22, 2020, 5:13pm
2
That looks like my old card… almost verbatim.
The error is coming from hui-entities-card. Are you using entities cards in your interface in other areas?
kevinblo
(Eugene)
June 22, 2020, 5:38pm
3
Yes, Petro, it’s your old config I’m trying repeat it for study. But not understanding - why error. I also thought about error in hui. This very old way?
petro
(Petro)
June 22, 2020, 5:44pm
4
There could be a number of reasons why you’re getting the error. Lets start by answering this question
petro
(Petro)
June 22, 2020, 5:48pm
6
Then you need to use the custom preloader card and load the entities card.
kevinblo
(Eugene)
June 22, 2020, 5:51pm
7
this https://github.com/gadgetchnnel/lovelace-card-preloader/ ?
In start of ui-lovelace:
preload_cards:
- horizontal-stack
- vertical-stack
- entities
- markdown
preload_rows:
- sensor-entity
petro
(Petro)
June 22, 2020, 5:52pm
8
yep, you need to preload entities card if you use custom:hui-entities-card
kevinblo
(Eugene)
June 22, 2020, 5:55pm
9
Now, try to understand, how do it
kevinblo
(Eugene)
June 22, 2020, 6:26pm
10
Does not work. preload_cars ignored all ‘custom:’ strings
preload_cards:
- horizontal-stack
- vertical-stack
- entities
- markdown
- custom:hui-entities-card
- custom:mini-graph-card
- custom:config-template-card
Preloaded card horizontal-stack lovelace-card-preloader.js?v=0.0.4:1
Preloaded card vertical-stack lovelace-card-preloader.js?v=0.0.4:1
Preloaded card entities lovelace-card-preloader.js?v=0.0.4:1
Preloaded card markdown bar-card.js?v=3.1.6:4825
BAR-CARD Version 3.1.6
lovelace-card-preloader.js?v=0.0.4:1 Uncaught (in promise) TypeError: this.console_error is not a function
at console.window.console.error (lovelace-card-preloader.js?v=0.0.4:1)
at s (chunk.6dbb65acb727c33dd251.js:2144)
at chunk.6dbb65acb727c33dd251.js:2144
at l (chunk.6dbb65acb727c33dd251.js:2144)
at Object.Ut [as createCardElement] (chunk.6dbb65acb727c33dd251.js:2144)
at Object.preloadElement (lovelace-card-preloader.js?v=0.0.4:1)
at lovelace-card-preloader.js?v=0.0.4:1
at Array.forEach (<anonymous>)
at lovelace-card-preloader.js?v=0.0.4:1
petro
(Petro)
June 22, 2020, 6:30pm
11
hui-entities-card is entities. You don’t need to include the custom cards.
kevinblo
(Eugene)
June 22, 2020, 6:40pm
12
Sorry, Petro, but I don’t understanding what I needs to do…
kevinblo
(Eugene)
June 22, 2020, 6:46pm
14
Yes, I did this already. I do not understanding what should i do to make it work
petro
(Petro)
June 22, 2020, 6:51pm
15
Is there a new error? You’re not giving me any information other than what you are trying…
kevinblo
(Eugene)
June 22, 2020, 6:54pm
16
No, errors the same. But preload is works
No entities defined
type: 'custom:config-template-card'
card:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: picture
image: /local/images/devices/nuc_5.png
- type: 'custom:button-card'
layout: icon_name_state2nd
show_icon: true
show_state: true
entity: sensor.nuc_uptime
name: Uptime
icon: 'mdi:clock-outline'
- type: 'custom:bar-card'
title_position: inside
show_icon: true
entity: sensor.disk_use_percent_home
title: Disk (10.7Gb/19.3Gb)
Preloaded card horizontal-stack
lovelace-card-preloader.js?v=0.0.4:1
Preloaded card vertical-stack
lovelace-card-preloader.js?v=0.0.4:1
Preloaded card entities
lovelace-card-preloader.js?v=0.0.4:1
Preloaded card markdown
lovelace-card-preloader.js?v=0.0.4:1
Preloaded row sensor-entity
petro
(Petro)
June 22, 2020, 8:54pm
17
Are there errors in the logs? What about in chrome dev tools?
kevinblo
(Eugene)
June 22, 2020, 9:23pm
18
No in log errors, only on screen and dev tools. On screen like 1st message, dev tools below
chunk.6dbb65acb727c33dd251.js:2144 config-template-card Error: No entities defined
at HTMLElement.setConfig (config-template-card.js?v=1.2.0:3127)
at s (chunk.6dbb65acb727c33dd251.js:2144)
at chunk.6dbb65acb727c33dd251.js:2144
at l (chunk.6dbb65acb727c33dd251.js:2144)
at Te (chunk.6dbb65acb727c33dd251.js:2450)
at HTMLElement.value (chunk.6dbb65acb727c33dd251.js:1257)
at HTMLElement.e.renderEntity (card-mod.js?v=2:1)
at chunk.6dbb65acb727c33dd251.js:1191
at Array.map (<anonymous>)
at HTMLElement.value (chunk.6dbb65acb727c33dd251.js:1191)
petro
(Petro)
June 22, 2020, 9:29pm
19
do these entities exist on your system?
kevinblo
(Eugene)
June 22, 2020, 9:33pm
20
Yes, and shows right values.
Card show right before
- type: 'custom:config-template-card'
I see in header on card:
NUC --- Debian Buster 10.1 --- HA 0.111.2
and then error:
No entities defined
type: 'custom:config-template-card'
card:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: picture
image: /local/images/devices/nuc_5.png
- type: 'custom:button-card'
layout: icon_name_state2nd
show_icon: true
show_state: true
entity: sensor.nuc_uptime
name: Uptime
icon: 'mdi:clock-outline'
- type: 'custom:bar-card'
title_position: inside
show_icon: true
entity: sensor.disk_use_percent_home
title: Disk (11.8Gb/19.2Gb)