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

Added Amico 52 inch Smart Ceiling Fan #1954

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Conversation

hwhesselink
Copy link
Contributor

Hi,

This is for https://amicolight.com/collections/ceiling-fan-light/products/amico-6-speeds-52-inch-3cct-5-blade-ceiling-fan-with-light-and-remote-alexa-google-home.

I'd hoped to be able to use "step" in the mapping to limit the travel of the HA slider to 3 positions but I've not been able to get that to work.

Cheers,

Henk Hesselink

@hwhesselink
Copy link
Contributor Author

To clarify the "step" remark: I meant the color_temp mapping. With e.g. the (1-6) speed setting the slider will only settle on a multiple of 16% - if you select any other value the slider will go to the nearest 16% multiple. With the (1-3) color_temp setting you can almost always set a value that is not a multiple of 33%. The light itself only has 3 temps so will go to the nearest multiple, but the slider doesn't match.

Replacing the 3 dps_val/values pairs with the line "step: 1500" results in an error message about the target value not being between "3000.0 and 6000.0". so maybe there's a int/float mismatch somewhere? I've tried various ways of using step but none worked so I settled on what it is now.

@make-all
Copy link
Owner

HA does not have an interface for specifying the color temperature step, so this cannot be enforced at the UI level. The value should snap to the nearest supported value after the value has been set. The correct way to specify is with range (1-3) and target_range (3000-6000), since it does not just need to scale up, but also to shift into the correct range.

@hwhesselink
Copy link
Contributor Author

hwhesselink commented May 29, 2024

Yes, that's what I originally had. The problem is that the slider doesn't snap (unlike e.g. with speed, which does).

With speed as I drag the slider the value also "snaps". I.e. the value stays the same as I drag until I reach a new range and then the value changes to that (in this case in 16% increments). When I release the slider it snaps to that value. This is, obviously, the expected behavior.

With color_temp I can drag the slider and the value changes continuously. When I release the slider it stays wherever I release it. If I drag the slider past the half-way point between 2 "snap points" (so 3750K between 3000 and 4500) then the slider briefly jumps to the next snap point and then starts following the cursor again. The slider only occasionally snaps when I release it.

So the value of the underlying object changes to a supported value with the brief jump but the slider can be put almost anywhere. It seems like the "range" setting is not being interpreted correctly.

My config uses target_range to set the top and bottom values of the slider. Just using that and range would have the 3 temps at 3K, 4.5K and 6K so I use dps/value pairs to make that 3K, 4K and 6K per the fan documentation.

@make-all make-all merged commit c261950 into make-all:main Jun 8, 2024
4 checks passed
make-all added a commit that referenced this pull request Jun 8, 2024
timlaing pushed a commit to timlaing/tuya-local that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants