Replies: 4 comments 1 reply
-
|
Use the Visbility tab on the Card to hide it when the start date is too far out. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
A template like this one should do what you are looking for |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thank you. Would I put this in the card? Or where? Sorry, not sure how this would work.
… On Jun 13, 2025, at 2:48 PM, David ***@***.***> wrote:
A template like this one should do what you are looking for
'''
{%- set date_str = state_attr('sensor.your_tt_sensor', 'date') -%}
{%- if date_str is not none and date_str != '' -%}
{%- set date = strptime(date_str, "%Y-%m-%dT%H:%MZ").replace(tzinfo=None) -%}
{%- set now = utcnow().replace(tzinfo=None) -%}
{%- if date >= (now - timedelta(days=10)) -%}
True
{%- else %}
False
{%- endif -%}
{%- endif -%}
'''
—
Reply to this email directly, view it on GitHub <#222 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AXPFZNVKNIVEOYHXWYN6KR33DLCDTAVCNFSM6AAAAAB64JRC6KVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNBWGA4DKMA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Either create a template and use it to set the visibility (https://www.home-assistant.io/integrations/template/) or use it as a filter in the auto_entities card. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
trying to figure out how to just display my team tracker card for a week or less before a match. SSC Napoli just finished their season and the next match isn't until August.
Beta Was this translation helpful? Give feedback.
All reactions