Time trigger and cover position template doesn't work

I have this automation for opening a cover at a certain random position, to be triggered at a certain time:

- id: '1628609350131'
  alias: Simulazione Presenza Mattina
  description: ''
  trigger:
  - platform: time
    at: ’18:24:00’
  condition: []
  action:
  - service: cover.set_cover_position
    entity_id: cover.camera
    position: "{{ ''{:02}''.format(range(0, 10) | random | int) }}"
  mode: single

The problem is the automation is not triggered at the chosen time.
The automation works correctly if I click on Execute, bypassing the time trigger.
The time trigger itself works correctly if I set a fixed value in “position”.

Any hints?


[quote="Vinz87, post:1, topic:328824"]
at: ’18:24:00’
[/quote]

Don’t use fancy quotes

at: '18:24:00'

I double checked the quotes and they were ok, I don’t know why it appeared like that after pasting here.

However, I got it working like that:

- id: '1628691325339'
  alias: Simulazione Presenza Mattina
  description: ''
  trigger:
  - platform: time
    at: '16:27'
  condition: []
  action:
  - service: cover.set_cover_position
    data:
      position: "{{ range(0, 10) | random | int }}"
    entity_id: cover.camera
  mode: single
1 Like