Closed kaizersoje closed 4 months ago
If you really want to find out a reason of your issue - try to at least localize it. Posting a code with a complex logic and things not related to the issue does not help nether you nor other users who may help.
Well, here is just one entity that I have isolated from the entities above.
type: entities
entities:
- type: custom:template-entity-row
icon: mdi:weather-windy
name: 'Beaufort scale: {{ states(''sensor.beaufort'') }}'
state: '{{ state_attr(''sensor.beaufort'',''description'') }}'
I have the same issue wherever I use custom:template-entity-row and have the “icon: mdi:…” mentioned Same issue with custom:fold-entity-row
- type: custom:template-entity-row
icon: mdi:currency-eur
name: Gekochte Electriciteit
state: '{{ (states(''sensor.electriciteit_gekocht''))|float|round(1) }} kWh'
tap_action:
action: none
Same here.
When I'm using 'custom:template-entity-row' the icon is not displayed. Doesn't seem to matter if I set an icon or not - It's blank regardless.
Comparing to a regular entity, instead of this custom type:
entity: sensor.electrical_daily_usage
An icon lives inside it
type: custom:template-entity-row
Blank. Just shadowroot
you can easily fix it by changing line 8 in template-entity-row.js from: .stateObj=${s}
to this .stateObj=${this.hass.states[this.config.entity]}
Im not sure why author did this weird parse json thingy inside. Generally if you don't specify entity in configuration then icon will disappear (despite if you specified it in icon prop)
Ps. remember to remove template-entity-row.js.gz after changing template-entity-row.js on your local setup, and refresh cache ;)
@michalolborski ; Worked. Thank you!
@thomasloven, could you kindly check this PR: https://github.com/thomasloven/lovelace-template-entity-row/pull/101, I believe I fixed this issue and also: https://github.com/thomasloven/lovelace-template-entity-row/issues/95 and https://github.com/thomasloven/lovelace-template-entity-row/issues/94
Confirmed - an icon is NOT displayed if no entity is defined:
type: custom:template-entity-row
state: yyy
name: xxx
icon: mdi:car
The issue seems to be resolved in the latest update. Thank you , @thomasloven
May be closed imho
Thanks!
I have noticed that after upgrading to 2023.2.x icons are not being displayed or formatted as before.
This is how it looks.