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

Fix for badly behaving RGB smart lights with HomeKit color picker #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

godofcpu
Copy link

I added 3 optional settings to the config that help tremendously with my inovelli smartlights to stop sending multiple commands to set the color or level. By default when either the level or color is changed, homekit will send an on and setLevel command or a setHue and setSaturation command. This can cause the light to flicker as it cycles between both settings. In the worse case scenario, it appears that homekit will get confused and switch the hue and saturation back and forth and not set the combined command values when sending both as individual commands. This changes the plugin to look to see if two compatible commands are sent in very close proximity of each other. It delays sending the first one until the second is received, then sends a setColor command, if a second command isn't received within 50ms (configurable) or so, it sends just the first command by itself. If none of the config values are specified, the default behavior isn't changed.

New config values are below:
"use_set_color": true, // This turns on setColor processing and will combine setHue and setSaturation commands that are received within dedupe_command_delay_ms of each other
"dedupe_command_delay_ms": 10, // The amount of time to wait for a second command
"squash_on_commands": ["setLevel"] // This is a list of commands that receive an 'on' command before a setLevel, this will squash the on command and just send a setLevel command

Chuck Holbrook added 8 commits October 10, 2020 18:00
…y inovelli smartlights to stop sending mulitple commands to set the color or level. By default when either the level or color is changed, homekit will send an on and setLevel command or a setHue and setSaturation command. This can cause the light to flicker as it cycles between both settings. In the worse case scenario, it appears that homekit will get confused and switch the hue and saturation back and forth and not set the combined command values when sending both as invidual comamnds. This changes the plugin to look to see if two compatible commands are sent in very close proximity of each other. It delays sending the first one until the second is recieved, then sends a setColor command, if a second command isn't recieved within 50ms (configurable) or so, it sends just the first command by itself. If none of the config values are specified, the default behavior isn't changed.

New config values are below:
            "use_set_color": true,  // This turns on setColor processing and will combine setHue and setSaturation commands that are recieved within dedupe_command_delay_ms of each other
            "dedupe_command_delay_ms": 10, // The amount of time to wait for a second command
            "squash_on_commands": ["setLevel"] // This is a list of commands that receive an 'on' command before a setLevel, this will squash the on command and just send a setLevel command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant