sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
71 stars 8 forks source link

Error with vindstyrka env sensor #7

Closed acces90 closed 4 months ago

acces90 commented 4 months ago

while loading the dirigera devices I get this error for my vindstyrka environment sensor:

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:344 Integration: Sensor (documentation, issues) First occurred: 17:49:44 (1 occurrences) Last logged: 17:49:44

Error while setting up dirigera_platform platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/dirigera_platform/sensor.py", line 55, in async_setup_entry env_sensors.append(ikea_vindstyrka_temperature(env_device)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/sensor.py", line 159, in init super().init(ikea_env_device, "TEMP", "Temperature") File "/config/custom_components/dirigera_platform/sensor.py", line 131, in init self._unique_id = self._ikea_env_device.unique_id() + id_suffix ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'str' object is not callable

though that might be from the fact, that I have the latest dirigera (1.0.9) installed?

JSON dump:


{
      "id":"1468825a-6725-440f-9606-97e7b0834024_1",
      "type":"sensor",
      "deviceType":"environmentSensor",
      "createdAt":"2023-09-17T10:51:59.000Z",
      "isReachable":true,
      "lastSeen":"2024-02-27T17:53:49.000Z",
      "attributes":{
         "customName":"Luftsensor",
         "model":"VINDSTYRKA",
         "manufacturer":"IKEA of Sweden",
         "firmwareVersion":"1.0.11",
         "hardwareVersion":"1",
         "serialNumber":"30FB10FFFEDF8CC0",
         "productCode":"E2112",
         "currentTemperature":21,
         "currentRH":47,
         "currentPM25":41,
         "maxMeasuredPM25":999,
         "minMeasuredPM25":0,
         "vocIndex":36,
         "identifyStarted":"2000-01-01T00:00:00.000Z",
         "identifyPeriod":0,
         "permittingJoin":false,
         "otaStatus":"upToDate",
         "otaState":"readyToCheck",
         "otaProgress":0,
         "otaPolicy":"autoUpdate",
         "otaScheduleStart":"00:00",
         "otaScheduleEnd":"00:00"
      },
      "capabilities":{
         "canSend":[

         ],
         "canReceive":[
            "customName"
         ]
      },
      "room":{
         "id":"1a846fdc-317c-4d94-8722-cb0196256a16",
         "name":"Wohnzimmer",
         "color":"ikea_green_no_66",
         "icon":"rooms_arm_chair"
      },
      "deviceSet":[

      ],
      "remoteLinks":[

      ],
      "isHidden":false
   }
sanjoyg commented 4 months ago

Waiting for answer on the other thread, will commit post that which should fix this issue as well

sanjoyg commented 4 months ago

Pull the latest release and do let me know if it fixes the issues

acces90 commented 4 months ago

I get this

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:352
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 18:18:34 (1 occurrences)
Last logged: 18:18:34

Error while setting up dirigera_platform platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass

and this


Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:533
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 18:18:34 (1 occurrences)
Last logged: 18:18:34

Error adding entities for domain sensor with platform dirigera_platform
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass
acces90 commented 4 months ago

wait, the sensor shows all the attributes in homeassistant, I believe this is also some errors for the starkvind issue*

Nah I think it's vindstyrka related, since the error is thrown when the env sensor is initialized


2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_controller ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_temperature ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_humidity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_pm25 ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_pm25 ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_pm25 ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_vindstyrka_voc_index ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] ikea_env_base_entity ctor...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] Found 1 env devices to setup...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] Found 6 env entities to setup...
2024-02-28 18:18:34.571 DEBUG (MainThread) [custom_components.dirigera_platform] EnvSensor & Controllers Complete async_setup_entry
2024-02-28 18:18:34.572 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_temperature
2024-02-28 18:18:34.573 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_humidity
2024-02-28 18:18:34.574 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_current_pm2_5
2024-02-28 18:18:34.574 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_max_measured_pm2_5
2024-02-28 18:18:34.575 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_min_measured_pm2_5
2024-02-28 18:18:34.575 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.dirigera_platform entity: sensor.luftsensor_voc_index
2024-02-28 18:18:34.579 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform dirigera_platform
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass
2024-02-28 18:18:34.590 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up dirigera_platform platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass
sanjoyg commented 4 months ago

thats weird, have the environment sensors stopped working?

acces90 commented 4 months ago

Ive restartet Homeassistant a few times now. Sometimes the error gets thrown but everything works as it should. Sometimes the vindstyrka needs a minute to come up as an device. But then it still works just fine from what I see. I dunno. I'll test around some more after work.

sanjoyg commented 4 months ago

ok... great.. am closing this off.