Closed ghost closed 3 years ago
I'm mistaken. This is a issue with lovelace_gen
Here's a working example. Works in ui-lovelace.yaml, but once moved into its own yaml file it throws a "Unknown error". Doesn't matter what I do or use, once I add the custom:template-entity-row state or secondary code it crashes.
- type: custom:auto-entities
show_empty: true
card:
title: Birthdays
type: entities
show_header_toggle: false
sort:
method: state
numeric: true
filter:
include:
- entity_id: "sensor.anniversary_*"
state: < 120
options:
type: custom:template-entity-row
state: >-
{% if is_state(config.entity, '0') %}
Today
{% elif is_state(config.entity, '1') %}
Tomorrow
{% else %}
{{ states(config.entity) }} Days
{% endif %}
secondary: >-
{% if is_state(config.entity, '0') %}
{{ state_attr(config.entity, 'current_years') }} Years
{% else %}
{{ state_attr(config.entity, 'years_at_next_anniversary') }} Years
{% endif %}
({{ as_timestamp(state_attr(config.entity, 'date')) | timestamp_custom('%d.%m.%Y') }})
I have a really strange issue. I have a new HA install on a Raspberry Pi 4. I've added the latest version of these through HACS:
Configuration (anniversaries):
I then try to filter all of the entities and create the card. My goal is to make a list of birthdays that show a sorted list with the age and birthday.
That gives you something like this:![image](https://user-images.githubusercontent.com/64400812/91075666-b955f300-e63e-11ea-911c-7f582761277f.png)
Then I wanted to use "lovelace-template-entity-row" to override "29 days" to "Today/Tommorrow/29 days" depending on the number of days left and also add a secondary_info saying for example: "35 Years old (01.12.1980)".
However whenever I modify the code to something like this:
and hit "Refresh" in HA I get "Unknown error / Reload UI". Hitting F5 brings the cached and working page back... Any ideas on why I keep getting this error?