erlendsellie / priceanalyzer

Priceanalyzer for Home Assistant, based on Nordpool Prices.
64 stars 5 forks source link

Integration not working #40

Closed stave1989 closed 5 months ago

stave1989 commented 5 months ago

Version of the custom_component

1.4

Homeassistant version

Core-2024.05.5

Configuration

Add your logs here.

Logger: homeassistant.util.logging Kilde: util/logging.py:98 Førs oppstått: 14:57:15 (160 hendelser) Sist logget: 14:58:31

Exception in update_sensor when dispatching 'pricanalyzer_checked_stuff': () Traceback (most recent call last): File "/config/custom_components/priceanalyzer/sensor.py", line 403, in update_sensor self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'priceanalyzer' calls async_write_ha_state from a thread at custom_components/priceanalyzer/sensor.py, line 403: self.async_write_ha_state(). Please report it to the author of the 'priceanalyzer' custom integration. Exception in update_sensor when dispatching 'pricanalyzer_checked_stuff': () Traceback (most recent call last): File "/config/custom_components/priceanalyzer/sensor.py", line 332, in update_sensor self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'priceanalyzer' calls async_write_ha_state from a thread at custom_components/priceanalyzer/sensor.py, line 332: self.async_write_ha_state(). Please report it to the author of the 'priceanalyzer' custom integration. Exception in update_sensor when dispatching 'pricanalyzer_checked_stuff': () Traceback (most recent call last): File "/config/custom_components/priceanalyzer/sensor.py", line 244, in update_sensor self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'priceanalyzer' calls async_write_ha_state from a thread at custom_components/priceanalyzer/sensor.py, line 244: self.async_write_ha_state(). Please report it to the author of the 'priceanalyzer' custom integration.

Describe the bug

Not working, no price sensor, and not updating vvb sensor

Debug log

2024-05-28 14:55:54.737 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.vvbsensor_molde.attributes.reason }}' 2024-05-28 14:55:54.738 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ states.sensor.vvbsensor_molde.attributes.reason }}) renders=2> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 585, in async_render render_result = _render_with_context(self.template, compiled, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2600, in _render_with_context return template.render(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "