Message malformed: template value should be a string for dictionary value @ data['action'][0]['data']

So I got this error while modifying an automation…
bild
Now I can’t seem to get rid of it…Below is a snap of my automation.
bild
Does anyone have a clue what I’ve missed?

As code:

action:
  - service: cover.set_cover_position
    data:
      position: |
        {% if trigger.idx == '0' && state_attr('sun.sun', 'elevation') > 10 &&
        states('sensor.bathroom_lumi_illuminance') > 1465 &&
        states('sensor.outdoor') > 15 %}
          50
        {% elif trigger.idx == '1' && state_attr('sun.sun', 'azimuth') > 290 %}
          100
        {% else %}
          {{ state_attr('cover.bathroom_blind_position', 'current_position') }}
        {% endif %}
    target:

Post that as code please.

Sure thing, Done!

this is jinja, not C#. The language is close to python. And is simply and, or is simply or.

1 Like

Wow… can’t believe I missed that… thanks!