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

Can mesh switch show more attributes ? #1330

Closed
mickey50 opened this issue Apr 18, 2024 · 7 comments
Closed

Can mesh switch show more attributes ? #1330

mickey50 opened this issue Apr 18, 2024 · 7 comments
Labels
question Further information is requested

Comments

@mickey50
Copy link

I have a mesh switch , It can show lots of attributes when use the xiaomi Miot Auto but none when use XiaoMiGateway3 , How can i
get the attributes from xiaomgateway3 localy ,thank you!
image

@AlexxIT AlexxIT added the question Further information is requested label Apr 18, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 18, 2024

You should read docs and write converter

@mickey50
Copy link
Author

mickey50 commented Apr 19, 2024

You should read docs and write converter

image
my mesh switch has no "brand", "name", "market model" so I write like

DEVICES = [{
    "12261": [None, None, None],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),  # bool
        MapConv("icon-style", "select", mi="5.p.1", map={0: "Lamp-bulb", 1: "Cylindrical-spotlight"}),
    ],
}] + DEVICES

it not work ,and I change value to the values from Miot Auto like

from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
    "12261": ["linju", None, "linju.switch.sw0a01"],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),  # bool^M
        MapConv("icon-style", "select", mi="5.p.1", map={0: "Lamp-bulb", 1: "Cylindrical-spotlight"}),
    ],
}] + DEVICES

It still not work . what can I do next ? Thank you !

@AlexxIT
Copy link
Owner

AlexxIT commented Apr 19, 2024

Model should be integer

@mickey50
Copy link
Author

thank you ,it works .

@AlexxIT
Copy link
Owner

AlexxIT commented Apr 19, 2024

Please post your results. It can be useful for other users

@mickey50
Copy link
Author

mickey50 commented Apr 21, 2024

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    12261: ["linju", "Lingju Bluetooth Mesh Switch", "(linju.switch.sw0a01)"],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),  # bool
        BoolConv("指示灯开关", "switch", mi="3.p.2"),
        BoolConv("R脚辅助开关", "switch", mi="3.p.6"),
        MapConv("灵动模式", "select", mi="3.p.4", map={
            0: "关闭", 1: "开启"
        }),
        MapConv("通电后默认状态", "select", mi="2.p.2", map={
            0: "恢复断电前状态", 1: "开启", 2: "关闭"
        }),
        MapConv("互控功能", "select", mi="3.p.3", map={
            1: "互控", 2: "解控"
        }),
        MapConv("icon-style", "select", mi="3.p.5", map={
            0: "灯泡", 1: "射灯", 2: "吸顶灯", 3: "吊灯", 4: "灯带", 5: "小家电", 6: "插座", 7: "阀门", 8: "电机"
        }),
    ],
}] + DEVICES

the state like "icon-style" can use for trggier event from mi_app to ha locally (mi_app -> Xiaomi Smart Hub Gateway ->trigger unused mesh device attributes ->xiaomigateway3 -> HA)

AlexxIT added a commit that referenced this issue Apr 23, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants