sdesalve / zcsazzurro

ZCSAzzurro by SDeSalve
Other
35 stars 12 forks source link

Template Error #25

Closed Ic3b3rg closed 1 year ago

Ic3b3rg commented 1 year ago

i have a problem after the last update of HA

I paste all logs of error:

2023-04-06 20:25:13.338 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration zcsazzurro which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-04-06 20:25:13.355 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ariston which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-04-06 20:25:13.365 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration smartir which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-04-06 20:25:13.377 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Logger: homeassistant.components.sensor
Source: components/rest/data.py:65
Integration: Sensore (documentation, issues)
First occurred: 20:25:55 (1 occurrences)
Last logged: 20:25:55

Error while setting up zcsazzurro platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/zcsazzurro/sensor.py", line 85, in async_setup_platform
    await rest.async_update()
  File "/usr/src/homeassistant/homeassistant/components/rest/data.py", line 65, in async_update
    response = await self._async_client.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1520, in request
    request = self.build_request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 360, in build_request
    return Request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 339, in __init__
    headers, stream = encode_request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_content.py", line 209, in encode_request
    return encode_content(content)
  File "/usr/local/lib/python3.10/site-packages/httpx/_content.py", line 134, in encode_content
    raise TypeError(f"Unexpected type for 'content', {type(content)!r}")
TypeError: Unexpected type for 'content', <class 'bool'>

Logger: homeassistant.helpers.event
Source: helpers/template.py:541
First occurred: 20:26:57 (17 occurrences)
Last logged: 20:26:58

Error while processing template: Template<template=({% set energy = states.sensor.zcs.attributes.current.energyImporting | float | default (0) %} {{ energy | round(2) }}) renders=2>
Error while processing template: Template<template=({% set energy = states.sensor.zcs.attributes.current.energyConsuming | float | default (0) %} {{ energy | round(2) }}) renders=2>
Error while processing template: Template<template=({% set energy = states.sensor.zcs.attributes.current.energyAutoconsuming | float | default (0) %} {{ energy | round(2) }}) renders=2>
Error while processing template: Template<template=({% set energy = states.sensor.zcs.attributes.current.batteryCycletime | int | default (0) %} {{ energy | round(2) }}) renders=2>
Error while processing template: Template<template=({% set energy = states.sensor.zcs.attributes.current.batterySoC | float | default (0) %} {{ energy | round(2) }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 539, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2130, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/local/lib/python3.10/site-packages/jinja2/sandbox.py", line 326, in getattr
    value = getattr(obj, attribute)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2156, in _fail_with_undefined_error
    raise ex
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2147, in _fail_with_undefined_error
    return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'attributes'

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 660, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 541, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'None' has no attribute 'attributes'

Logger: homeassistant.helpers.template
Source: helpers/template.py:660
First occurred: 20:26:57 (34 occurrences)
Last logged: 20:26:58

Template variable error: 'None' has no attribute 'attributes' when rendering '{% set energy = states.sensor.zcs.attributes.current.energyImporting | float | default (0) %} {{ energy | round(2) }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{% set energy = states.sensor.zcs.attributes.current.energyConsuming | float | default (0) %} {{ energy | round(2) }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{% set energy = states.sensor.zcs.attributes.current.energyAutoconsuming | float | default (0) %} {{ energy | round(2) }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{% set energy = states.sensor.zcs.attributes.current.batteryCycletime | int | default (0) %} {{ energy | round(2) }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{% set energy = states.sensor.zcs.attributes.current.batterySoC | float | default (0) %} {{ energy | round(2) }}'

Logger: homeassistant.helpers.template_entity
Source: helpers/template_entity.py:364
First occurred: 20:26:57 (17 occurrences)
Last logged: 20:26:58

TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({% set energy = states.sensor.zcs.attributes.current.energyImporting | float | default (0) %} {{ energy | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.energia_prelevata'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({% set energy = states.sensor.zcs.attributes.current.energyConsuming | float | default (0) %} {{ energy | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.energia_consumata'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({% set energy = states.sensor.zcs.attributes.current.energyAutoconsuming | float | default (0) %} {{ energy | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.energia_autoconsumata'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({% set energy = states.sensor.zcs.attributes.current.batteryCycletime | int | default (0) %} {{ energy | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.cicli_batteria'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({% set energy = states.sensor.zcs.attributes.current.batterySoC | float | default (0) %} {{ energy | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.batteria'
sdesalve commented 1 year ago

Update to last release