Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95419

Value template error [HA 0.107.6]

$
0
0

@icemtel wrote:

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

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>