SmartThings Community

[Release] New TP-Link/Kasa Plug, Switch, and Bulb Integration

dth_lighting
dth_pocketsocket

(Dave Gutheinz) #63

Sometimes. The ST phone interface is sometimes not readily responsive to changes. Sometimes it is fine. I do not know why - but it is sort of normal with the cloud interface.

Design note: The interface is designed as a state machine. When a command is selected, it is sent to the device and then (automatically) a status is received. The status is then updated based on the returned device status.


#64

Hi Dave,
Thanks for reply in other thread. You were correct having two services installed was a bad idea. Not sure why since I put two bulbs on one and the plugs and switches on the other, but dupes popped up.

Here’s my question before I blow everything away and start over. Done correctly should any Kasa device show up twice, managed by Kasa app and by Smarthings? This is in the Alexa app, not on my ST apps on phone/iPad.


(Shaun) #65

Hi Dave,
First of all, fantastic work for keeping this integration up to date.
It may be a long shot but do you or anyone else know of a way to save the current energy use of a (HS110) energy monitoring plug to a variable in WebCoRE? I’ve tried but I don’t seem to be able to get the reading out of smartthings, I only get a $getPower saving as the variable. I wish to set it so that when a device is using under a certain amount of power (Microwave for instance) for a certain amount of minutes, it turns off.
Thanks very much for any input.


(Dave Gutheinz) #66

I code using Capability Power Meter with Attribute Power. This information is automatically updated at each refresh cycle (which you can set in Preferences). The external command (not part of Capability Power Meter) is getPower(). You should be able to access that from WebCore (I do not use WebCore).


(Shaun) #67

Okay, with the help of a friend I have figured out how to store the GetPower() stat as a variable.

Thank you very much.

For anyone wanting to know in WebCore, use this:
Set variable {@PC_Power(Variable Name)} = “My PC’s(Your Devices)” power;
Use variables to loop it.

That saves the variable as this:
@PC_Power = 144.66; (in watts)
Run a refresh on the device in the command every x minutes to update the variable.


(Esmugala) #68

I found a bug/issue in this version that wasn’t in the last version. If you happen to have any devices in your Kasa account that aren’t online, you won’t be able to add any devices to smart things via the app. The app shows:

10:53:28 PM: error groovy.lang.MissingPropertyException: No such property: system for class: org.codehaus.groovy.runtime.GStringImpl
Possible solutions: bytes @line 609 (doCall)

10:53:28 PM: error Error in sendDeviceCmd: [error_code:-20571, msg:Device is offline]

After either removing those devices or making sure they are connected, everything else works correctly.


(Dave Gutheinz) #69

Updates to 3.5.03 Device Handlers and SmartApp

12-12-2018 - SmartApp. Fixed SmartApp handling of HS107 and HS300. After installed, if user unplugs (or device is off-line) the device and subsequently tries to add a device, the SmartApp crashed. Fix will not add the offending device to the currentDevices Array. Impact: User may not be able to remove the device using the SmartApp under certain circumstances. Manual removal via classic Phone App or the IDE My Devices page will work.

12-12-2018 - Device Handlers. Maintenance updates to correct some errors in SmartApp to Device Handler comms.

Update Recommendation: If you do not have any issue, update is purely optional. If you encounter problems, update and retest before reporting.


(Dave Gutheinz) #70

Fixed in update 3.5.03. Thanks for the information! Read my note for implications of fix.

If this does not fix your problem, please inform me. I tested with plugs, lights, and multi-plugs off-line, so I think it is solid.

Dave