Closed ItsCharged closed 8 months ago
Was bekommst du denn in den Logs?
Logger: homeassistant.helpers.event Source: helpers/template.py:574 First occurred: 17. Februar 2024 um 09:22:26 (13 occurrences) Last logged: 20:55:30
Error while processing template: Template<template=({% set lessionlist = namespace(lession=[]) %} {% set lessionlistStandIn = namespace(lession=[]) %} {% set lessons = states.sensor.heutzant_next_lesson_to_wake_up.attributes.day | from_json %} {% for lesson in lessons %} {% if lesson.subjects | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlist.lession = lessionlist.lession + [lesson.subjects.0.long_name] %} {% endif %} {% if lesson.original_teachers | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlistStandIn.lession = lessionlistStandIn.lession + [lesson.subjects.0.long_name] %} {% endif %} {%- endfor %} Du hast heute {%- for item in lessionlist.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% if lessionlistStandIn.lession | count > 0 %} Vertretung hast du heute in: {%- for item in lessionlistStandIn.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% endif %}) renders=6> Error while processing template: Template<template=({% set lessionlist = namespace(lession=[]) %} {% set lessionlistStandIn = namespace(lession=[]) %} {% set lessons = states.sensor.heutzant_next_lesson_to_wake_up.attributes.day | from_json %} {% for lesson in lessons %} {% if lesson.subjects | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlist.lession = lessionlist.lession + [lesson.subjects.0.long_name] %} {% endif %} {% if lesson.original_teachers | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlistStandIn.lession = lessionlistStandIn.lession + [lesson.subjects.0.long_name] %} {% endif %} {%- endfor %} Du hast heute {%- for item in lessionlist.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% if lessionlistStandIn.lession | count > 0 %} Vertretung hast du heute in: {%- for item in lessionlistStandIn.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% endif %}) renders=10> Error while processing template: Template<template=({% set lessionlist = namespace(lession=[]) %} {% set lessionlistStandIn = namespace(lession=[]) %} {% set lessons = states.sensor.heutzant_next_lesson_to_wake_up.attributes.day | from_json %} {% for lesson in lessons %} {% if lesson.subjects | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlist.lession = lessionlist.lession + [lesson.subjects.0.long_name] %} {% endif %} {% if lesson.original_teachers | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlistStandIn.lession = lessionlistStandIn.lession + [lesson.subjects.0.long_name] %} {% endif %} {%- endfor %} Du hast heute {%- for item in lessionlist.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% if lessionlistStandIn.lession | count > 0 %} Vertretung hast du heute in: {%- for item in lessionlistStandIn.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% endif %}) renders=14> Error while processing template: Template<template=({% set lessionlist = namespace(lession=[]) %} {% set lessionlistStandIn = namespace(lession=[]) %} {% set lessons = states.sensor.heutzant_next_lesson_to_wake_up.attributes.day | from_json %} {% for lesson in lessons %} {% if lesson.subjects | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlist.lession = lessionlist.lession + [lesson.subjects.0.long_name] %} {% endif %} {% if lesson.original_teachers | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlistStandIn.lession = lessionlistStandIn.lession + [lesson.subjects.0.long_name] %} {% endif %} {%- endfor %} Du hast heute {%- for item in lessionlist.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% if lessionlistStandIn.lession | count > 0 %} Vertretung hast du heute in: {%- for item in lessionlistStandIn.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% endif %}) renders=18> Error while processing template: Template<template=({% set lessionlist = namespace(lession=[]) %} {% set lessionlistStandIn = namespace(lession=[]) %} {% set lessons = states.sensor.heutzant_next_lesson_to_wake_up.attributes.day | from_json %} {% for lesson in lessons %} {% if lesson.subjects | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlist.lession = lessionlist.lession + [lesson.subjects.0.long_name] %} {% endif %} {% if lesson.original_teachers | count > 0 and lesson.code | count > 0 and lesson.code != 'cancelled' %} {% set lessionlistStandIn.lession = lessionlistStandIn.lession + [lesson.subjects.0.long_name] %} {% endif %} {%- endfor %} Du hast heute {%- for item in lessionlist.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% if lessionlistStandIn.lession | count > 0 %} Vertretung hast du heute in: {%- for item in lessionlistStandIn.lession | unique %}{{ "," if not loop.last and not loop.first }}{{ " und" if loop.last and not loop.first }} {{item}}{%- endfor %}. {% endif %}) renders=22> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 572, in async_render render_result = _render_with_context(self.template, compiled, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2332, in _render_with_context return template.render(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 2, in top-level template code File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2187, in from_json return json_loads(value) ^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/json.py", line 47, in json_loads return orjson.loads(__obj) # type:ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 698, in async_render_to_info render_info._result = self.async_render( ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 574, in async_render raise TemplateError(err) from err homeassistant.exceptions.TemplateError: JSONDecodeError: unexpected character: line 1 column 1 (char 0)
Was zeigt der Sensor denn in dem Attribut Day in den Entwicklerwerkzeuge an?
Wie meinst du das?
Der Standard von ha
Oder der den ich nutze (bzw. Alle)
Weil keiner geht selbst nicht im Entwickler werkzeug
Wie meinst du das?
Der sensor den du im template benutzt: sensor.heutzant_next_lesson_to_wake_up
Weil keiner geht selbst nicht im Entwickler werkzeug
Wenn keiner geht sollten noch andere logs von der Integration da sein. Also nicht von dem json template error
da bekomm ich nix. Sensor klappt und alles
schick mir mal ein screen shot von dem sensor sensor.heutzant_next_lesson_to_wake_up
aus den Entwickleroptionen mit Attributen.
für schnellere Antworten support channel auf Discord ;)
Ok, man muss json in Einstellungen aktivieren habs behoben damals war es standard an
The problem
Ich kann keine Templates mehr benutzen keine. Ich benutze die von der Website JsonDecodeError Ich benutze die von meiner alten lösung: JsonDecodeError
Version of Home Assistant?
2024.2.2
What type of installation are you running?
Home Assistant OS
Version of WebUntis
Idk
Last working WebUntis version
Idk
Traceback/Error logs
JsonDecodeError
Additional information
Der Fehler ist folgender: JsonDecodeError