Value template error [HA 0.107.6]

Hey, can’t figure out why this simple automation won’t work.

- id: '1586808364588'
  alias: Set Alarm
  description: ''
  trigger:
  - platform: mqtt
    topic: hass/alarm/set
  condition: []
  action:
  - service: timer.start
    entity_id: timer.alarm_clock
    data_template:
      duration: '{{trigger.payload_json.value}}'

At first I tried to use data instead of data_template, because that’s what automation editor does, but that also doesn’t work.

Error message

Set Alarm: Error executing script. Invalid data for call_service at pos 1: offset {{trigger.payload_json.value}} should be format 'HH:MM' or 'HH:MM:SS' for dictionary value @ data['duration']

Payload example

{
    "value": 34853,
    "name": "BeforeAlarm",
    "count": 1
}

So it doesn’t parse '{{trigger.payload_json.value}}' into a numerical value? Can’t figure out why

Configuration for the timer - didn’t specify any duration

timer: 
  alarm_clock:

Hm, after doing ha core restart I think the problem was that my automation wasn’t updated.

Didn’t see reload automation buttons in a newer (than I previously used) version, so I assumed automations are reloaded live.

Thanks for your help and sorry for a bit of a time waste!

But I learned that I dont need payload in json form and that simplifies life :slight_smile:

I am marking this as the answer for people who might bump into this thread later.

Or is there a problem with this?