-
-
Notifications
You must be signed in to change notification settings - Fork 238
Description
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.