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


#21

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.


#22

Thanks.


#23

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"
}

Thanks
J


#24

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


#25

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...

J


#26

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.


#27

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

image

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.

J


#28

Try "Polling" instead of "Poll"

Sorry about that... working from memory


#29

Will fix on next release.


#30

@djgutheinz

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:


#31

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


#32

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


#33

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.


#34

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


#35

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.


#36

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

Driver code samples


#37

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.


#38

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.


#39

@djgutheinz

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


#40

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.