Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Can't figure out what's going wrong with my template, CPU usage spikes when I put it into lovelace.
Post Body

As the title says usage spikes to 100% after I try putting it into a markdown card and I'm getting flooded with the following error message which looks to reference another markdown card. Each individual component seems to work though.

Here's the error

2020-05-22 13:11:54 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140097946640080] Error handling message: invalid template (TemplateSyntaxError: unexpected '%') for dictionary value @ data['template']. Got "{{ {% if as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%d') }} |int==now().day and\n{{ as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%m') }} |int==now().month %}\n              Today at: {{ as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%-I:%M %p') }}\n            {% else %}\n              Last Ran: {{ as_timestamp(state_attr('automation.vacuum_start', 'last_triggered')) |timestamp_custom('%b %d %-I:%M %p') }}\n ...

and here's my template code.

{% if as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%d') |int==now().day and
   as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%m') |int==now().month %}
Today at: {{ as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%-I:%M %p') }}
{% elif as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%d') |int-1==now().day and
 as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%m') |int==now().month %}
Tommorow at: {{ as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%-I:%M %p') }}
{% else %}
{ as_timestamp(state_attr('calendar.va', 'start_time')) |timestamp_custom('%b %d at %-I:%M %p') }}
{% endif %}

and the other markdown template code.

{% if as_timestamp(state_attr('automation.vacuum_start', 'last_triggered')) |timestamp_custom('%d') |int==now().day and
as_timestamp(state_attr('automation.vacuum_start', 'last_triggered')) |timestamp_custom('%m') |int==now().month %}
              Last Ran: Today at {{ as_timestamp(state_attr('automation.vacuum_start', 'last_triggered')) |timestamp_custom('%-I:%M %p') }}
            {% else %}
              Last Ran: {{ as_timestamp(state_attr('automation.vacuum_start', 'last_triggered')) |timestamp_custom('%b %d %-I:%M %p') }}
            {% endif %}

Author
Account Strength
100%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
5,840
Link Karma
95
Comment Karma
5,617
Profile updated: 1 day ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago