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

Add support lemesh.light.wy0d02 #1553

Open
hzonz opened this issue Jan 26, 2025 · 0 comments
Open

Add support lemesh.light.wy0d02 #1553

hzonz opened this issue Jan 26, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hzonz
Copy link

hzonz commented Jan 26, 2025

Device: Lemesh Color Temperature Lights Ultra
Model: lemesh.light.wy0d02
Support: Turn on/off, adjust brightness and color temperature.
More Information:
https://home.miot-spec.com/spec/lemesh.light.wy0d02

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    19733: ["LeMesh", "Lemesh Color Temperature Lights Ultra", "lemesh.light.wy0d02"],
    "spec": [
        BaseConv("light", "light", mi="2.p.1"),
        BrightnessConv("brightness", mi="2.p.2", max=100),
        ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500),
        MapConv("mode", "select", mi="2.p.7", map={0: "None", 4: "Day", 5: "Night", 7: "Warmth", 8: "Tv", 9: "Reading", 10: "Computer", 11: "Hospitality", 12: "Entertainment", 13: "Wakeup", 14: "Dusk", 15: "Sleep", 16: "Custom1", 17: "Custom2", 18: "Custom3", 19: "Custom4", 20: "Eye Protection", 21: "Breath", 22: "Beat", 23: "Rhythm"}),
        MapConv("power_on_state", "select", mi="2.p.9", map={0: "Default", 1: "ON", 2: "OFF"}),
        BoolConv("flex_switch", "switch", mi="2.p.12", entity=ENTITY_CONFIG),
        BoolConv("night_light", "switch", mi="2.p.13", entity=ENTITY_CONFIG),
        BoolConv("rhythm_switch", "switch", mi="7.p.7", entity=ENTITY_CONFIG),
    ],  
}] + DEVICES

The parameters are the same as 17687: ["LeMesh", "Scene Mesh Light V2S Pro", "lemesh.light.wy0c24"].

Issue:

BoolConv("flex_switch", "switch", mi="2.p.12", entity=ENTITY_CONFIG), BoolConv("night_light", "switch", mi="2.p.13", entity=ENTITY_CONFIG), BoolConv("rhythm_switch", "switch", mi="7.p.7", entity=ENTITY_CONFIG),
These three switches are not functioning correctly.

Debug log:

{'topic': 'miio/report', 'data': b'{"id":1977224921,"method":"_async.stat","params":{"version":1,"btstat_props":[{"did":"793531810","siid":2,"aiid":0,"piid":13,"control_type":2,"from":"4","rpc_addr":0,"control_times":1,"total":100,"cost":100,"ret":0,"result":0},{"did":"793531810","siid":7,"aiid":0,"piid":1,"control_type":2,"from":"4","rpc_addr":0,"control_times":1,"total":300,"cost":100,"ret":0,"result":0},{"did":"793531810","siid":2,"aiid":0,"piid":13,"control_type":2,"from":"4","rpc_addr":0,"control_times":1,"total":0,"cost":0,"ret":0,"result":0}]}}'}
 {'topic': 'miio/report', 'data': b'{"id":586052922,"method":"properties_changed","params":[{"did":"793531810","siid":2,"piid":13,"tid":1,"value":false}],"type":16}'}
 {'uid': '8446935abadb', 'did': '793531810', 'msg': 'on_report', 'data': {'night_light': False}}
{'topic': 'miio/report', 'data': b'{"id":1476567923,"method":"_async.stat","params":{"version":1,"btstat_props":[{"did":"793531810","siid":2,"aiid":0,"piid":13,"control_type":2,"from":"4","rpc_addr":0,"control_times":1,"total":100,"cost":100,"ret":0,"result":0}]}}'}
{'topic': 'miio/report', 'data': b'{"id":302434924,"method":"properties_changed","params":[{"did":"793531810","siid":2,"piid":13,"tid":2,"value":false}],"type":16}'}
{'uid': '8446935abadb', 'did': '793531810', 'msg': 'on_report', 'data': {'night_light': False}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants