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

[New device request] Ledkia fan with light controller #234

Closed
bedtiming opened this issue Sep 17, 2022 · 7 comments
Closed

[New device request] Ledkia fan with light controller #234

bedtiming opened this issue Sep 17, 2022 · 7 comments

Comments

@bedtiming
Copy link

bedtiming commented Sep 17, 2022

Hi, I have tried to integrate this device with no success. No information about the device DP appears in the log. The DP returned by the explorer API seem to be totally different from the standard ones. Any way to integrate it into this component? Any help would be greatly appreciated!
The DP of the API explorer are as follows

{ "result": { "category": "fsd", "functions": [ { "code": "switch_led", "dp_id": 20, "type": "Boolean", "values": "{}" }, { "code": "work_mode", "dp_id": 21, "type": "Enum", "values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}" }, { "code": "bright_value", "dp_id": 22, "type": "Integer", "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "temp_value", "dp_id": 23, "type": "Integer", "values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "colour_data", "dp_id": 24, "type": "Json", "values": "{}" }, { "code": "scene_data", "dp_id": 25, "type": "String", "values": "{\"maxlen\":255}" }, { "code": "control_data", "dp_id": 28, "type": "String", "values": "{\"maxlen\":255}" }, { "code": "brightness_min_1", "dp_id": 58, "type": "Integer", "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "led_type_1", "dp_id": 59, "type": "Enum", "values": "{\"range\":[\"led\",\"incandescent\",\"halogen\"]}" }, { "code": "fan_switch", "dp_id": 60, "type": "Boolean", "values": "{}" }, { "code": "fan_speed", "dp_id": 62, "type": "Integer", "values": "{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}" }, { "code": "fan_direction", "dp_id": 63, "type": "Enum", "values": "{\"range\":[\"forward\",\"reverse\"]}" }, { "code": "countdown_left_fan", "dp_id": 64, "type": "Integer", "values": "{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}" } ], "status": [ { "code": "switch_led", "dp_id": 20, "type": "Boolean", "values": "{}" }, { "code": "work_mode", "dp_id": 21, "type": "Enum", "values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}" }, { "code": "bright_value", "dp_id": 22, "type": "Integer", "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "temp_value", "dp_id": 23, "type": "Integer", "values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "colour_data", "dp_id": 24, "type": "Json", "values": "{}" }, { "code": "scene_data", "dp_id": 25, "type": "String", "values": "{\"maxlen\":255}" }, { "code": "brightness_min_1", "dp_id": 58, "type": "Integer", "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}" }, { "code": "led_type_1", "dp_id": 59, "type": "Enum", "values": "{\"range\":[\"led\",\"incandescent\",\"halogen\"]}" }, { "code": "fan_switch", "dp_id": 60, "type": "Boolean", "values": "{}" }, { "code": "fan_speed", "dp_id": 62, "type": "Integer", "values": "{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}" }, { "code": "fan_direction", "dp_id": 63, "type": "Enum", "values": "{\"range\":[\"forward\",\"reverse\"]}" }, { "code": "countdown_left_fan", "dp_id": 64, "type": "Integer", "values": "{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}" } ] }, "success": true,

@bedtiming
Copy link
Author

My bad, I had the log set to ERROR.
Now this is the log:
Device matches None with quality of 0%. DPS: {'20': False, '21': 'white', '22': 82, '60': False, '63': 'forward', '64': 0, 'updated_at': 1663453710.8056939}

@make-all make-all added the new device Unsupported device label Sep 18, 2022
make-all added a commit that referenced this issue Sep 18, 2022
This has a light type switch according to the docs at iot.tuya.com, though the value is not showing in the sample data captured by the log.

Since the colour temperature and color options only make sense for LED lights, this is used to restrict those settings to only when LED lights are configured.  But if that value is never returned, then it will always only work as a dimmer.  In any case, we cannot know the capabilities of the LED bulb fitted - some are not even dimmable.

Issue #234
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Sep 18, 2022
@make-all
Copy link
Owner

I added a config file for this, but as a lot of the documented values are not being returned in the log, it is difficult to know whether the config is correct. In particular, I have had to guess at the format for color_data (I guessed it will be the same as another supported bulb that uses the same dps indexes and ranges for colour_temp and brightness).

make-all added a commit that referenced this issue Sep 18, 2022
Missed to add the new config file in previous commit.

Issue #234
@bedtiming
Copy link
Author

the lamp is a dimmable white light LED and it is possible to change only the color temperature in three preset values that change the value of COLOR_TEMP which in this case is TEMP_VALUE (DP23) in 0 -> 500 -> 1000 (warm white, white light, cold white).
WORK_MODE (DP 21) is always WHITE.
BRIGHT_VALUE (DP 22) accepts values from 10 to 1000
COLOR_DATA (DP 24) is always empty (there are no settings in the tuya app on smartphone or remote control)
SCENE_DATA (DP 25) is always empty (same as above)
LED_TYPE_1 (DP 59) is always LED

There is a timer, COUNTDOWN_LEFT_FAN that accepts values from 0 to 540.

@bedtiming
Copy link
Author

debugging

@bedtiming
Copy link
Author

I copied the file to the device directory, restarted home assistant but nothing has changed.
I can't understand why.

info

make-all added a commit that referenced this issue Sep 18, 2022
It seems that the iot.tuya.com documentation is misleading.
 - colour_mode is always white, never any of the other values.
 - bulb type is LED, not changeable.
 - color/scene/music are therefore never available.

Issue #234
@bedtiming
Copy link
Author

Almost perfect. the fan works perfectly.
when I send commands to the light, it seems to get a double command sometimes, especially when changing the brightness or color temperature.
Could it be that all the data is sent even if only one is changed?
However it can be fine, I really appreciate your work!
In your opinion, can be added DP to exclude the "beep" that is heard at each command?

@make-all make-all removed new device Unsupported device unreleased Will be in next release awaiting confirmation Wating for confirmation the issue is solved labels Sep 19, 2022
@make-all
Copy link
Owner

I removed one condition I'd put on the color temp that might have been causing two dps to be set at once. If the behaviour persists please file a new bug with a full description of what appears to be going wrong.

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

No branches or pull requests

2 participants