Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card visibility breaks with template condition #21287

Closed
3 of 4 tasks
johanneswuerbach opened this issue Jul 4, 2024 · 1 comment
Closed
3 of 4 tasks

Card visibility breaks with template condition #21287

johanneswuerbach opened this issue Jul 4, 2024 · 1 comment

Comments

@johanneswuerbach
Copy link

johanneswuerbach commented Jul 4, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I'm trying to conditionally display a card when the last input date time has surpassed a certain age and while the dashboard is occasionally working, a lot of the times the entire dashboard remains empty and a js error is logged in the console.

Describe the behavior you expected

Card rendering depending on the input condition.

Steps to reproduce the issue

Use a template inside a visibility condition.

What version of Home Assistant Core has the issue?

2024.7.0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 126.0.6478.127

Which operating system are you using to run this browser?

macOS Sonoma 14.5

State of relevant entities

# input_datetime.bad_hinten_luftung_reinigung
has_date: true
has_time: false
editable: true
year: 2024
month: 7
day: 4
timestamp: 1720044000
icon: mdi:vacuum-outline
friendly_name: Bad hinten Lüftung Reinigung

Problem-relevant frontend configuration

type: entities
entities:
  - entity: input_datetime.bad_hinten_luftung_reinigung
title: Letzte Badlüfter Reinigung
visibility:
  - condition: template
    value_template: >
      {% set dt = states('input_datetime.bad_hinten_luftung_reinigung')
        | as_datetime | as_local %}
      {{ (dt.date() - now().date()).days | abs < 60 }}

Javascript errors shown in your browser console/inspector

Cannot read properties of undefined (reading 'includes')

image image

Additional information

No response

@piitaya
Copy link
Member

piitaya commented Jul 4, 2024

Hi 🙂
Template conditions are not supported (see documentation). That's why it does work.

@piitaya piitaya closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants