You’re welcome!
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.
For more information about the Solution tag, refer to guideline 21 in the FAQ.
If you want to reduce a string like this:
12:35:00
to this:
12:35
then simply slice off the last three characters using [:-3]
- name: prossimo_orario_cibo_gatti_new
state: >
{% set n = 4 - [ 'input_datetime.pasto_gatti_1', 'input_datetime.pasto_gatti_2', 'input_datetime.pasto_gatti_3' ]
| map('states')| map('today_at') | select('ge', now()) | list | count %}
{{ states('input_datetime.pasto_gatti_' ~ n)[:-3] }}