Help with configuration "Input Datetime"

I want to set the time in the interface. At this time, the automation of closing the curtains will be triggered. But nothing works for me.
I was guided by these documents
I added this to the configuration:

sensor:
- platform: time_date
  display_options:
    - 'time'
    - 'date'
    - 'date_time'
    - 'date_time_utc'
    - 'date_time_iso'
    - 'time_date'
    - 'time_utc'
    - 'beat'

input_datetime:
  input_time_close:
    name: Input time close blinds
    has_date: false
    has_time: true

In automation, I added this:

- id: '1578004349566'
  alias: Blinds time close
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == (state_attr('input_datetime.input_time_close', 'timestamp') | int | timestamp_custom('%H:%M', True)) }}"
  action:
    service: cover.close_cover
    entity_id: cover.vse_shtory

I enter time into the cell, but automation does not work.
2020-04-25_15-46-43

Try this trigger template instead:

"{{ states('sensor.time') == states('input_datetime.input_time_close')[0:5] }}"

To see why it works put the following in the developer tools template editor and observe the output:

Time = {{ states('sensor.time') }}
Input DT = {{ states('input_datetime.input_time_close') }}
formatted Input DT = {{ states('input_datetime.input_time_close')[0:5] }}
1 Like

yes! Its work! Thanks! emmm… Why? =)
What is [0:5] ?

1 Like

Do what I said.

1 Like

Проблема решена!