Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

KS220M(US) support #268

Copy link
Copy link
@mrbetta

Description

@mrbetta
Issue body actions

It'd be great if Home Assistant could be used to manage the new KS220M Motion Detection Dimmer. I set up a man in the middle proxy and captured the following JSON commands being sent from the KASA app to the switch and changed various motion sensor settings. If someone better with Python wanted to integrate these, that'd be great.

Get the current PIR config:
Sent: {"smartlife.iot.PIR":{"get_config":{}}}
Received: {"smartlife.iot.PIR":{"get_config":{"enable":0,"version":"1.0","trigger_index":2,"cold_time":60000,"min_adc":0,"max_adc":4095,"array":[80,50,20,0],"err_code":0}}}

Disable the PIR: {"smartlife.iot.PIR":{"set_enable":{"enable":0}}}
Enable the PIR: {"smartlife.iot.PIR":{"set_enable":{"enable":1}}}
Set the PIR to far range detection: {"smartlife.iot.PIR":{"set_trigger_sens":{"index":0}}}
Mid Range: {"smartlife.iot.PIR":{"set_trigger_sens":{"index":1}}}
Near Range: {"smartlife.iot.PIR":{"set_trigger_sens":{"index":2}}}
"Custom" range of 20 ft: {"smartlife.iot.PIR":{"set_trigger_sens":{"index":3,"value":61}}} (Uses decimeters?)

I'll add more objects as I find them.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.