DeerMaximum / Technische-Alternative-CoE

Custom Home Assistant integration to read data from a C.M.I. via CoE
MIT License
9 stars 1 forks source link

error during setup & some CoE to HTTP server errors #65

Open AiMwasNeD-0815 opened 1 month ago

AiMwasNeD-0815 commented 1 month ago

Hi,

Since switching to Coe2, the following errors have occurred. The integration itself runs normally, but newly created COE sensors do not work.

Logger: homeassistant.config_entries Quelle: config_entries.py:575 Erstmals aufgetreten: 18. Mai 2024 um 21:52:38 (2 Vorkommnisse) Zuletzt protokolliert: 18. Mai 2024 um 22:16:17

Error setting up entry CoE for ta_coe Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ta_coe/init.py", line 82, in async_setup_entry await observer.get_all_states() File "/config/custom_components/ta_coe/state_observer.py", line 83, in get_all_states await self._sender.update() File "/config/custom_components/ta_coe/state_sender_v2.py", line 79, in update await self._coe.send_digital_values_v2(digital_channels) File "/usr/local/lib/python3.12/site-packages/ta_cmi/coe.py", line 124, in send_digital_values_v2 await self._api.send_digital_values_v2(channel) File "/usr/local/lib/python3.12/site-packages/ta_cmi/coe_api.py", line 210, in send_digital_values_v2 await self._make_request_post(url, data) File "/usr/local/lib/python3.12/site-packages/ta_cmi/api.py", line 36, in _make_request_post await self._make_request_no_json(url, method="POST", body=body) File "/usr/local/lib/python3.12/site-packages/ta_cmi/api.py", line 57, in _make_request_no_json raise ApiError( ta_cmi.api.ApiError: Invalid response from a824d5a9-ta-coe: 500

===============================================================

Logger: homeassistant.config_entries Quelle: config_entries.py:575 Erstmals aufgetreten: 18. Mai 2024 um 22:16:17 (2 Vorkommnisse) Zuletzt protokolliert: 18. Mai 2024 um 22:16:17

