-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support for light devices #997
Open
make-all
wants to merge
14
commits into
smartHomeHub:master
Choose a base branch
from
make-all:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Any news for this PR?? Would be nice to be able to add lights through SmartIR |
Hi! Any chance of this PR to be marged into main? Would be a great addition. Thanks! |
This PR will address #939 also |
Open
Supports commands for on/off, brighten/dim, colder/warmer and night. Start with a configuration for an Iris Ohyama light.
Total steps is 10 (5 in each direction from "centre"), not 5.
- Save the previous value in closest_match so we can judge whether it was closer than the higher value. - There are various cases where we support brightness, so use a separate variable to track that - Add some debug logging to changes - Don't fallback to the "on" command when we got a brightness or color temperature but decided it was the same step we are on, so didn't do anything.
The remote has "Full" (full brightness, mid color temp), "Night" (nightlight) and "Memory recall" buttons for turning on, and a "Memory set" button for saving the current brightness and color temp in memory. - Use the "Memory save" before the "off" command to save as we turn off. - Use "Memory recall" rather than "Full" for turning on.
When using this with Adaptive lighting, during the day the light keeps beeping due to reaching the end of its range every 90s. This is because Adaptive lighting is trying to adjust the brightness and color temperature, but they are not actually moving because of the limited number of steps. Putting the resync code inside the condition that we actually need to move the brightness should prevent this, and only resync when we are actually changing to the end of the range.
Still waiting for the merge, would be great to see this PR in the next release :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for lights with IR or RF remote controls.
Support for color temperature and brightness control is provided, with the assumption that each function is driven by "up" and "down" commands. When color temperature or brightness is set to the end of the range, more commands than necessary are deliberately issued to attempt to resync the light in case the remote has been used.
Initial configuration is for an Iris Ohyama dome ceiling light sold in Japan. In addition to the 10 step brightness and color temperature controls, this light also contains a nightlight, which is turned on by setting brightness to 1 (0.4%, which cannot be mistakenly selected in the UI, as that only goes down to 1%). It also contains a memory feature, which is used to have better control over the turn-on brightness and color temperature, and an off timer feature which is not implemented here.
Note: The icon may be using a slightly different font than the others, and should probably be redone by someone who knowss the details of how the others were made to be consistent.
Required HA version was updated from 2022.4 to 2022.5 to get COLOR_TEMP_KELVIN support, as mireds were deprecated in 2022.11, so any new light implementation should use Kelvin.