Hi, i can’t get the correct information for a google calendar data.
I want to create a garbage collection card that gives me the day of the week for the next garbage collection (this would also be simple).
I would also like that if the next retreat is tomorrow, instead of the date it appears as “tomorrow”.
The problem is that I can’t subtract the current date from the calendar date, I think because they are different formats.
The sensors are these:
{{ (states.calendar.savno.attributes.start_time)}}
{{ now() }}
and the result i get is
2022-12-13 08:00:00
2022-12-11 22:28:00.364432+01:00
i tried this code but i get an error
{{(((as_timestamp(now()) - as_timestamp(strptime(states.calendar.savno.attributes['start_time'], '%d-%m-%Y %H:%M'))))/60)|round(0)}}
ValueError: Template error: strptime got invalid input ‘2022-12-13 08:00:00’ when rendering template '{{ (states.calendar.savno.attributes.start_time)}}
{{ now() }}
This is my actual card
entity: sensor.next_raccolta
name: Raccolta rifiuti
type: custom:multiple-entity-row
entities:
- entity: calendar.savno
attribute: start_time
format: date
name: ' '