custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

Setup failed after HA 2023.8.2 and HA 2023.8.1 have been released #504

Closed typxxi closed 1 year ago

typxxi commented 1 year ago

Since the august Update from yesterday evening .8.1 and 1 hour ago the .8.2 there is an event error during booting.

I bet this might be caused by the new feature or event handler I had seen on a yt channel afterwards. There has been some changes around the event element if I remember right.

Raspberry Pi3 with 1 GB and rather small setup Hope it helps a bit .

Logger: homeassistant.setup
Source: custom_components/pyscript/__init__.py:27
Integration: pyscript ([documentation](https://github.com/custom-components/pyscript), [issues](https://github.com/custom-components/pyscript/issues))
First occurred: 15:32:06 (1 occurrences)
Last logged: 15:32:06

Setup failed for custom integration pyscript: Unable to import component: cannot import name 'Event' from 'homeassistant.helpers.event' (/usr/src/homeassistant/homeassistant/helpers/event.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/pyscript/__init__.py", line 27, in <module>
    from homeassistant.helpers.event import Event as HAEvent
ImportError: cannot import name 'Event' from 'homeassistant.helpers.event' (/usr/src/homeassistant/homeassistant/helpers/event.py)

and full error log

2023-08-03 15:30:12.054 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration auto_backup 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-08-03 15:30:12.060 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration rademacher 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-08-03 15:30:12.065 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration sonoff 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-08-03 15:30:12.070 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration localtuya 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-08-03 15:30:12.074 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration pyscript 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-08-03 15:30:12.084 WARNING (SyncWorker_2) [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
2023-08-03 15:30:57.396 WARNING (MainThread) [custom_components.sonoff] Can't login with mode: auto
Traceback (most recent call last):
  File "/config/custom_components/sonoff/__init__.py", line 206, in async_setup_entry
    await registry.cloud.login(username, password)
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 150, in login
    raise AuthError(resp["msg"])
custom_components.sonoff.core.ewelink.cloud.AuthError: appid is unauthorized! KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi
2023-08-03 15:30:57.416 WARNING (MainThread) [homeassistant.config_entries] Config entry 'johann.goerken@gmail.com' for sonoff integration could not authenticate: appid is unauthorized! KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi
2023-08-03 15:30:57.619 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.pv_balkon_energy_today_kwh (<class 'homeassistant.components.template.sensor.SensorTemplate'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
2023-08-03 15:30:57.720 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.pv_gesamterzeugung_kwh (<class 'homeassistant.components.template.sensor.SensorTemplate'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
2023-08-03 15:31:01.745 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:31:02.165 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.wallbox_energy_day (<class 'custom_components.sonoff.sensor.XSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-08-03 15:31:02.172 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.wallbox_energy_month (<class 'custom_components.sonoff.sensor.XSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-08-03 15:31:02.191 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.heizung_wohnzimmer_energy_day (<class 'custom_components.sonoff.sensor.XSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-08-03 15:31:02.197 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.heizung_wohnzimmer_energy_month (<class 'custom_components.sonoff.sensor.XSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-08-03 15:31:02.823 WARNING (MainThread) [homeassistant.components.min_max.sensor] Units of measurement do not match for entity sensor.pv_gesamt_kwh
2023-08-03 15:31:05.364 WARNING (MainThread) [homeassistant.components.min_max.sensor] Units of measurement do not match for entity sensor.pv_gesamt_kwh
2023-08-03 15:31:29.422 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: raspberry_pi
2023-08-03 15:31:48.848 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:32:06.434 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration pyscript: Unable to import component: cannot import name 'Event' from 'homeassistant.helpers.event' (/usr/src/homeassistant/homeassistant/helpers/event.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/pyscript/__init__.py", line 27, in <module>
    from homeassistant.helpers.event import Event as HAEvent
ImportError: cannot import name 'Event' from 'homeassistant.helpers.event' (/usr/src/homeassistant/homeassistant/helpers/event.py)
2023-08-03 15:32:16.572 WARNING (MainThread) [reolink_aio.api] Camera 360 Grad reported to support zoom, but zoom range not available
2023-08-03 15:32:22.841 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( states('sensor.pv_balkon_400_w_power') | float() + states('sensor.2_mitte_20deg_3_kw_4_kwp_total_output_power') | float() + states('sensor.3_west_20deg_46_kw_3_kwp_total_output_power') | float() ) | round(0) }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1908, in forgiving_float_filter
    return float(value)
           ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 563, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2179, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/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/src/homeassistant/homeassistant/helpers/template.py", line 1911, in forgiving_float_filter
    raise_no_default("float", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1609, in raise_no_default
    raise ValueError(
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_balkon_400_w_power') | float() + states('sensor.2_mitte_20deg_3_kw_4_kwp_total_output_power') | float() + states('sensor.3_west_20deg_46_kw_3_kwp_total_output_power') | float() ) | round(0) }}' but no default was specified

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 684, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 565, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_balkon_400_w_power') | float() + states('sensor.2_mitte_20deg_3_kw_4_kwp_total_output_power') | float() + states('sensor.3_west_20deg_46_kw_3_kwp_total_output_power') | float() ) | round(0) }}' but no default was specified
2023-08-03 15:32:22.878 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_balkon_400_w_power') | float() + states('sensor.2_mitte_20deg_3_kw_4_kwp_total_output_power') | float() + states('sensor.3_west_20deg_46_kw_3_kwp_total_output_power') | float() ) | round(0) }}' but no default was specified') while processing template 'Template<template=({{ ( states('sensor.pv_balkon_400_w_power') | float() + states('sensor.2_mitte_20deg_3_kw_4_kwp_total_output_power') | float() + states('sensor.3_west_20deg_46_kw_3_kwp_total_output_power') | float() ) | round(0) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.pv_gesamtleistung_w'
2023-08-03 15:32:22.885 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( states('sensor.pv_gesamtleistung_w') | int / 7000 * 100 | float() | round(0) ) }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 563, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2179, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/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/src/homeassistant/homeassistant/helpers/template.py", line 1927, in forgiving_int_filter
    raise_no_default("int", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1609, in raise_no_default
    raise ValueError(
ValueError: Template error: int got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_gesamtleistung_w') | int / 7000 * 100 | float() | round(0) ) }}' but no default was specified

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 684, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 565, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: int got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_gesamtleistung_w') | int / 7000 * 100 | float() | round(0) ) }}' but no default was specified
2023-08-03 15:32:22.904 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{{ ( states('sensor.pv_gesamtleistung_w') | int / 7000 * 100 | float() | round(0) ) }}' but no default was specified') while processing template 'Template<template=({{ ( states('sensor.pv_gesamtleistung_w') | int / 7000 * 100 | float() | round(0) ) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.pv_gesamtauslastung'
2023-08-03 15:32:23.040 ERROR (MainThread) [homeassistant.components.automation.growatt_25_min_update] Error setting up trigger GROWATT 2,5 Min. Update
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/trigger.py", line 37, in async_attach_trigger
    return await platform.async_attach_trigger(hass, config, action, trigger_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/time_pattern.py", line 92, in async_attach_trigger
    return async_track_time_change(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1704, in async_track_time_change
    return async_track_utc_time_change(hass, action, hour, minute, second, local=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1640, in async_track_utc_time_change
    matching_seconds = dt_util.parse_time_expression(second, 0, 59)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/dt.py", line 310, in parse_time_expression
    res = [x for x in range(min_value, max_value + 1) if x % parameter == 0]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/dt.py", line 310, in <listcomp>
    res = [x for x in range(min_value, max_value + 1) if x % parameter == 0]
                                                         ~~^~~~~~~~~~~
ZeroDivisionError: integer modulo by zero
2023-08-03 15:32:48.817 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:33:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:34:48.817 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:35:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:36:48.817 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:37:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:38:48.816 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:39:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:40:48.816 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:41:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:42:48.817 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:43:48.863 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:44:48.817 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
2023-08-03 15:45:48.849 WARNING (MainThread) [custom_components.localtuya.common] [bfc...ahz] Failed to connect to 192.168.178.239: [Errno 113] Connect call failed ('192.168.178.239', 6668)
maennes commented 1 year ago

Same error messages here

craigbarratt commented 1 year ago

Are you running pyscript 1.5.0?

maennes commented 1 year ago

Rats, should have checked that first! The errors went away after upgrading to 1.5.0. Sorry for the bother!

typxxi commented 1 year ago

Sorry, I was not aware that I always have to check HACS for updates first. I had already 3 or 4 Hacs Updates piled up but without any notfification (Autobackup, SonOff, Psyscript, ..).

Is there any way to get a notification for updates available there on the HACS store ?

Thanks

typxxi commented 1 year ago

Are you running pyscript 1.5.0?

no, unfortunatelly I was not aware that HACS updates are not shown in the notifications cause I had some already sitting and waiting there without any notification. Thanks for your helping hint which solved it and easily.