Skip to content
This repository was archived by the owner on Sep 4, 2021. It is now read-only.

DeviceSchemas

clach04 edited this page Feb 2, 2018 · 22 revisions

A collection of schemas showing different ids and parameter.

If you add any entries, please pretty print the entries to be indented and sorted on key. E.g. in Python:

json.dumps(schema, indent=4, sort_keys=True)  # note probably will escape non-ascii characters

or:

json.dumps(schema, indent=4, sort_keys=True, ensure_ascii=False)

For non-Chinese readers, https://translate.google.com/ is great for determining what some items are.

See https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md for instructions on how to get the schema for your device(s).

RGB Bulb

'Expower' branded bulb. No obvious model number https://www.amazon.co.uk/Expower-Dimmable-Control-Smartphone-Equivalent/dp/B075Q9NHF2

See https://github.com/codetheweb/tuyapi/issues/5#issuecomment-361212775 for some thoughts on payload.

{
    "schema": [
        {
            "code": "led_switch", 
            "desc": "", 
            "iconname": "icon-dp_power", 
            "id": 1, 
            "mode": "rw", 
            "name": "开关", 
            "property": {
                "type": "bool"
            }, 
            "type": "obj"
        }, 
        {
            "code": "work_mode", 
            "desc": "", 
            "iconname": "icon-dp_mode", 
            "id": 2, 
            "mode": "rw", 
            "name": "工作模式", 
            "property": {
                "range": [
                    "white", 
                    "colour", 
                    "scene", 
                    "scene_1", 
                    "scene_2", 
                    "scene_3", 
                    "scene_4"
                ], 
                "type": "enum"
            }, 
            "type": "obj"
        }, 
        {
            "code": "bright_value", 
            "desc": "", 
            "iconname": "icon-dp_sun", 
            "id": 3, 
            "mode": "rw", 
            "name": "亮度值", 
            "property": {
                "max": 255, 
                "min": 25, 
                "scale": 0, 
                "step": 1, 
                "type": "value", 
                "unit": ""
            }, 
            "type": "obj"
        }, 
        {
            "code": "temp_value", 
            "desc": "", 
            "iconname": "icon-dp_light", 
            "id": 4, 
            "mode": "rw", 
            "name": "冷暖值", 
            "property": {
                "max": 255, 
                "min": 0, 
                "scale": 0, 
                "step": 1, 
                "type": "value", 
                "unit": ""
            }, 
            "type": "obj"
        }, 
        {
            "code": "colour_data", 
            "desc": "rgbhsv", 
            "id": 5, 
            "mode": "rw", 
            "name": "彩光模式数", 
            "property": {
                "maxlen": 14, 
                "type": "string"
            }, 
            "type": "obj"
        }, 
        {
            "code": "scene_data", 
            "desc": "rgbhsv", 
            "id": 6, 
            "mode": "rw", 
            "name": "情景模式数", 
            "property": {
                "maxlen": 14, 
                "type": "string"
            }, 
            "type": "obj"
        }, 
        {
            "code": "flash_scene_1", 
            "desc": "", 
            "id": 7, 
            "mode": "rw", 
            "name": "柔光情景", 
            "property": {
                "maxlen": 14, 
                "type": "string"
            }, 
            "type": "obj"
        }, 
        {
            "code": "flash_scene_2", 
            "desc": "", 
            "id": 8, 
            "mode": "rw", 
            "name": "缤纷情景", 
            "property": {
                "maxlen": 44, 
                "type": "string"
            }, 
            "type": "obj"
        }, 
        {
            "code": "flash_scene_3", 
            "desc": "", 
            "id": 9, 
            "mode": "rw", 
            "name": "炫彩情景", 
            "property": {
                "maxlen": 14, 
                "type": "string"
            }, 
            "type": "obj"
        }, 
        {
            "code": "flash_scene_4", 
            "desc": "", 
            "id": 10, 
            "mode": "rw", 
            "name": "斑斓情景", 
            "property": {
                "maxlen": 44, 
                "type": "string"
            }, 
            "type": "obj"
        }
    ]
}

SKYROKU SM-PW701U

https://fccid.io/2AJ5F-SM-PW701U/User-Manual/User-Manual-3200205

Affiliate link Smart Plug, SKYROKU 2 Pack SM-PW701U Wi-Fi Plug No Hub Required, Works with Alexa Echo Control Your Devices from Anywhere

Single Switch (110v and 220v):

[
{
    "code": "switch_on", 
    "name": "\u5f00\u5173", 
    "iconname": "icon-dp_power2", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 1, 
    "desc": ""
}, 
{
    "code": "countdown", 
    "name": "\u5012\u8ba1\u65f6", 
    "iconname": "icon-dp_time", 
    "passive": True, 
    "mode": "rw", 
    "property": {
        "scale": 0, 
        "min": 0, 
        "max": 86400, 
        "step": 1, 
        "type": "value", 
        "unit": "\u79d2"
    }, 
    "type": "obj", 
    "id": 2, 
    "desc": ""
}
]

Wuudi SM-S0301-US

4 AC switches 1 USB switch (note usb switch controls 4 USB ports) - 110v

Affiliate Link Jinvoo WiFi Smart Power Strip Surge Protector Plus 4 Outlet 4 USB Ports Charging Station,Works with Amazon Alexa

[
{
    "code": "switch_s1", 
    "name": "\u5f00\u5173s1", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 1, 
    "desc": ""
}, 
{
    "code": "switch_s2", 
    "name": "\u5f00\u5173s2", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 2, 
    "desc": ""
}, 
{
    "code": "switch_s3", 
    "name": "\u5f00\u5173s3", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 3, 
    "desc": ""
}, 
{
    "code": "switch_s4", 
    "name": "\u5f00\u5173s4", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 4, 
    "desc": ""
}, 
{
    "code": "switch_usb", 
    "name": "\u5f00\u5173usb", 
    "mode": "rw", 
    "property": {
        "type": "bool"
    }, 
    "type": "obj", 
    "id": 5, 
    "desc": ""
}, 
{
    "code": "switch_all", 
    "name": "\u5168\u90e8\u5f00\u5173\u63a7\u5236", 
    "mode": "rw", 
    "property": {
        "scale": 0, 
        "min": 0, 
        "max": 1, 
        "step": 1, 
        "type": "value", 
        "unit": "m"
    }, 
    "type": "obj", 
    "id": 6, 
    "desc": ""
}
]
Clone this wiki locally