core: Automations for setting the position of covers with Velux no longer work
The problem
After updating to 2022.6.0 or 2022.6.1, I can still use the Velux integration to retrieve or set the position of individual cover entries. Unfortunately, my automations (scheduled or manually started) no longer work.
What version of Home Assistant Core has the issue?
2022.6.1
What was the last working version of Home Assistant Core?
2022.5.5
What type of installation are you running?
Home Assistant OS
Integration causing the issue
velux
Link to integration documentation on our website
https://www.home-assistant.io/integrations/velux/
Diagnostics information
No response
Example YAML snippet
velux:
host: !secret velux_ip
password: !secret velux_password
logger:
default: warn
logs:
homeassistant.components.velux: debug
pyvlx: debug
Anything in the logs that might be useful for us?
2022-06-03 10:59:05 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall cover.open_cover (c:01G4MCJEGY59MDP1YBDTT08E6B): entity_id=['cover.office', 'cover.kitchen', 'cover.floor', 'cover.floor_door', 'cover.living_left', 'cover.living_second', 'cover.living_door']>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1722, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1741, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 717, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/velux/cover.py", line 96, in async_open_cover
await self.node.open(wait_for_completion=False)
File "/usr/local/lib/python3.9/site-packages/pyvlx/opening_device.py", line 58, in open
await self.set_position(
File "/usr/local/lib/python3.9/site-packages/pyvlx/opening_device.py", line 47, in set_position
raise PyVLXException("Unable to send command")
pyvlx.exception.PyVLXException: <PyVLXException description="Unable to send command" />
2022-06-03 10:59:27 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id="6" state="5" current_position="0x0000" target="0x0000" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="2079-03-11 10:16:48"/>
2022-06-03 10:59:27 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id="6" state="5" current_position="0x0000" target="0x0000" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="2079-03-11 10:16:48"/>
2022-06-03 10:59:41 DEBUG (MainThread) [pyvlx] SEND: <FrameGetStateRequest/>
2022-06-03 10:59:41 DEBUG (MainThread) [pyvlx] REC: <FrameGetStateConfirmation gateway_state="GatewayState.GATEWAY_MODE_WITH_ACTUATORS" gateway_sub_state="GatewaySubState.IDLE"/>
Additional information
Due to the changelogs pyvlx got bumped to 0.2.20 in dev #72678 ( Changelog for pyvlx 0.2.20: https://github.com/Julius2342/pyvlx/releases/tag/0.2.20 )
The same error occurs with the service cover.set_cover_position
Home Assistant and KLF200 were restarted a few times for troubleshooting purposes
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (8 by maintainers)
@marcelveldt Wow! Good work!
PR works. I can confirm with 7 covers: all opened without any issue. Thank you 😃
velux.zip
I’ve adjusted the PR to a global lock. Works for me but maybe someone wants to test this too. Attached the changed files as zip, you can place the velux folder in custom_components
I’m the author of #72678 , not sure if I can be of any help here. Note that the change does indeed only bump the underlying version of PyVLX to a higher version, no other changes are included. Also note that the PR has been merged into develop, but it is not (yet) included in the 2022.6.X release (and maybe never will, it might be part of 2022.7, or even later). If you want to locally test the changes, either use the dev branch of home assistants, or copy the Velux folder from the dev branch into custom_components, add a version number key with a value to the manifest file as described in the documentation and restart HA.
So, to recap, the problem you’re facing is that it fails when running automations or having a group of covers that you try to control at once? I individually control mine them using a dedicated button for each, but haven’t had problems so far. Perhaps I can try to group them and see if that results in the same error?
Just looked in my log and see the error popping up again… Maybe try to set the previous version of the lib (.19) in the manifest.json ? Looking at the integration code itself the only related change is the bump of the library to version .20, otherwise only HA core changes that may be related.
I’m wondering if there are any other integrations with this same issue…
0.5 seconds is not enough I think. I just tested this with a bunch of covers (kind of stress testing) and with 0.5secs it was still hit and miss, hence the 2 seconds. Maybe 1 second is enough.
A lot of changes happened lately in relation to speedups and with the new additions to let your whole automation/script run in parallel I think this slipped in as a side effect. Actually a good thing because we want as many to happen in parallel as possible