sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
101 stars 12 forks source link

Error with STARKVIND air purifier fan mode #61

Closed dreamfalcon closed 1 week ago

dreamfalcon commented 1 month ago
pydantic.error_wrappers.ValidationError: 1 validation error for AirPurifier
attributes -> fanMode
  value is not a valid enumeration member; permitted: 'off', 'low', 'medium', 'high', 'auto' (type=type_error.enum; enum_values=[<FanModeEnum.OFF: 'off'>, <FanModeEnum.LOW: 'low'>, <FanModeEnum.MEDIUM: 'medium'>, <FanModeEnum.HIGH: 'high'>, <FanModeEnum.AUTO: 'auto'>])

The dump:

{
      "id":"xxx",
      "type":"airPurifier",
      "deviceType":"airPurifier",
      "createdAt":"2024-07-02T16:13:55.000Z",
      "isReachable":true,
      "lastSeen":"2024-08-01T11:42:44.000Z",
      "attributes":{
         "customName":"Purificador de ar Sala",
         "model":"STARKVIND Air purifier",
         "manufacturer":"IKEA of Sweden",
         "firmwareVersion":"1.1.001",
         "hardwareVersion":"1",
         "serialNumber":"xxx",
         "productCode":"E2007",
         "fanMode":"on",
         "fanModeSequence":"lowMediumHighAuto",
         "motorState":20,
         "motorRuntime":24,
         "filterElapsedTime":42991,
         "filterAlarmStatus":false,
         "filterLifetime":259200,
         "childLock":false,
         "statusLight":true,
         "currentPM25":21,
         "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",
            "fanMode",
            "fanModeSequence",
            "motorState",
            "childLock",
            "statusLight"
         ]
      }
   }
dreamfalcon commented 1 month ago

Today start working after updating the hub firmware. Edit: The fan speed is still missing, and current pm25 is not created as a sensor. Tried adding in the sensor.py, but no luck.

sanjoyg commented 3 weeks ago

Let me have a look at it, would u mind pasting the latest dump or can I use the dump above

dreamfalcon commented 3 weeks ago

{ 'id': 'dc683f2c-xxxx-xxxx-xxxx-c222f3889319_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:38:40.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:11.000Z', 'attributes': { 'customName': 'Purificador de ar Mariana', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 50, 'motorRuntime': 48292, 'filterElapsedTime': 52192, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '96214f3c-f38e-4e8d-a041-e20564e4de1c', 'name': 'Quarto Mariana', 'color': 'ncs_s_1020_r10b', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': 'bccac551-xxxx-xxxx-xxxx-d8a151afd1a0_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:34:48.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:31.000Z', 'attributes': { 'customName': 'Purificador de ar Margari', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'auto', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 25, 'motorRuntime': 45624, 'filterElapsedTime': 49479, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '8401956a-xxxx-xxxx-xxxx-56f45e37ad4c', 'name': 'Quarto Margarida', 'color': 'ikea_yellow_no_24', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': '9aeee79b-xxxx-xxxx-xxxx-98b5508626ca_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-07-02T15:13:55.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:57:11.000Z', 'attributes': { 'customName': 'Purificador de ar Sala', 'model': 'STARKVIND Air purifier', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2007', 'fanMode': 'low', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 20, 'motorRuntime': 24, 'filterElapsedTime': 63731, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 20, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '7a075ad9-xxxx-xxxx-xxxx-edda1343c2c9', 'name': 'Sala', 'color': 'ikea_orange_no_11', 'icon': 'rooms_arm_chair' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }

I dont understand why sometims the fanMode is on and others low, medium, high or auto.
sanjoyg commented 3 weeks ago

thank you, can you please do me a favour. Set the fan mode to low take the JSON dump, then set the fan mode to medium and take JSON dump so on so forth for all modes and send that. that way I will be able to figure.

On Sat, Aug 17, 2024 at 2:34 PM Daniel @.***> wrote:

{ 'id': 'dc683f2c-xxxx-xxxx-xxxx-c222f3889319_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:38:40.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:11.000Z', 'attributes': { 'customName': 'Purificador de ar Mariana', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 50, 'motorRuntime': 48292, 'filterElapsedTime': 52192, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '96214f3c-f38e-4e8d-a041-e20564e4de1c', 'name': 'Quarto Mariana', 'color': 'ncs_s_1020_r10b', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': 'bccac551-xxxx-xxxx-xxxx-d8a151afd1a0_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:34:48.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:31.000Z', 'attributes': { 'customName': 'Purificador de ar Margari', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'auto', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 25, 'motorRuntime': 45624, 'filterElapsedTime': 49479, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '8401956a-xxxx-xxxx-xxxx-56f45e37ad4c', 'name': 'Quarto Margarida', 'color': 'ikea_yellow_no_24', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': '9aeee79b-xxxx-xxxx-xxxx-98b5508626ca_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-07-02T15:13:55.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:57:11.000Z', 'attributes': { 'customName': 'Purificador de ar Sala', 'model': 'STARKVIND Air purifier', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2007', 'fanMode': 'low', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 20, 'motorRuntime': 24, 'filterElapsedTime': 63731, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 20, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '7a075ad9-xxxx-xxxx-xxxx-edda1343c2c9', 'name': 'Sala', 'color': 'ikea_orange_no_11', 'icon': 'rooms_arm_chair' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }

I dont understand why sometims the fanMode is on and others low, medium, high or auto.

— Reply to this email directly, view it on GitHub https://github.com/sanjoyg/dirigera_platform/issues/61#issuecomment-2294801354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2X3CXLIQJM2FXJJBAZSUDZR4G3HAVCNFSM6AAAAABL2J4GTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUHAYDCMZVGQ . You are receiving this because you commented.Message ID: @.***>

dreamfalcon commented 2 weeks ago

thank you, can you please do me a favour. Set the fan mode to low take the JSON dump, then set the fan mode to medium and take JSON dump so on so forth for all modes and send that. that way I will be able to figure. On Sat, Aug 17, 2024 at 2:34 PM Daniel @.> wrote: { 'id': 'dc683f2c-xxxx-xxxx-xxxx-c222f3889319_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:38:40.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:11.000Z', 'attributes': { 'customName': 'Purificador de ar Mariana', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 50, 'motorRuntime': 48292, 'filterElapsedTime': 52192, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '96214f3c-f38e-4e8d-a041-e20564e4de1c', 'name': 'Quarto Mariana', 'color': 'ncs_s_1020_r10b', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': 'bccac551-xxxx-xxxx-xxxx-d8a151afd1a0_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-06-23T15:34:48.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:59:31.000Z', 'attributes': { 'customName': 'Purificador de ar Margari', 'model': 'STARKVIND Air purifier table', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2006', 'fanMode': 'auto', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 25, 'motorRuntime': 45624, 'filterElapsedTime': 49479, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 9, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '8401956a-xxxx-xxxx-xxxx-56f45e37ad4c', 'name': 'Quarto Margarida', 'color': 'ikea_yellow_no_24', 'icon': 'rooms_bed' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False }, { 'id': '9aeee79b-xxxx-xxxx-xxxx-98b5508626ca_1', 'type': 'airPurifier', 'deviceType': 'airPurifier', 'createdAt': '2024-07-02T15:13:55.000Z', 'isReachable': True, 'lastSeen': '2024-08-17T08:57:11.000Z', 'attributes': { 'customName': 'Purificador de ar Sala', 'model': 'STARKVIND Air purifier', 'manufacturer': 'IKEA of Sweden', 'firmwareVersion': '1.1.001', 'hardwareVersion': '1', 'serialNumber': 'xxxxxxxxxxxxx', 'productCode': 'E2007', 'fanMode': 'low', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 20, 'motorRuntime': 24, 'filterElapsedTime': 63731, 'filterAlarmStatus': False, 'filterLifetime': 259200, 'childLock': False, 'statusLight': True, 'currentPM25': 20, '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', 'fanMode', 'fanModeSequence', 'motorState', 'childLock', 'statusLight'] }, 'room': { 'id': '7a075ad9-xxxx-xxxx-xxxx-edda1343c2c9', 'name': 'Sala', 'color': 'ikea_orange_no_11', 'icon': 'rooms_arm_chair' }, 'deviceSet': [], 'remoteLinks': [], 'isHidden': False } I dont understand why sometims the fanMode is on and others low, medium, high or auto. — Reply to this email directly, view it on GitHub <#61 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2X3CXLIQJM2FXJJBAZSUDZR4G3HAVCNFSM6AAAAABL2J4GTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUHAYDCMZVGQ . You are receiving this because you commented.Message ID: @.>

auto: 'fanMode': 'auto', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 30,

off: 'fanMode': 'off', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 0,

1 set on app: 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 10,

1 set on device:

'fanMode': 'low', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 10,

2 set on app: 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 20,

2 set on device:

'fanMode': 'low', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 20,

3 set on app: 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 30,

3 set on device:

'fanMode': 'medium', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 30,

4 set on app: 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 40,

4 set on device:

'fanMode': 'medium', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 40,

5 set on app: 'fanMode': 'on', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 50,

5 set on device:

'fanMode': 'high', 'fanModeSequence': 'lowMediumHighAuto', 'motorState': 50,

sanjoyg commented 2 weeks ago

So I found the issue, its with the downstream base library. Have submitted a pull request to the base library, once merged and released will update the version to get the latest

sanjoyg commented 2 weeks ago

Will you try now with the new release

dreamfalcon commented 2 weeks ago

The error disappeared, but no information about the motorState. Could that be added?

image
sanjoyg commented 2 weeks ago

Sure, will try and add it. Do note one cannot change the motor state though.

dreamfalcon commented 2 weeks ago

Is that a limitation of the base library?

sanjoyg commented 2 weeks ago

ACtually not, let me try and add it

sanjoyg commented 2 weeks ago

Please try the new release , should support preset_mode and fan speed %

dreamfalcon commented 2 weeks ago
image

Its working, many thanks.

dreamfalcon commented 2 weeks ago

Getting a error when using the preset speeds. "Failed to call service fan/set_preset_mode. no running event loop".

2024-08-28 08:14:58.257 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Portão rua data: Error fetching data: DeviceConnectionError() 2024-08-28 08:42:35.457 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547255789328] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 278, in async_handle_set_preset_mode_service await self.async_set_preset_mode(preset_mode) File "/config/custom_components/dirigera_platform/fan.py", line 282, in async_set_preset_mode await self._device.async_set_preset_mode(preset_mode) File "/config/custom_components/dirigera_platform/fan.py", line 224, in async_set_preset_mode await self._hass.async_add_executor_job(self.set_fan_mode, mode_to_set) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/fan.py", line 202, in set_fan_mode self._hass.async_add_executor_job(self._json_data.set_fan_mode, preset_mode) File "/usr/src/homeassistant/homeassistant/core.py", line 880, in async_add_executor_job tracked = asyncio.current_task() in self._tasks ^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: no running event loop

sanjoyg commented 2 weeks ago

is this consistent? seems device connection error

dreamfalcon commented 2 weeks ago

is this consistent? seems device connection error

yes, setting the fan speed by percentage works fine.

sanjoyg commented 2 weeks ago

can u try the new release, I dont ahve an actual purifier to test with

dreamfalcon commented 2 weeks ago

Same. 2024-08-28 11:18:42.973 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546959673664] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 278, in async_handle_set_preset_mode_service await self.async_set_preset_mode(preset_mode) File "/config/custom_components/dirigera_platform/fan.py", line 282, in async_set_preset_mode await self._device.async_set_preset_mode(preset_mode) File "/config/custom_components/dirigera_platform/fan.py", line 224, in async_set_preset_mode await self._hass.async_add_executor_job(self.set_fan_mode, mode_to_set) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/fan.py", line 202, in set_fan_mode self._hass.async_add_executor_job(self._json_data.set_fan_mode, preset_mode) File "/usr/src/homeassistant/homeassistant/core.py", line 880, in async_add_executor_job tracked = asyncio.current_task() in self._tasks ^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: no running event loop

sanjoyg commented 2 weeks ago

Try now

dreamfalcon commented 2 weeks ago

Now I don't have purifier values.

Logger: homeassistant.components.fan Source: helpers/entity_platform.py:364 integration: Fan (documentation, issues) First occurred: 15:42:20 (1 occurrences) Last logged: 15:42:20

Error while setting up dirigera_platform platform for fan Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/dirigera_platform/fan.py", line 49, in async_setup_entry hub_air_purifiers : list[AirPurifier] = await hass.async_add_executor_job(hub.get_air_purifiers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 170, in get_air_purifiers return [dict_to_air_purifier(air_p, self) for air_p in airpurifiers] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/devices/air_purifier.py", line 78, in dict_to_air_purifier return AirPurifier( ^^^^^^^^^^^^ File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 1 validation error for AirPurifier attributes -> fanMode value is not a valid enumeration member; permitted: 'off', 'low', 'medium', 'high', 'auto' (type=type_error.enum; enum_values=[<FanModeEnum.OFF: 'off'>, <FanModeEnum.LOW: 'low'>, <FanModeEnum.MEDIUM: 'medium'>, <FanModeEnum.HIGH: 'high'>, <FanModeEnum.AUTO: 'auto'>])

sanjoyg commented 1 week ago

That is weird, this error was fixed by the down stream library. Do remove the integration and add it again please.

dreamfalcon commented 1 week ago

That worked. Now I don't get errors on the UI but the fan speed dosen't change with the presets speeds. Could this log be related? 2024-08-29 21:13:09.997 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1991: RuntimeWarning: coroutine 'ikea_starkvind_air_purifier_device.async_set_fan_mode' was never awaited handle = None # Needed to break cycles when an exception occurs.

sanjoyg commented 1 week ago

Try the new release, if it doesnt work do enable debug and include the debug log

dreamfalcon commented 1 week ago

Its working :) The only issue is the fan speed taking a while to update, but not a big issue. Thanks.