Closed roschnei closed 4 months ago
Hey there @julius2342, mind taking a look at this issue as it has been labeled with an integration (velux
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
velux documentation velux source (message by IssueLinks)
I can confirm this issue. In my instance does this problem also occur.
2023.8.3
not sure
Home Assistant OS
Velux integration
https://www.home-assistant.io/integrations/velux/
Logger: homeassistant.components.websocket_api.http.connection
Source: components/velux/cover.py:106
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15. August 2023 um 16:24:11 (16 occurrences)
Last logged: 22:59:17
[140084151582400] <PyVLXException description="Unable to send command" />
[140084324631232] <PyVLXException description="Unable to send command" />
[140084465271872] <PyVLXException description="Unable to send command" />
[140083900086464] <PyVLXException description="Unable to send command" />
[140084085012928] <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" />
Action: activating a scene opening/closing 5 window covers. Expected behaviour/old behaviour: All covers move to a fully open or close state roughly at the same time. Observed behaviour: Some of the covers starts moving and drive to the commanded position the other covers does not start moving at all. In the most cases 2 out of 5 do not move.
In addition the covers move directly if the command is given manual in the HA UI instead through a configured scene.
I think there is an issue with the parallelism somewhere. I do not have the same issue per say, because I do not use scenes, only automation to pilot my somfy shutters. Before, one call to the service cover.close with all shutter entities would work to close them all. Now I have to do several sequential calls to the service with one target entity each time.
I do have the same issue, since 2023.8. Below you will find what I found in the logs!
File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 73, in close await self.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:
I’m using a combination of scenes and automations. In my case 2 shutters are opening, and two keep closed!
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 and https://github.com/pawlizio/my_velux/issues/28#issuecomment-1697833372
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.
Same with me: 2023.8 installed and the velux scene only pushes 2 devices on first click. After a few seconds failure message pops up + a re-start of the scene pushes further shutters to run.
i tried to include a "wait" or "delay" in scene = seems not to be possible. i also tried to include the entities in automations or scripts - but the velux entities do not allow to be used there? If it would be possible i would just add a delay or wait there of 500ms ...1 or 2 seconds if this fixes the issue.
at least i think hundreds of scenes of all shutters (i have about 30) open/close and combine them in automations with delays for each step might be a next try...
i would love if anyone has an idea which change failed this great feature (i use somfy io via klf200 included in home-assistant since more than a year very successfull and happy). Everything still works fine with manual control - but i miss the scene very much.
who is the scene master at home assistant and could identify the trouble between shooting commands >2 device on velux and fail ?!
i also tried to include the entities in automations or scripts - but the velux entities do not allow to be used there?
For covers/shutters, you have to call the services cover.close_cover
, cover.open_cover
or cover.set_cover_position
, and provide the entity as a parameter. The GUI of Home-assistant is great to assist you.
gijoe88 - you made my day! I added 3 calls of services in a automation: 3 covers grouped to set 80%, 1 with set 90%, 1 with set 80% again just to see grouping and sequence in one command: ALL worked! Sad that the scenes lost working and i have to re-adjust all my settings now. BUT: Solution found to get the morning and night closing back to work + sun-settings during the day! thank you gijoe88!
I have the same issue since 2023.8 and also with 2023.9.1. I’m on the last est version of the Velux Firmware!
I had the same issue in Home Assistant 2023.8.1 and I had to revert to 2023.7.3 which is the last working version.
I tried every new available HA version since but they all have the same (bad) behavior.
I also reverted back to 2023.7.3 and my scenes work again.
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]
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:
Looking at the history of ./helpers/service.py, it appears the file has been modified on the 2023.8.1 release in order to: Speed up single entity/response service calls #96729, notably around the line 870...
Maybe a first clue...
Hello everyone,
Since the migration to HA 2023.10, I have similar issues. When closing covers one by one, things are fine, yet scenes and services involving covers either fail or only handle two covers at a time. I see a temporary widget appearing mentioning an error I do not have time to read (disappears too quickly). Can you please advise? Thanks for your support.
NB: After some additional tests, it appears that if I create scripts and call covers one by one, things work fine. Anything I have tried that manages several covers seams to be buggy.
Same here
Same here. Using 5 covers with KLF200, I've set up 2 scenes - one to open all, another one to close them. Every time I ran any of the scenes some covers respond to the commands, and some don't. Sometimes it takes 2, sometimes 3 tries to get it right.
Same here
May I ask you to check the following: within the scene - comment out all entities execpt one, then except 2.
Nothing was changed in the unterlaying pyvlx library. My suspicion would be that something within hass was changed recently which triggers the activation in parallel (and no longer subsequential). It could be that the KLF200 is then overwhelmed.
If this is the case, we could try to mitigate this by adding some sort of lock?
I've switched to https://github.com/pawlizio/my_velux integration, it is working fine, has more features (like adjusting speed of covers) and is configured via UI.
That component contains an interesting commit: https://github.com/pawlizio/my_velux/commit/871129d3739716c66c38a6997f5086682d6fc02d
PARALLEL_UPDATES = 1
seems to be set within homeassistant component as well - but it obviously does not work.
@pawlizio : Do you have an idea why this works on your component but not in the general one?
Just installed https://github.com/pawlizio/my_velux, works perfectly. Devices are automatically created, instead of just entities. This component should be integrated in HA core.
My custom uses my pyvlx fork. Please check latest commits to see how I solved it. Have just limited possibilities now, can give more detailed feedback later.
[104 commits ahead], [13 commits behind] Julius2342:master.
Do you think we have the chance to bring both branches together?
Hello,
My KLF200 has got unreliable. I'm using the velux integration in homeassistant.
I made sure it gets rebooted when an HA restart is initiated. I also launch a velux.reboot_gateway every night.
I do own 4 velux cover and 3 velux blinds. They always work fine using the velux remote.
I get cases where the klf200 seems not manageable at all from homeassistant. In this case, a power cycle on the klf200 solves the situation.
I just got a strange case where I could control all covers and all blinds except one cover and one blind. Those were working find using the remote.
I never found how to enable logging on this part of HA. I tried
logger:
default: info
logs:
homeassistant.components.websocket_api.http.connection: debug
homeassistant.components.rest_command: debug
homeassistant.components.velux: debug
pyvlx: debug
After many restart I finally got everything in control... Until when ? My understanding is that the klf200 gets too many requests from ha and gets crazy.
I thought I might give a try to the my_velux and see if I get a reliable setup. Before going that route, I wanted to voice to that efforts are joined to take best from both developments and bring all that into HA. So many people would benefit from it.
An update last year change the behaviour in case were scenes are used to control the blinds or Windows. I changed my configuration and removed any scene based all automations. Maybe this helps to get more stability to your configuration, too!
I think this topic is solved, this issue was caused by a command burst which was not acknowleged by KF200. There was a change in pyvlx PR #353 to add a semaphore to the API interface which ensures that new commands are only send to KLF200 once the last command was acknowledged. It is part of latest version pyvlx 0.2.21 and is implemented to HA since version 2024.1.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I have been using Velux integration with my KLF 200 without any problems for the last couple of months. I have defined scenes for the 4 Velux covers on my south roof, one for the cover open position, one for the close position, and several scenes for different opening positions of the windows, which are used in automations. A couple of days ago I updated to the latest version of Home Assistant Core. I am unfortunately not sure which version I was using before but I must have skipped a few. I might have been at 2023.5 or 2023.6 (is there any way to check my previously installed version?) . Shortly after this upgrade, I discovered that my scenes were not working anymore. Most of the time, only one or two of the covers or windows are reacting, and only when activating the scene a second or third time the remaining covers or windows adapt their position. There is an error message in the core log related to this problem.
What version of Home Assistant Core has the issue?
core-2023.8.1
What was the last working version of Home Assistant Core?
2023.7.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Velux integration
Link to integration documentation on our website
https://www.home-assistant.io/integrations/velux/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
Action: activating a scene opening/closing 4 Velux shades/windows Expected behaviour: the 4 Velux shades/windows open/close at the same time Observed behaviour: only 1 or 2 Velux shades/windows open/close. A subsequent activation of the same scene opens/closes one additional shades/window. The remaining shade/window is then opened/closed with a third activation of the scene.