Firstly, please format your code correctly: see here. Surround it with three backticks (```) before and after.
There are a lot of errors in that code:
- missing
sensor: {% if ... }and{% elif ... }(should be%}at the end)booleanfilter doesn’t exist- no
state:declaration - mismatched brackets (one open, two close)
Try this:
template:
- sensor:
- name: Status Garagentor
unique_id: status_garagentor
state: >
{% if is_state('binary_sensor.garagentor_offen', 'on') %}
Garagentor offen
{% elif is_state('binary_sensor.garagentor_geschlossen', 'on') %}
Garagentor geschlossen
{% elif is_state('binary_sensor.garagentor_fahrt_auf', 'on') %}
Garagentor fährt auf
{% elif is_state('binary_sensor.garagentor_fahrt_zu', 'on') %}
Garagentor fährt zu
{% else %}
Fehler
{% endif %}
You can create template sensors via the UI: just paste the template (from {% if to the end) into the box.
Reporting Fehler on my system as I don’t have your sensors.
In future, try your templates in the Template Editor:
A more compact template, assuming the sensors’ friendly names are set properly:
template:
- sensor:
- name: Status Garagentor
unique_id: status_garagentor
state: "{{ states[('binary_sensor.garagentor_offen','binary_sensor.garagentor_geschlossen','binary_sensor.garagentor_fahrt_auf','binary_sensor.garagentor_fahrt_zu')|select('is_state','on')|first]['attributes']['friendly_name'] }}"
availability: "{{ ('binary_sensor.garagentor_offen','binary_sensor.garagentor_geschlossen','binary_sensor.garagentor_fahrt_auf','binary_sensor.garagentor_fahrt_zu')|select('is_state','on')|count > 0 }}"
That goes unavailable if no sensor is on rather than returning Fehler.

