yenoiwesa / homebridge-connexoon

A homebridge plugin to integrate Somfy blinds with the Connexoon RTS hub
Apache License 2.0
27 stars 2 forks source link

EXEC_QUEUE_FULL exception when controlling more than 10 devices #13

Closed HomekitDave closed 4 years ago

HomekitDave commented 4 years ago

Hi there,

I’m getting an ErrorCode: ‘EXE_QUEUE_FULL’ execution queue is full on gateway... (soft limit 10)

For the home bridge-tahoma @dubocr implemented a homebridge sending command queue (~ 14th April) Can this be implemented for Connexoon?

yenoiwesa commented 4 years ago

Hi @HomekitDave,

Yes that seems very sensible. I will have to implement a job queue. For my own information, how did you end up in a situation where 10 commands were active at the same time? Do you have more than 10 devices or is that something else?

HomekitDave commented 4 years ago

Hey @yenoiwesa, thanks!

Yes I do, I created a HomeKit scene that included 13 curtain tracks, a number of them closed successfully but others didn’t, I can’t say exactly what order.

For anyone who’s interested; I created a Siri workaround for now, grouping curtains into two HomeKit scenes, then using a Siri shortcut with a Wait to stagger the execution.

yenoiwesa commented 4 years ago

Hi @HomekitDave , I made a change to retry requests 8sec after they have failed if they failed with error code EXEC_QUEUE_FULL.

Could you please confirm that this works for you, using this version of the platform with npm (don't forget -g if you use a global install for the plugin):

npm install yenoiwesa/homebridge-connexoon#7a90859366820ef9a3dab119b510e34549e91786

If it all works okay then I will merge the branch to master and release a new version.

Please note that this is based off v2.0.0 of the plugin, so please have a look at the release notes for this version as there is a breaking change in the platform's configuration: Release 2.0.0

HomekitDave commented 4 years ago

Hi @yenoiwesa, Firstly, have you got some kind of tip jar? ;)

Failed at the first hurdle... I'm getting an error on installing, here is the log file;

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'install',
1 verbose cli   'yenoiwesa/homebridge-connexoon#7a90859366820ef9a3dab119b510e34549e91786',
1 verbose cli   '-g' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose npm-session 02e8277fbe0709e8
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:yenoiwesa/homebridge-connexoon#7a90859366820ef9a3dab119b510e34549e91786 Error while executing:
7 silly fetchPackageMetaData undefined ls-remote -h -t ssh://git@github.com/yenoiwesa/homebridge-connexoon.git
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData spawn git ENOENT
8 timing stage:rollbackFailedOptional Completed in 2ms
9 timing stage:runTopLevelLifecycles Completed in 67ms
10 verbose stack Error: spawn git ENOENT
10 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
10 verbose stack     at onErrorNT (internal/child_process.js:415:16)
10 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
11 verbose cwd /home/user
12 verbose Linux 5.4.0-37-generic
13 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "yenoiwesa/homebridge-connexoon#7a90859366820ef9a3dab119b510e34549e91786" "-g"
14 verbose node v10.19.0
15 verbose npm  v6.14.4
16 error code ENOENT
17 error syscall spawn git
18 error path git
19 error errno ENOENT
20 error enoent Error while executing:
20 error enoent undefined ls-remote -h -t ssh://git@github.com/yenoiwesa/homebridge-connexoon.git
20 error enoent
20 error enoent
20 error enoent spawn git ENOENT
21 error enoent This is related to npm not being able to find a file.
22 verbose exit [ 1, true ]

As a side note; My Tracks are currently set as Shades on the Connexion to get them to "auto recognise" for Homebridge-connexoon, It would be great to enable that for Tracks (One Way/Two Way Curtain on Connexoon App) Some of Apples Home Apps ignore the image customisation so they still look like Shades on Apple Watch for example. I'm also wondering if the UI could be a toggle, Open, My, Close, instead of the percentage slider; It's probably not possible given the AccessoryCategoryType... just two thoughts.

Let me know about a tip jar - Thanks again!!!

yenoiwesa commented 4 years ago

Hi @HomekitDave, I couldn't find any error that relates to yours on the web 🤔 Since you are installing globally, did you prefix your command with sudo? If not, then try that.

Installing with this command definitely works on my end.

As for the device type, I can definitely add support for the Tracks and map them to window coverings in Homekit. What I will need you to do is to change back the device type to Tracks in the Somfy app, and then start the Homebridge server in debug mode (-D when launching homebridge). The homebridge-connexoon platform will print Ignored device of type XXX in the logs. Then I will need that XXX value to map it into the code base.

But let's first get you running with the version above.

yenoiwesa commented 4 years ago

Also regarding:

I'm also wondering if the UI could be a toggle, Open, My, Close, instead of the percentage slider; It's probably not possible given the AccessoryCategoryType... just two thoughts.

