Skip to content
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

"Unable to send command" debug #331

Closed
palfrey opened this issue Sep 6, 2023 · 10 comments · Fixed by #353
Closed

"Unable to send command" debug #331

palfrey opened this issue Sep 6, 2023 · 10 comments · Fixed by #353

Comments

@palfrey
Copy link
Collaborator

palfrey commented Sep 6, 2023

So, I've been seeing a lot of the following in my Home Assistant logs recently

File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 49, in set_position
    raise PyVLXException("Unable to send command")

which is starting to get a bit annoying. Any thoughts on how to debug this, or at least get more information than just "computer says no", because I'd love to sort this one out.

@palfrey
Copy link
Collaborator Author

palfrey commented Sep 6, 2023

To clarify some details on this, this is with Home Assistant 2023.8.4. I'm pretty sure I didn't used to see this, so guessing it's an upgrade change at some point, but not sure exactly when as I was doing auto-upgrades for a while. Generally, this only happens when I'm running a scene (i.e. a bunch of velux changes in one go), although I was able to reproduce this earlier when just clicking a whole set of windows at once, so guessing it's probably to do with the gap between commands?

@00-10-01-11
Copy link

00-10-01-11 commented Sep 12, 2023

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 HA version since but they all have the same behavior.

@palfrey
Copy link
Collaborator Author

palfrey commented Sep 17, 2023

I have a very hacky workaround with time.sleep filed in Core (home-assistant/core#100523) and we'll see where that gets to...

@OXERY
Copy link

OXERY commented Sep 19, 2023

I mainly see this issue when activating a scene that closes all my velux window covers. It seems that the library or klf200 is overwhelmed by the requests?
When playing around with only one window cover, it works as expected. When activating the scene mentioned before, not all window covers are closing/opening - and the ones not moving are always the same.
I was using an automation for opening and closing, which isn't working currently. Maybe I have to work around that like @palfrey and change the automation to issue only one command at a time.

@rjlee
Copy link

rjlee commented Sep 27, 2023

@spitfire
Copy link

I mainly see this issue when activating a scene that closes all my velux window covers. It seems that the library or klf200 is overwhelmed by the requests? When playing around with only one window cover, it works as expected. When activating the scene mentioned before, not all window covers are closing/opening - and the ones not moving are always the same. I was using an automation for opening and closing, which isn't working currently. Maybe I have to work around that like @palfrey and change the automation to issue only one command at a time.

for me they are always different. If I run my close or open scene again in HA they eventually get to the right state.

@palfrey
Copy link
Collaborator Author

palfrey commented Nov 23, 2023

@Julius2342 Any thoughts on a PR to add the option for minimum delays between calls to KLF 200 devices? Like home-assistant/core#100523, but folded into the library and redone to only add delays on subsequent rapid calls, not all of them.

@pawlizio
Copy link
Collaborator

I implemented a semaphore to avoid parallel commands as the HA solution seems not work... Here the corresponding commit:

pawlizio@7032496

@Julius2342
Copy link
Owner

Hmm, probably a semaphore. I would have done it quite highlevel, e.g. in ApiEvent/do_api_call . What do you think?

@palfrey
Copy link
Collaborator Author

palfrey commented Nov 25, 2023

Hmm, probably a semaphore. I would have done it quite highlevel, e.g. in ApiEvent/do_api_call . What do you think?

That seems sensible to me. #353 does this, and also solves the "why doesn't this first call respond?" issue I was seeing before in HA by making sure we're connected before entering the Semaphore section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants