New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automations for setting the position of covers with Velux no longer work #72971
Comments
velux documentation |
Hey there @Julius2342, mind taking a look at this issue as it has been labeled with an integration ( |
I can confirm the same issue. Most likely the fact that the service calls are parallel instead of serial is causing the velux box to be overloaded with requests. I'm not familiar with the Velux code but I'll see if I can find a quick fix. |
Thank you for your fast response. Was there a change from serial to parallel for this? Or something else leading to this overload? Because before it worked for over 1 year without an error. And if the workaround works, could you change the asyncio.sleep() from 2 seconds to something shorter (e.g. 0.5 seconds)? :) |
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 |
I placed your patched version from your branch in custom_components/velux/ and unfortunately the error still occurs:
The throttle works:
Log-File:
|
sorry... wrong button |
OK, in my case it fixed all issues instantly but maybe I had a slightly different issue where only half of the screens/covers reacted on commands. Did you try to power cycle your velux box first ? Maybe it is already stuck. |
If I press each "open" button of all 7 covers very fast (in less than 2 seconds), all covers open without any problems. |
And is that "Unable to send command" error there each time you do execute your automation ? |
Yes, I have done a couple of power cycles today (Home Assistant and KLF 200). In the development console (kindly find below) the same exception occurs
I am using a script (not an automation) triggered by a button (or the schedule card). And yes, the exception keeps occurring all the time. (Sometimes the first two covers move). -edit- |
Thanks, that looks familiar to my situation. It fails when executing the "open_cover" call or "close_cover" service call when using multiple entities in the target. One by one it works fine. Does that error you pasted above still rise when you execute my modified code ? |
Yes, this code leads to the same error even with your change. (only 14 seconds later :) ) |
Just looked in my log and see the error popping up again... I'm wondering if there are any other integrations with this same issue... |
manifest: |
Does not really help but I can confirm the same issue. I had to revert back to HA 2022.5.5. I have groups of entities for my covers, and I get the same error when trying to close / open / set position those groups covers:
|
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 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? |
Correct, individual control works fine but things do sideways when you try to control multiple in one service call. This used to work fine for months/years |
I did some initial testing yesterday (on HA 2022.6.1 and PyVLX 0.2.20) and was not able to reproduce the problem. I did not use an automation, but called the cover.open / close / set_position services both with multiple cover entities supplied and a single cover group entity (containing 2 covers), all worked as expected for all covers. How is the above different from when you are experiencing problems? |
Thanks for looking at the issue. What I can tell is that I have groups between 4 and 15 covers, and I get the error when calling
|
@WhistleMaster I only have 3 covers in total, so if the problem is only occurring when controlling 4 or more covers, I’m afraid that I can’t be of much help in reproducing the issue 🙁 |
@Didel Sure, no problem ! Maybe we could provide some logs that could help ? |
I would like to thank you all for your efforts. I can also confirm and reproduce the problem with 4 covers. Using a script or automation and grouping the covers results in a partial respnse: only the first two covers respond. This issue is also new after upgrading to 2022.6 |
If you add logging as in the original description (in configuration.yaml :
) , do you get the same or other errors? |
I have a group of 4 cover entities that I could open/close/set position in one service call. Now at most 2 out of 4 entities respond.
I have included DEBUG output as requested in the previous post. |
I've adjusted the PR to a global lock. Works for me but maybe someone wants to test this too. |
@marcelveldt Wow! Good work! PR works. I can confirm with 7 covers: all opened without any issue. Thank you :) |
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
Anything in the logs that might be useful for us?
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
The text was updated successfully, but these errors were encountered: