-
Notifications
You must be signed in to change notification settings - Fork 26
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
Have the HueApiRateLimits of node-hue-api configurable #542
Comments
I already tried to manipulate the local code on my node-modules folder, both the connection string as well as the Defaults in the API files. But without success, yet. |
I think the api itself does configure the minTime of the Ratelimits itself within the file My workaround is to set the minTime-value in this file to another value. This works like desired and fires the events for multiple groups with the shorter delay (previously 1000ms). |
@seb2010 : I'm migrating currently from hue-extended adapter. I observed that when I switch on/off multiple light, that it is dramatically slower, so a waiting time of aprox. 1 second between each single light. Is this connected to your issue? |
@seb2010 : Now I understood you speak about commands for multiple groups. If I'm right I have the same issue just with multiple lights. Comming from hue-extended adapter this behaviour feels like stone age in terms of performance. |
@foxriver76 : Hi Foxriver. Is there a chance to get the Hue-Extended performance soon into this adapter as well? I'm on the way to migrate currently but stuck here as I have so many lights to be swich together (switch on a dedicated ligth setting as well as switching off everything for the night). With sripts I figured out that a waiting time btw. different lights of 150ms works perfect for me. Many many thanks in advance!!! |
@seb2010 : Any idea how to workaround even for lights, instead of groups? Many many thanks in advance!!! |
@RkcCorian : problem is, that the library used by the hue adapter is not maintained by the same developer. This library sets the timeout intervals for each command. You can most probably work around the issue by issuing a similar modification to this libraries code. |
@seb2010 : Hmmm... many thanks! Unfortunately I do not know what exactly has to be issued to whom. 😬 |
Rate limit comes from node-hue-api and is currently not configurable. My time resources for this adapter are currently limited but I am happy over PRs. Feel free to create a issue/PR at https://github.com/peter-murray/node-hue-api to make the limit configurable should not be a problem but as far as I know it sticks to the official rate limits (12 calls per second) https://github.com/peter-murray/node-hue-api#rate-limiting |
@seb2010 , @foxriver76 : Many thanks! Now I realized that I also used in my ALIAS everywhere the group names, even for those where I have a 1 to 1 relation btw. group and light, so I could change for some of them. So which means I have currently the exact same issue like seb2010. |
As best practice I can only say, use groups over controlling single lights whenever possible to keep requests low. |
@seb2010 : I managed it, just had to restart the adapter. Stupid question... with "exec("sed -i 's/minTime: 1000/minTime: 50/g' /opt/iobroker/node_modules/node-hue-api/lib/api/Groups.js")" the resulting waiting time is now 50ms? Or what is the resulting time? |
@RkcCorian : yes, by modifying the Groups.js file in the node.hue-api module folder, you will end up with a delay between subsequent commands for light-groups of 50ms. |
Hello,
I am migrating from another adapter which was able to trigger light-group statechanged at the same time. When digging into the code I think I identified the root cause why iobroker.hue is not behaving the same is that iobroker.hue does not set any custom HueApiRateLimits parameters when connecting to the v3 API. Therefor, the API uses the default wait-time between requests of 1000ms (https://github.com/peter-murray/node-hue-api/blob/081da8354c761d3405ddf240ed53d83e01ee7a6c/src/api/HueApiRateLimits.ts).
You can pass custom RateLimits as a third connection-parameter as it seems. Format should be like this:
https://github.com/peter-murray/node-hue-api/blob/081da8354c761d3405ddf240ed53d83e01ee7a6c/src/api/HueApiRateLimits.ts
Is it possible to include the option to set custom RateLimits in the adapter?
Unfortunately I am not knowledgable enough on typescrtipt and the whole git-procedure, so I cannot support with actual code-changes here.
Hope you consider this.
KR
SEB
The text was updated successfully, but these errors were encountered: