Hi, I’m trying to create a conditional card on my dashboard for a trash calendar.
I created a sensor template to help me compare dates:
- platform: template
sensors:
sorting_date_tomorrow:
friendly_name: "Datum voor sortering morgen"
value_template: >
{{ (as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%Y%m%d') | float(0) + 1) | round(0) }}
icon_template: mdi:calendar-clock
If i check in the template editor:
{{ states('sensor.sorting_date_tomorrow')}}
the result is: 20230206
So far, great.
I want to compare this to a garbage collector sorting date:
{{ state_attr('sensor.rova_gft', 'Sort_date')}}
this result is: 20230206
What I expected.
but if i compare this in a simple If statement:
{{ is_state('sensor.sorting_date_tomorrow', state_attr("sensor.rova_gft", "Sort_date")) }}
it returns: False.
I’m sure i’m doing something wrong, but for the life of me don’t understand why this isn’t True.
Loving the Home Assistant stuff so far, i’m new to all of this. I hope someone can help me understand.