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

If statement in automation message

$
0
0

@FranzMaurer wrote:

Hi there, i cant handle this on my own :confused: Can someone point me to a resolution ?

Automation looks like this

- id: '1586175443173'
  alias: test
  description: ''
  trigger:
  - platform: template
    value_template: '{{ state_attr(''sensor.zielone'',''days'') == 1 }}'
  condition: []
  action:
  - data_template: >
      message: >
      {%- if {{ state_attr('sensor.zmieszane','days') == 1 }} -%}
      "Jutro wywóz śmieci {{ state_attr(''sensor.zmieszane'',''friendly_name'') }}"
      {%- elif {{ state_attr('sensor.zielone','days') == 1 }} -%}
      "Jutro wywóz śmieci {{ state_attr(''sensor.zielone'',''friendly_name'') }}"
      {%- elif {{ state_attr('sensor.segregowane','days') == 1 }} -%}
      "Jutro wywóz śmieci {{ state_attr(''sensor.segregowane'',''friendly_name'') }}"
      {%- else -%}
      "Dindu Nuffin"
      {%- endif -%}
    service: notify.smieci

And the error i get after configuration validation:

Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][0]['data_template']. Got None. (See /share/CE_CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/configuration.yaml, line 7).

That is completely unrelated cuz configuration.yaml, line 7 is:

group: !include groups.yaml

That was never a problem and will wanish when i delete the automation.

Posts: 8

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95358

Trending Articles



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