Exchange True and False to Anwesend und Abwesend

Hello Community,
I am a newbie at HA. I have read and tested tons of postings and still get stuck.

The Homematic variable presence (Anwesenheit) should be available as an entity in the HA. The value True should be exchanged for Anwesend and the value False for Abwesend.
This also works in the developer tools, but the config-editor shows an error in Configuration.yaml. Why is that?
Developer Tools

Configuration

Error Message
missed comma between flow collection entries at line 72, column 26:
value_template: {% if state_attr('homematic.raspb …
^

Line 72 contains a syntax error.

If a template can fit on a single line, you must enclose it with quotes (single or double) like this:

    value_template: "{{ template goes here }}"

If a template contains multiple lines, you must use a line-continuation character (either > or |) like this:

    value_template: >
      {% if whatever == true %}
         Something
      {% else %}
         Something else
      ... more lines ...

In addition, the multi-line template is indented with respect to value_template. In the example above, it is indented by two spaces.

1 Like

Great, it works.
thanks for your quick reply

For future reference, if you mark your own post with the Solution tag, it should contain a solution. In this case, it doesn’t; the solution exists in the previous post.

The purpose of the Solution tag is to identify, for the benefit of other users, which post in the thread contains the solution to the problem described in the first post.

For more information, refer to guideline 21 in the FAQ.

I understand. Thank you

1 Like