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

KS220M(US) Dump - WIP #94

Open
natemacinnes opened this issue Nov 14, 2021 · 2 comments
Open

KS220M(US) Dump - WIP #94

natemacinnes opened this issue Nov 14, 2021 · 2 comments

Comments

@natemacinnes
Copy link

natemacinnes commented Nov 14, 2021

Working on collecting commands for the new KS220M(US).
Request:

{
    "system": {
        "get_sysinfo":{}
    },
    "context":{
        "source":"xxx-xxx-xxx-xxx-xxx"
    }
}

Response:

{
    "system": {
        "get_sysinfo": {
            "sw_ver": "1.0.4 Build 210616 Rel.193517",
            "hw_ver": "1.0",
            "model": "KS220M(US)",
            "deviceId": "xxxx",
            "oemId": "xxx",
            "hwId": "xxx",
            "rssi": -45,
            "latitude_i": 459522,
            "longitude_i": -741095,
            "alias": "xxx",
            "status": "new",
            "mic_type": "IOT.SMARTPLUGSWITCH",
            "feature": "TIM",
            "mac": "xxx",
            "updating": 0,
            "led_off": 1,
            "relay_state": 1,
            "brightness": 44,
            "on_time": 19,
            "icon_hash": "",
            "dev_name": "Wi-Fi Smart Dimmer with sensor",
            "active_mode": "none",
            "next_action": {
                "type": -1
            },
            "preferred_state": [
                {
                    "index": 0,
                    "brightness": 100
                },
                {
                    "index": 1,
                    "brightness": 75
                },
                {
                    "index": 2,
                    "brightness": 50
                },
                {
                    "index": 3,
                    "brightness": 25
                }
            ],
            "err_code": 0
        }
    }
}

Request

{
    "smartlife.iot.sensor_trigger": {
        "get_weekday_routine": {}
    },
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    }
}

Response

{
    "smartlife.iot.sensor_trigger": {
        "get_weekday_routine": {
            "array": [
                {
                    "en": 1,
                    "name": "xxx",
                    "id": "0",
                    "wday": [
                        1,
                        1,
                        1,
                        1,
                        1,
                        1,
                        1
                    ],
                    "array": [
                        {
                            "sT": 960,
                            "eT": 1860,
                            "clr": 0,
                            "onTT": 2,
                            "offTT": 2,
                            "offWT": 120,
                            "onST": 1,
                            "onFT": 0,
                            "offFT": 0,
                            "onBrt": 1
                        }
                    ]
                }
            ],
            "err_code": 0
        }
    }
}

Request

{
    "smartlife.iot.sensor_trigger": {
        "edit_weekday_routine": {
            "wday": [
                1,
                1,
                1,
                1,
                1,
                1,
                1
            ],
            "array": [
                {
                    "offWT": 120,
                    "onBrt": 1,
                    "onTT": 2,
                    "eT": 1865,
                    "onST": 1,
                    "sT": 960,
                    "offTT": 2,
                    "clr": 0
                }
            ],
            "en": true,
            "id": "0",
            "name": "xxx"
        }
    },
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    }
}

Response

    {
    "smartlife.iot.sensor_trigger": {
        "edit_weekday_routine": {
            "err_code": 0
        }
    }
}

Request

{
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    },
    "smartlife.iot.sensor_trigger": {
        "get_default_manual_action": {}
    }
}

Response

{
    "smartlife.iot.sensor_trigger": {
        "get_default_manual_action": {
            "onToT": 0,
            "onToM": 0,
            "onToS": 10,
            "offToT": 0,
            "offToM": 0,
            "offToS": 5,
            "onST": 0,
            "onBrt": 0,
            "onFT": 0,
            "offFT": 0,
            "err_code": 0
        }
    }
}

Request

{
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    },
    "smartlife.iot.sensor_trigger": {
        "set_default_manual_action": {
            "offToT": 0,
            "offToM": 0,
            "offToS": 10
        }
    }
}

Response

{
    "smartlife.iot.sensor_trigger": {
        "set_default_manual_action": {
            "err_code": 0
        }
    }
}

Request

{
    "smartlife.iot.PIR": {
        "get_config": {}
    },
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    }
}

Response

{
    "smartlife.iot.PIR": {
        "get_config": {
            "enable": 1,
            "version": "1.0",
            "trigger_index": 1,
            "cold_time": 120000,
            "min_adc": 0,
            "max_adc": 4095,
            "array": [
                80,
                50,
                20,
                0
            ],
            "err_code": 0
        }
    }
}

Request

{
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    },
    "smartlife.iot.PIR": {
        "set_trigger_sens": {
            "value": 80,
            "index": 0
        }
    }
}

Response

{
    "smartlife.iot.PIR": {
        "set_trigger_sens": {
            "err_code": 0
        }
    }
}

Request

{
    "smartlife.iot.LAS": {
        "get_config": {}
    },
    "context": {
        "source": "xxx-xxx-xxx-xxx-xxx"
    }
}

Response

{
    "smartlife.iot.LAS": {
        "get_config": {
            "devs": [
                {
                    "hw_id": 0,
                    "enable": 1,
                    "dark_index": 0,
                    "min_adc": 0,
                    "max_adc": 2450,
                    "level_array": [
                        {
                            "name": "cloudy",
                            "adc": 390,
                            "value": 15
                        },
                        {
                            "name": "overcast",
                            "adc": 300,
                            "value": 12
                        },
                        {
                            "name": "dawn",
                            "adc": 222,
                            "value": 9
                        },
                        {
                            "name": "twilight",
                            "adc": 222,
                            "value": 9
                        },
                        {
                            "name": "total darkness",
                            "adc": 111,
                            "value": 4
                        },
                        {
                            "name": "custom",
                            "adc": 2400,
                            "value": 97
                        }
                    ]
                }
            ],
            "ver": "1.0",
            "err_code": 0
        }
    }
}
@natemacinnes
Copy link
Author

natemacinnes commented Nov 15, 2021

I really want to figure out how we can capture PIR data in realtime. I wonder if it will be added as an enhancement to the app... 🤔

Have the smart camera's (I think they have PIR) data been captured? The cameras have the ability to detect and trigger events based on motion. Looks like Tapo Smart camera's do not support PIR.

@mrbetta
Copy link

mrbetta commented Dec 8, 2021

I also really want realtime PIR data for use in a alarm system situation. Making a bit of progress here:
python-kasa/python-kasa#268

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