This is something that I already handle in version 2.0 of the platform. By default the slider now has three "steps" (or "positions"): open, my and closed. You can customize that if you want to have only two positions as described in the README.md file 😃

yenoiwesa commented 4 years ago

I have just added Curtain (and a few others) as a valid device type that maps back to a Homekit Window Covering device.

You can use this commit hash instead:

sudo npm install -g yenoiwesa/homebridge-connexoon#44d8a5ac99927a425e6f0f975f920343268131fa
HomekitDave commented 4 years ago

More than happy to give you any details for mapping you need - Very Exciting!

Okay, it's probably my fault but, I'm still getting the below: Using this: sudo npm install -g yenoiwesa/homebridge-connexoon#44d8a5ac99927a425e6f0f975f920343268131fa

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'yenoiwesa/homebridge-connexoon#44d8a5ac99927a425e6f0f975f920343268131fa' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose npm-session 2097bec1e25abaf9
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:yenoiwesa/homebridge-connexoon#44d8a5ac99927a425e6f0f975f920343268131fa Error while executing:
7 silly fetchPackageMetaData undefined ls-remote -h -t ssh://git@github.com/yenoiwesa/homebridge-connexoon.git
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData spawn git ENOENT
8 timing stage:rollbackFailedOptional Completed in 2ms
9 timing stage:runTopLevelLifecycles Completed in 66ms
10 verbose stack Error: spawn git ENOENT
10 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
10 verbose stack     at onErrorNT (internal/child_process.js:415:16)
10 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
11 verbose cwd /home/user
12 verbose Linux 5.4.0-37-generic
13 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "yenoiwesa/homebridge-connexoon#44d8a5ac99927a425e6f0f975f920343268131fa"
14 verbose node v10.19.0
15 verbose npm  v6.14.4
16 error code ENOENT
17 error syscall spawn git
18 error path git
19 error errno ENOENT
20 error enoent Error while executing:
20 error enoent undefined ls-remote -h -t ssh://git@github.com/yenoiwesa/homebridge-connexoon.git
20 error enoent
20 error enoent
20 error enoent spawn git ENOENT
21 error enoent This is related to npm not being able to find a file.
22 verbose exit [ 1, true ]
HomekitDave commented 4 years ago

@yenoiwesa Great news, I've managed to update to V2.0 using that commit hash, updating to the latest git version solved it!

I've changed the types in the Connexoon app back to curtains (one way / two way), they added automatically absolute fine and I can now successfully control all the tracks at once via a scene, plus the 0%, "50%", 100% positions work great!

...You'll have to forgive me but I did try to see if I could break it... I set all to close and then all to open before everything had completed, most reopened with a single exemption, I had turned on debug mode just to see what would happen; I got, Execution queue is full, re-attempting in 8000ms, and then eventually... Execution queue is full, too many attempts where made (5), giving up.

To be honest, as long as one is patient, it's not going to be an issue.

Thanks!!!

yenoiwesa commented 4 years ago

Alright @HomekitDave so that wasn't particularly easy but I think I made it better.

Could you please try with the following version:

npm install -g yenoiwesa/homebridge-connexoon#edd87817783ab21710a16bd159a401fd6f93422e

The change I have made is that, if a given device had a command being queued (due to a retry attempt), then a subsequent command on the same device would first abort the previous one, cancelling the waiting. This should normally ensure that each device only has at most one queued command for it. Fingers crossed... 🤞

Please let me know 😃

HomekitDave commented 4 years ago

Hey @yenoiwesa YES 😃 That's done it and try as I might, I haven't been able to break it!

Thank you so much!

I'm gonna be cheeky and ask one more thing... 🙊, Do you know if I can change the wording in the "status" area on the Home App (where it says, 5 lights on, Hall at 20° etc.), it currently says 13 Blinds Open, could I change it to Curtains? - I'm guessing not.

Thanks so much again!😃 - Give this guy a medal!

yenoiwesa commented 4 years ago

That's great, thanks for the testing @HomekitDave!

I just released v2.0.1 of the platform with all the changes you have been testing. It's the same code as the version I had you install before but I recommend installing the published version:

npm install -g yenoiwesa/homebridge-connexoon@^2.0.1

As for the label in the Home app summary saying "blinds" instead of "curtains", I am afraid that is totally in Apple's control right now, I don't think that can be changed.

Have you tried maybe changing all your curtains icons to be curtains in the Home app, under each accessory setting?

Screen Shot 2020-06-25 at 9 08 22 am

Additionnally, note that the Home app display for that section will change this fall with iOS 14 and will look like this: Apple_ios14-my-home-app-screen_06222020_carousel jpg large

It's still likely to mention "blinds" though.

HomekitDave commented 4 years ago

Hi @yenoiwesa, Thanks, will do!

Ah okay that’s what I’d thought, yes I had already changed the icons, doesn’t make a difference to wording; never mind, first world problems 😉

Watched WWDC the other night, can’t wait for the updates! 👍

yenoiwesa commented 4 years ago

Cheers! 🥳