[RELEASE] TP-Link Plug, Switch, and Bulb integration


look for Refresh. This does the same plus updates the status of the switch.

Alternatively, you could modify the code to add
command "Poll"
right after the command "Refresh" in the DH.




Hi Dave (@djgutheinz)

The device also does NOT show up in RM for a refresh.

Looking at the driver code, it also appears it already has both capabilities: poll & refresh

metadata {
definition (name: "(Hub) TP-Link Plug-Switch",
namespace: "davegut",
author: "Dave Gutheinz") {
capability "Switch"
capability "Sensor"
capability "Actuator"
command "refresh"
command "poll"



Those capabilities may be case sensitive. Change to Poll and Refresh.


Changed the first letter for poll & refresh to UPPERCASE - Poll, Refresh
Made no difference - still doesn't show up as a device with that capability to pick it.

Out of interest I did just try something simple, as trying to select it as a switch for an on/off command in RM, and it DOES show up...



Sorry - missed something the first time I looked...

Change you driver code as follows:

metadata {
definition (name: "(Hub) TP-Link Plug-Switch",
namespace: "davegut",
author: "Dave Gutheinz") {
capability "Switch"
capability "Sensor"
capability "Actuator"
capability "Refresh"
capability "Poll"

Note that I changed the word 'command' to 'capability' as this is what lets other apps know what capabilities are supported.


@ogiewon Dan, changed the code as suggested. Got an error:


Changed line 35 to capability "Polling" - the allowed me to save the driver successfully [looked at some of the other drivers I had]

In RM the device is now showing up in the "Refresh and Poll" listing, but still not in the "Poll these devices" listing. I do not claim to understand the magic at all. However, I can now refresh it in RM, making me a happy camper.



Try "Polling" instead of "Poll"

Sorry about that... working from memory


Will fix on next release.



Will you be able to update the drivers to accomodate the new scenes capabilities? In this thread I am having issues with the TP-Link bulb driver not providing the correct events and attributes. Reference this thread for the context:


Is that a custom driver you are using for TP-Link bulb?


It is DaveGut's TPLink he ported over from ST. I don't believe HE natively supports WiFi Color Bulbs like TP-Link.


Yes, we don't have that driver. Your problem is probably with that driver. I think @mike.maxwell addressed that issue in the other thread. This has nothing to do with Groups and Scenes, other than that this app expects color bulbs to conform to the standard Mike pointed to.


I agree completely. Asking developer @djgutheinz what he might be able to do to the driver to conform to HE standards.


What other thread are you referring. If I can get the standards, then I can probably update to accommodate.

Sorry for delay. Been very busy on my real job and out of town for 2 months.


Here are the examples @mike.maxwell was mentioning to me.

Driver code samples


UPDATE to Cloud Device Handlers available.

09-23-18, CLOUD version only Updated to add Color Mode capabilities and provide I/O similarity with the generic Zigbee RGBW created by HE personnel. Removed capability polling as redundant to capability refresh. Hub version to follow later.

See notes in original message for input value ranges and considerations.

Update: Replace file contents. Save the preferences in the device. You must set preferences and save for the changes to properly take effect.


New update available supporting:

a. Automated (Application -based) installation of hub devices.

b. Hubitat input/output paradigm for devices.

See top of this thread for more information.



What is the upgrade path from current driver/app scenario? Do I have to recreate devices?


Not required. If you want to upgrade, you must upgrade drivers and application. Process is:

a. Open existing Driver of Application.

b. Delete existing code.

c. Copy new code from appropriate file on GitHub.

d. Save.

You will NOT have to recreate any devices.