Skip to content

Validation error with Template in data field? #30

@derandiunddasbo

Description

@derandiunddasbo

This alert...

alert2:
  alerts:
    - domain: sun
      name: is_shining
      friendly_name: Sunshine Alert
      done_message: Uhm... never mind.
      title: Sunshine Alert
      data:
        actions:
          - action: foo
            title: "{{ notify_reason }}"
      condition: "{{ is_state('sun.sun','above_horizon') }}"
      message: "The Sun is shining!"

... gives a validation error with Version 1.16.2:

error: alerts section of config: "data" field must be a dict for dictionary value @ data['data']. Relevant section: {'domain': 'sun', 'name': 'is_shining', 'friendly_name': 'Sunshine Alert', 'done_message': 'Uhm... never mind.', 'title': 'Sunshine Alert', 'data': 'actions:\n - action: foo\n title: "{{ notify_reason }}"', 'condition': "{{ is_state('sun.sun','above_horizon') }}", 'message': 'The Sun is shining!'}

Obviously because of the template {{ notify_reason }} used in the data section. If the template is omitted, the alert validates fine.

This isn't supposed to happen, or is it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions