JonasJoKuJonas / homeassistant-WebUntis

Custom component to access data from Web Untis in Home Assistant
https://community.home-assistant.io/t/webuntis-timetable-in-ha/568273
MIT License
52 stars 12 forks source link

Webuntis templates gehen nicht mehr #107

Closed ItsCharged closed 8 months ago

ItsCharged commented 8 months ago

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 Screenshot_20240217_104514_Home Assistant

JonasJoKuJonas commented 8 months ago

Was bekommst du denn in den Logs?

ItsCharged commented 8 months ago

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 "