Error setting up entry CoE for sensor Error setting up entry CoE for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 134, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 185, in async_setup_entry raise ValueError( ValueError: Config entry CoE (92407d8c0c17d606f1d1ec52188f3152) for ta_coe.sensor has already been setup! Screenshot 2024-05-19 102323

DeerMaximum commented 1 month ago

Can you send me the debug logs with this configuration? This also activates the debug logs for the Python library used.

logger:
  default: info
  logs:
    custom_components.ta_coe: debug
    ta_cmi: debug
AiMwasNeD-0815 commented 1 month ago

I have attached this to my configuration as written, which logs should I post exactly? Do you mean the TA integration debug logs?

If possible, you can also write to me in German for better understanding.

DeerMaximum commented 1 month ago

In den Home Assistant logs sollten Nachrichten sein die in etwa so aussehen, gefolgt von dem Fehler den du geschildert hast:

2024-04-17 17:28:55.597 DEBUG (MainThread) [custom_components.ta_coe] Try to stop refresh task
2024-04-17 17:28:55.600 DEBUG (MainThread) [custom_components.ta_coe] Used update interval: 0:01:00
2024-04-17 17:28:55.600 DEBUG (MainThread) [custom_components.ta_coe] Try to update CoE
2024-04-17 17:28:55.610 DEBUG (MainThread) [ta_cmi] Receive data from CoE server:
2024-04-17 17:28:55.610 DEBUG (MainThread) [ta_cmi] Receive current version from CoE server:
2024-04-17 17:28:55.619 DEBUG (MainThread) [custom_components.ta_coe] Finished fetching ta_coe data in 0.019 seconds (success: True)
2024-04-17 17:28:55.620 DEBUG (MainThread) [custom_components.ta_coe] Update all states
2024-04-17 17:28:55.620 DEBUG (MainThread) [custom_components.ta_coe] Send all 0 values to server
2024-04-17 17:28:55.649 DEBUG (MainThread) [custom_components.ta_coe] Try to start refresh task

Da es sich bei deinem Fehler vermutlich um einen Server fehler handelt, wäre es wichtig, wenn die Logs solche Zeilen enthalten:

2023-01-23 19:55:55.857 DEBUG (MainThread) [ta_cmi] Receive data from CoE server:
2023-01-23 19:55:55.857 DEBUG (MainThread) [ta_cmi] Receive current version from CoE server:
AiMwasNeD-0815 commented 1 month ago

(Send all 0 values to server) & (Try to start refresh task) ergab keine Fehler.

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant

Quelle: custom_components/ta_coe/sensor.py:94

Integration: Technische Alternative CoE (Dokumentation, Probleme)

Erstmals aufgetreten: 27. Mai 2024 um 20:51:48 (8 Vorkommnisse)

Zuletzt protokolliert: 27. Mai 2024 um 20:58:48

Error doing job: Task exception was never retrieved

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval

await self._async_refresh(log_failures=True, scheduled=True)

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh

self.async_update_listeners()

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners

update_callback()

File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update

self.async_write_ha_state()

File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state

self._async_write_ha_state()

File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state

state, attr, capabilities, shadowed_attr = self.__async_calculate_state()

                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in __async_calculate_state

capability_attr = self.capability_attributes

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 365, in capability_attributes

if state_class := self.state_class:

                  ^^^^^^^^^^^^^^^^

File "/config/custom_components/ta_coe/sensor.py", line 86, in state_class

if self.device_class in [SensorDeviceClass.ENERGY, SensorDeviceClass.WATER]:

   ^^^^^^^^^^^^^^^^^

File "/config/custom_components/ta_coe/sensor.py", line 94, in device_class

channel_raw: dict[str, Any] = self._coordinator.data[self._can_id][TYPE_SENSOR][

                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

KeyError: 24

2024-05-24 07:02:44.399 DEBUG (MainThread) [custom_components.ta_coe] Used update interval: 0:01:00

2024-05-24 07:02:44.401 DEBUG (MainThread) [custom_components.ta_coe] Try to update CoE

2024-05-24 07:02:44.401 DEBUG (MainThread) [ta_cmi] Receive current version from CoE server: http://a824d5a9-ta-coe:9000/version

2024-05-24 07:02:44.401 DEBUG (MainThread) [ta_cmi] Sending request to http://a824d5a9-ta-coe:9000/version with None

2024-05-24 07:02:44.421 DEBUG (MainThread) [ta_cmi] Received payload: {"version": "2.1.0"}

2024-05-24 07:02:44.421 DEBUG (MainThread) [ta_cmi] Received version from CoE server: {'version': '2.1.0'}

2024-05-24 07:02:44.422 DEBUG (MainThread) [ta_cmi] Update CoE data

2024-05-24 07:02:44.422 DEBUG (MainThread) [ta_cmi] Receive data from CoE server: http://a824d5a9-ta-coe:9000/receive/5

2024-05-24 07:02:44.422 DEBUG (MainThread) [ta_cmi] Sending request to http://a824d5a9-ta-coe:9000/receive/5 with None

2024-05-24 07:02:44.443 DEBUG (MainThread) [ta_cmi] Received payload: {"digital": [{"value": 0.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 1.0, "unit": 43}], "analog": [{"value": 41.0, "unit": 8}, {"value": 30.0, "unit": 1}, {"value": 21.3, "unit": 1}, {"value": 65.9, "unit": 8}, {"value": 55.2, "unit": 8}, {"value": 23.0, "unit": 1}, {"value": 64.5, "unit": 8}, {"value": 23.1, "unit": 1}, {"value": 60.2, "unit": 8}, {"value": 23.1, "unit": 1}, {"value": 79.7, "unit": 8}, {"value": 14.9, "unit": 1}, {"value": 0.1, "unit": 11}, {"value": 0.04, "unit": 10}, {"value": 0.4, "unit": 11}, {"value": 256.0, "unit": 69}, {"value": 0.0, "unit": 69}, {"value": 2.1, "unit": 11}, {"value": 0.0, "unit": 11}, {"value": 61.2, "unit": 8}, {"value": 20.8, "unit": 1}, {"value": 23.3, "unit": 1}, {"value": 57.5, "unit": 8}, {"value": 18.0, "unit": 8}, {"value": 1638.0, "unit": 0}, {"value": 1638.0, "unit": 0}, {"value": 1638.0, "unit": 0}], "last_update_unix": 1716526962.00838, "last_update": "2024-05-24T07:02:42.008380", "can_id": 5}

2024-05-24 07:02:44.443 DEBUG (MainThread) [ta_cmi] Received data from CoE server: {'digital': [{'value': 0.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 1.0, 'unit': 43}], 'analog': [{'value': 41.0, 'unit': 8}, {'value': 30.0, 'unit': 1}, {'value': 21.3, 'unit': 1}, {'value': 65.9, 'unit': 8}, {'value': 55.2, 'unit': 8}, {'value': 23.0, 'unit': 1}, {'value': 64.5, 'unit': 8}, {'value': 23.1, 'unit': 1}, {'value': 60.2, 'unit': 8}, {'value': 23.1, 'unit': 1}, {'value': 79.7, 'unit': 8}, {'value': 14.9, 'unit': 1}, {'value': 0.1, 'unit': 11}, {'value': 0.04, 'unit': 10}, {'value': 0.4, 'unit': 11}, {'value': 256.0, 'unit': 69}, {'value': 0.0, 'unit': 69}, {'value': 2.1, 'unit': 11}, {'value': 0.0, 'unit': 11}, {'value': 61.2, 'unit': 8}, {'value': 20.8, 'unit': 1}, {'value': 23.3, 'unit': 1}, {'value': 57.5, 'unit': 8}, {'value': 18.0, 'unit': 8}, {'value': 1638.0, 'unit': 0}, {'value': 1638.0, 'unit': 0}, {'value': 1638.0, 'unit': 0}], 'last_update_unix': 1716526962.00838, 'last_update': '2024-05-24T07:02:42.008380', 'can_id': 5}

2024-05-24 07:02:44.443 DEBUG (MainThread) [custom_components.ta_coe] Finished fetching ta_coe data in 0.042 seconds (success: True)

2024-05-24 07:02:44.443 DEBUG (MainThread) [ta_cmi] Receive current config from CoE server: http://a824d5a9-ta-coe:9000/config

2024-05-24 07:02:44.444 DEBUG (MainThread) [ta_cmi] Sending request to http://a824d5a9-ta-coe:9000/config with None

2024-05-24 07:02:44.448 DEBUG (MainThread) [ta_cmi] Received payload: {"coe_version": 2}

2024-05-24 07:02:44.449 DEBUG (MainThread) [ta_cmi] Received version from CoE server: {'coe_version': 2}

2024-05-24 07:02:44.449 DEBUG (MainThread) [custom_components.ta_coe] CoE server config: Version=2

2024-05-24 07:02:48.153 INFO (MainThread) [homeassistant.components.sensor] Setting up ta_coe.sensor

2024-05-24 07:02:48.176 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up ta_coe.binary_sensor

2024-05-24 07:02:48.179 DEBUG (MainThread) [custom_components.ta_coe] Update all states

2024-05-24 07:02:48.179 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.wz_rolo_auf: False

2024-05-24 07:02:48.179 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.wz_rolo_zu: False

2024-05-24 07:02:48.179 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.blank1: False

2024-05-24 07:02:48.180 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.blank2: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_garagentor: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz2_einzeln_zu: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.blank3: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz2_eck_zu: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz2_einzeln_auf: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_wz_dpl_auf: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_wz_dpl_zu: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kuche_auf: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kuche_zu: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_esszimmer_auf: False

2024-05-24 07:02:48.185 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_esszimmer_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_wc_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_wc_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_terrasse_rechts_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_terrasse_rechts_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_terrasse_links_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_terrasse_links_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_einzeln_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_einzeln_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_eck_kurz_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_eck_kurz_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_eck_lang_auf: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_schlafzimmer_eck_lang_zu: False

2024-05-24 07:02:48.186 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz1_eck_auf: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz1_eck_zu: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz1_einzeln_auf: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz1_einzeln_zu: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.ta_roll_kz2_eck_auf: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Update digital value without update input_boolean.luftungstrigger: False

2024-05-24 07:02:48.187 DEBUG (MainThread) [custom_components.ta_coe] Send all 33 values to server

2024-05-24 07:02:48.187 DEBUG (MainThread) [ta_cmi] Send digital value to CoE server (V2)

2024-05-24 07:02:48.187 DEBUG (MainThread) [ta_cmi] Sending request to http://a824d5a9-ta-coe:9000/send/v2/digital with {'values': [{'channel': 1, 'value': False, 'unit': '43'}, {'channel': 2, 'value': False, 'unit': '43'}, {'channel': 3, 'value': False, 'unit': '43'}, {'channel': 4, 'value': False, 'unit': '43'}, {'channel': 5, 'value': False, 'unit': '43'}, {'channel': 6, 'value': False, 'unit': '43'}, {'channel': 7, 'value': False, 'unit': '43'}, {'channel': 8, 'value': False, 'unit': '43'}, {'channel': 9, 'value': False, 'unit': '43'}, {'channel': 10, 'value': False, 'unit': '43'}, {'channel': 11, 'value': False, 'unit': '43'}, {'channel': 12, 'value': False, 'unit': '43'}, {'channel': 13, 'value': False, 'unit': '43'}, {'channel': 14, 'value': False, 'unit': '43'}, {'channel': 15, 'value': False, 'unit': '43'}, {'channel': 16, 'value': False, 'unit': '43'}, {'channel': 17, 'value': False, 'unit': '43'}, {'channel': 18, 'value': False, 'unit': '43'}, {'channel': 19, 'value': False, 'unit': '43'}, {'channel': 20, 'value': False, 'unit': '43'}, {'channel': 21, 'value': False, 'unit': '43'}, {'channel': 22, 'value': False, 'unit': '43'}, {'channel': 23, 'value': False, 'unit': '43'}, {'channel': 24, 'value': False, 'unit': '43'}, {'channel': 25, 'value': False, 'unit': '43'}, {'channel': 26, 'value': False, 'unit': '43'}, {'channel': 27, 'value': False, 'unit': '43'}, {'channel': 28, 'value': False, 'unit': '43'}, {'channel': 29, 'value': False, 'unit': '43'}, {'channel': 30, 'value': False, 'unit': '43'}, {'channel': 31, 'value': False, 'unit': '43'}, {'channel': 32, 'value': False, 'unit': '43'}, {'channel': 33, 'value': False, 'unit': '43'}]}

2024-05-24 07:02:48.196 INFO (MainThread) [homeassistant.components.sensor] Setting up forecast_solar.sensor

2024-05-24 07:02:48.210 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry CoE for ta_coe

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup

result = await component.async_setup_entry(hass, self)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/config/custom_components/ta_coe/init.py", line 82, in async_setup_entry

await observer.get_all_states()

File "/config/custom_components/ta_coe/state_observer.py", line 83, in get_all_states

await self._sender.update()

File "/config/custom_components/ta_coe/state_sender_v2.py", line 79, in update

await self._coe.send_digital_values_v2(digital_channels)

File "/usr/local/lib/python3.12/site-packages/ta_cmi/coe.py", line 124, in send_digital_values_v2

await self._api.send_digital_values_v2(channel)

File "/usr/local/lib/python3.12/site-packages/ta_cmi/coe_api.py", line 210, in send_digital_values_v2

await self._make_request_post(url, data)

File "/usr/local/lib/python3.12/site-packages/ta_cmi/api.py", line 36, in _make_request_post

await self._make_request_no_json(url, method="POST", body=body)

File "/usr/local/lib/python3.12/site-packages/ta_cmi/api.py", line 57, in _make_request_no_json

raise ApiError(

ta_cmi.api.ApiError: Invalid response from a824d5a9-ta-coe: 500

2024-05-24 07:18:48.238 DEBUG (MainThread) [custom_components.ta_coe] Try to update CoE

2024-05-24 07:18:48.239 DEBUG (MainThread) [ta_cmi] Update CoE data

2024-05-24 07:18:48.239 DEBUG (MainThread) [ta_cmi] Receive data from CoE server: http://a824d5a9-ta-coe:9000/receive/5

2024-05-24 07:18:48.239 DEBUG (MainThread) [ta_cmi] Sending request to http://a824d5a9-ta-coe:9000/receive/5 with None

2024-05-24 07:18:48.248 DEBUG (MainThread) [ta_cmi] Received payload: {"digital": [{"value": 0.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 0.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 1.0, "unit": 43}, {"value": 1.0, "unit": 43}], "analog": [{"value": 41.2, "unit": 8}, {"value": 29.6, "unit": 1}, {"value": 21.3, "unit": 1}, {"value": 65.1, "unit": 8}, {"value": 55.3, "unit": 8}, {"value": 22.9, "unit": 1}, {"value": 63.9, "unit": 8}, {"value": 23.1, "unit": 1}, {"value": 60.0, "unit": 8}, {"value": 23.1, "unit": 1}, {"value": 80.1, "unit": 8}, {"value": 14.9, "unit": 1}, {"value": 0.2, "unit": 11}, {"value": 0.04, "unit": 10}, {"value": 0.4, "unit": 11}, {"value": 0.0, "unit": 69}, {"value": -298.0, "unit": 69}, {"value": 2.2, "unit": 11}, {"value": 0.0, "unit": 11}, {"value": 61.3, "unit": 8}, {"value": 20.8, "unit": 1}, {"value": 23.2, "unit": 1}, {"value": 57.1, "unit": 8}, {"value": 17.0, "unit": 8}, {"value": 1638.0, "unit": 0}, {"value": 1638.0, "unit": 0}, {"value": 1638.0, "unit": 0}], "last_update_unix": 1716527923.100255, "last_update": "2024-05-24T07:18:43.100255", "can_id": 5}

2024-05-24 07:18:48.248 DEBUG (MainThread) [ta_cmi] Received data from CoE server: {'digital': [{'value': 0.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 0.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 1.0, 'unit': 43}, {'value': 1.0, 'unit': 43}], 'analog': [{'value': 41.2, 'unit': 8}, {'value': 29.6, 'unit': 1}, {'value': 21.3, 'unit': 1}, {'value': 65.1, 'unit': 8}, {'value': 55.3, 'unit': 8}, {'value': 22.9, 'unit': 1}, {'value': 63.9, 'unit': 8}, {'value': 23.1, 'unit': 1}, {'value': 60.0, 'unit': 8}, {'value': 23.1, 'unit': 1}, {'value': 80.1, 'unit': 8}, {'value': 14.9, 'unit': 1}, {'value': 0.2, 'unit': 11}, {'value': 0.04, 'unit': 10}, {'value': 0.4, 'unit': 11}, {'value': 0.0, 'unit': 69}, {'value': -298.0, 'unit': 69}, {'value': 2.2, 'unit': 11}, {'value': 0.0, 'unit': 11}, {'value': 61.3, 'unit': 8}, {'value': 20.8, 'unit': 1}, {'value': 23.2, 'unit': 1}, {'value': 57.1, 'unit': 8}, {'value': 17.0, 'unit': 8}, {'value': 1638.0, 'unit': 0}, {'value': 1638.0, 'unit': 0}, {'value': 1638.0, 'unit': 0}], 'last_update_unix': 1716527923.100255, 'last_update': '2024-05-24T07:18:43.100255', 'can_id': 5}

2024-05-24 07:18:48.248 DEBUG (MainThread) [custom_components.ta_coe] Finished fetching ta_coe data in 0.010 seconds (success: True)

DeerMaximum commented 3 weeks ago

Den Fehler mit dem Serverfehler 500 ist mit der neuen Addonversion behoben. Für den anderen Fehler bräuchte ich die Logs davor. Also vor diesem Block, damit ich weiß wie es dazu gekommen ist:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 365, in capability_attributes
    if state_class := self.state_class:
                      ^^^^^^^^^^^^^^^^
  File "/config/custom_components/ta_coe/sensor.py", line 86, in state_class
    if self.device_class in [SensorDeviceClass.ENERGY, SensorDeviceClass.WATER]:
       ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ta_coe/sensor.py", line 94, in device_class
    channel_raw: dict[str, Any] = self._coordinator.data[self._can_id][TYPE_SENSOR][
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 24