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.
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.
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.
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).
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.
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.
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.
Firstly, thanks for your device handlers and manager, itâs working great for me.
I have one minor annoying problem, I keep on getting a prompt to update the app although I have and itâs on your latest version 3.5.03. I notice in the change log information there is a reference to 3.6.0, any thoughts? thanks.
Good to hear itâs not affecting functionality, but it is affect nagging levels from the wife due to repetitive notifications on her phone ⊠Iâll look to disable for now.
Hi @Gutheinz Iâve installed the cloud-based version and it doesnât seem to be refreshing automatically â the smart app control slider for this wonât stay in the on position.
The effect is that when my HS105 is turned manually or by the Kasa app, it wonât register on SmartThings until I manually refresh the device.
Not sure where Iâm going wrong here! Iâve tried setting the refresh rate to 1 minute within my SmartThings Classic app, as well as even smaller increments (i.e. 0.5 and 0.1) in my IDE.
Bottom line. Testing indicates that refresh and refresh interval setting are both working. Other than that, there is nothing I can do. There is a recurring problem with the SmartThings Cloud to SmartThings classic phone app where updates are very slow (I think dropped) going from cloud to app. Test to see if this is your condition: When encountered, go to the details page for the device then back to the devices pages (or vica-versa). DO NOT PRESS REFRESH. If this clears the issue up, the problem is definitely in the Cloud to phone app interface.
What I tested
Conditions: Kasa Account installation, Classic phone app. IDE Logging for instrumentation.
Test:
On the phone app, select the device. Then select the Details page.
Turn the device off using the phone app.
Observation A: Tile turnes green with âWaitingâ, then greay with âOFFâ.
Observation B: The IDE logs the device status is OFF.
Go to the Recently tab on the Phone App.
Observation: last entry is off.
In Kasa App, turn the device on:
Observation A: within one minute, the Recently tab adds a new line indicating on.
Observation B: The IDE logs the device status to on.
Steps 1-3 work perfectly â exactly as you described.
Step 4 is where the breakdown occurs. Neither the IDE nor the SmartThings Classic phone app donât seem to be recording any activity that doesnât originate with them.
Itâs now been more than 10 minutes, and neither has registered nor logged the on command from the Kasa app even though the refresh rate is set to 1 minute.
When did you install the device. In the Device Handler, copy below the lines beginning the below (or similar) with
========= History ============================================
and ending with
metadata {
This will tell me the version.
Service Manager. Same thing, beginning with the below (or similar)
====== Application History ================================
and ending with
definition (
========= History ============================================
2018-10-23 Update to Version 3.5:
a. Compatibility with new SmartThings app.
b. Update capabilities per latest ST definitions
1. deleted capability polling (depreciated)
2. deleted capability sensor (depreciated)
3. update program to accommodate other items
c. Various changes for updated Service Manager
With great appreciation to Anthony Ramirez for
his assistance as well as leading the development
of the new Service Manager.
12.07.18 3.5.03. Corrected refresh rate update issue.
======== DO NOT EDIT LINES BELOW ===*/
// ===== Device Type Identifier =====
def deviceType() { return âPlugâ }
// def deviceType() { return âSwitchâ }
// def deviceType() { return âDimming Switchâ }
// ====== Device Namespace =====
def devNamespace() { return âdavegutâ }
// def devNamespace() { return âramiran2â }
// ====== Other System Values =====
def ocfValue() { return (deviceType() == âPlugâ) ? âoic.d.smartplugâ : âoic.d.switchâ }
def vidValue() { return (deviceType() == âDimming Switchâ) ? âgeneric-dimmerâ : âgeneric-switchâ }
def deviceIcon() { return (deviceType() == âPlugâ) ? âst.Appliances.appliances17â : âst.Home.home30â }
def devVer() { return â3.5.03â }
// ======================================================================================================================
metadata {
Hereâs the app:
/*
TP-Link SmartThings Manager and TP-Link Cloud Connect, 2018 Version 3.5
Copyright 2018 Dave Gutheinz, Anthony Ramirez
Licensed under the Apache License, Version 2.0 (the âLicenseâ); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an âAS ISâ BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
Discalimer: This Service Manager and the associated Device
Handlers are in no way sanctioned or supported by TP-Link. All
development is based upon open-source data on the TP-Link Kasa Devices;
primarily various users on GitHub.com.
===== CHANGES =====
12-03-18 3.5.02. Update to fix login problems and finalize
multi-plug integration.
12.12.18 3.5.03. Fixed error causing crash when installed multi-
plug is offline and user attempts to add a device.
*/
// ===== Developer Namespace =====
def appNamespace() { return âdavegutâ }
// def appNamespace() { return âramiran2â }
// ====== Application Information =====
def appLabel() { return âTP-Link SmartThings Managerâ }
def appVersion() { return â3.5.03â }
def appVerDate() { return â12-12-2018â }
def appAuthor() { return âDave Gutheinz, Anthony Ramirezâ }
// ===========================================================
Interesting â I just sent a command via Action Tiles, and that triggered some kind of catch-up, where all of the events that SmartThings hadnât registered were logged all at the same time as the Action Tiles command.
What seems really odd is that the backlog of events are logged as occurring after the Action Tiles command I just sent, instead of before the Action Tiles command.
Thanks for catching the error. Found and corrected in the repository. Steps for you:
Replace file content, then save, publish.
Go to app and options.
Reselect the refresh rate property and save. This will cause the refresh to schedule properly.
Most time spent updating the 8 device handlers. Basically, a preferences update was:
a. As planned, unschedule the refresh interval activity.
b. Not properly restarting same - causing it to go away.
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 5:02:08 PM: info HS105 Power Right Refresh Scheduled for every 10 minutes
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 5:02:08 PM: info Updating Power Right...
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 5:01:34 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 5:00:37 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:59:24 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:58:22 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:57:23 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:56:23 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:55:26 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:54:23 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:53:24 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:51:22 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:50:22 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:49:25 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:48:25 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:47:24 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:46:24 PM: info HS105 Power Right: Power: on
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:45:35 PM: info HS105 Power Right: Power: off
[83bf7027-13b1-4b18-b70c-fa74e17d33fb](https://graph-na02-useast1.api.smartthings.com/ide/logs#83bf7027-13b1-4b18-b70c-fa74e17d33fb) 4:45:26 PM: info HS105 Power Right Refresh Scheduled for every minute