Skip to content

Error adding entities for domain sensor with platform kaco #7

@iliyankxyz

Description

@iliyankxyz

Version of the custom_component

I am using the latest version pulled by Home Asisstant from git i.e. version
d498e4d

Configuration

sensor:
  - platform: kaco
    name: Solar Power 1
    url: 192.168.0.50

sensor:
  - platform: kaco
    name: Solar Power 2
    url: 192.168.0.51

Describe the bug

When I try to add one of my Kaco inverters I am getting success, but no sensors appear and lot's of errors are logged.
This error happens only with one and the same inverter 'Solar South' Solar Power 1.
Both inverters are blueplanet 5.0 TL3 SW version 5.53

Debug log


2022-02-15 15:20:41 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.kaco
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] Config via Storage/UI
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco] initialize the date coordinator for IP 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] KACO config: 
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	name: Inverter South
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	url: 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	icon: mdi:solar-power
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] KACO config: 
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	name: Inverter South
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	url: 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	icon: mdi:solar-power
2022-02-15 15:20:41 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform kaco
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in _async_add_entity
    if entity.unique_id is not None:
  File "/config/custom_components/kaco/sensor.py", line 91, in unique_id
    return self.coordinator.data["extra"]["serialno"] + self._valueKey
TypeError: 'NoneType' object is not subscriptable
2022-02-15 15:20:41 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kaco platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in _async_add_entity
    if entity.unique_id is not None:
  File "/config/custom_components/kaco/sensor.py", line 91, in unique_id
    return self.coordinator.data["extra"]["serialno"] + self._valueKey
TypeError: 'NoneType' object is not subscriptable


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions