pawlizio / my_velux

Custom component of velux integration for Home Assistant
31 stars 9 forks source link

error: DualRollerShutter.close() got an unexpected keyword argument 'velocity' #28

Closed tombrain closed 11 months ago

tombrain commented 1 year ago

hello @pawlizio,

since the last update i get an error message and the dualshutters don't work anymore. the simple ones still work fine.

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/velux/cover.py:223
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 21:27:37 (1 occurrences)
Last logged: 21:27:37

[140166350452800] DualRollerShutter.close() got an unexpected keyword argument 'velocity'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/velux/cover.py", line 223, in async_close_cover
    await self.node.close(wait_for_completion=False, velocity=velocity, curtain=self.subtype)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DualRollerShutter.close() got an unexpected keyword argument 'velocity'
dumpfheimer commented 1 year ago

Sorry, this most likely was my fault. I'll look into it.

dumpfheimer commented 1 year ago

Please update and test if it works now

tombrain commented 1 year ago

@dumpfheimer Version 'master'?

tombrain commented 1 year ago

I've tested master. I works better but not fine.

Close upper -> works Then Stop upper -> upper stops, but the lower begin going down :-(

Same scenerio If Press lower up

It works like complete buttons

And this exception

''' Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/velux/cover.py:226 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 09:59:31 (3 occurrences) Last logged: 09:59:38

[139714237905728] Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call response_data = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/velux/cover.py", line 226, in async_close_cover await self.node.close(**kwargs) File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 460, in close await self.set_position( File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 429, in set_position raise PyVLXException("Unable to send command") pyvlx.exception.PyVLXException: '''

pawlizio commented 12 months ago

Can you activate debugging and share the whole log. I need to understand the single steps to understand whats going on. Below the config section you need to add to your configuration.yaml to do so.

logger:
  default: warning
  logs:
    pyvlx: debug
    custom_components.velux: debug
pawlizio commented 12 months ago

Please update to latest custom version and restart HA, then please test. I added velocity argment also for DualRollerShutters. Hope this can be closed then.

crivchri commented 12 months ago

Hi,

I still have similar issues with Home Assistant 2023.8.4 (Core), updated to the latest versions from the UI, when opening several covers at the same time. However I do not know how to check which version of Velux component I have.

Also reported in: https://github.com/pawlizio/my_velux/issues/27#issuecomment-1697828002

I get following error several times:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/velux/cover.py:106 
Integration: Home Assistant WebSocket API (documentation, issues) 
First occurred: 18:50:51 (6 occurrences) 
Last logged: 18:51:41

[139751897971008] <PyVLXException description="Unable to send command" />
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 334, in async_activate
    await async_reproduce_state(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 67, in async_reproduce_state
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 61, in worker
    await platform.async_reproduce_states(
  File "/usr/src/homeassistant/homeassistant/components/cover/reproduce_state.py", line 125, in async_reproduce_states
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/cover/reproduce_state.py", line 86, in _async_reproduce_state
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/velux/cover.py", line 106, in async_set_cover_position
    await self.node.set_position(
  File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 49, in set_position
    raise PyVLXException("Unable to send command")
pyvlx.exception.PyVLXException: <PyVLXException description="Unable to send command" />

Thank you in advance for your help and kind regards.

pawlizio commented 11 months ago

"Unable to send command" issue is different to "got an unexpected keyword argument 'velocity'". This issue belongs to velocity, so please do not mix.