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


#61

Sure enough that was it! It is working accordingly. No issues either. Would be nice to have drop down selection verses entering a number. Example: 1.5 does not work. Causes an error. Let me know when you go gold with this driver and I will update accordingly.

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:40.517 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: off / Brightness: 50% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:60, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:40.515 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Azure

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:40.514 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:29.069 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: on / Brightness: 50% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:60, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:29.068 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Azure

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:29.063 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:20.382 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: on / Brightness: 100% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:60, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:20.379 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Azure

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:20.377 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:09.193 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: on / Brightness: 100% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:60, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:09.191 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Azure

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:56:09.190 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:52.861 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: on / Brightness: 75% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:95, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:52.858 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Rose

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:52.856 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:49.470 am [info](http://10.0.2.38/device/edit/272)LB230(E26) Fireplace - Left: Power: off / Brightness: 75% / Circadian Mode: normal / Color Temp: 0K / Color: [hue:95, saturation:100]

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:49.469 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left color is Rose

[dev:272](http://10.0.2.38/logs#dev272)2018-11-29 11:55:49.467 am [info](http://10.0.2.38/device/edit/272)Fireplace - Left Color Mode is RGB

#62

Hi,

Just installed this code to work with my HS100 plugs but I seem to have a problem. I installed the app no problem and then added the one plug I had which shows up as a device. I can control this plug no issues.

I have then added another 2 plugs to the Kasa app and they show up fine. When I go in to the App in Hubitat to add the two new plugs, the new plugs show up in the drop down and I can select the plugs. However when I click "Done" a very quick error message (Unexpected Error) appears momentarily and tells me to check the logs. When I check the logs the only events showing are all " [info] TpLinkToken updated to...".

In the Status window for the device I can see the two new plugs/devices in the "devices" metadata.

I don't know where else to look or check and I don't seem to be able to increase the logging level either.

Any ideas?

G

UPDATE:
I decided to delete the App and re-install it. This time all three plugs were available to select and all three added fine (though I did still get the Unexpected Error message). So it seems that you can add the plugs once when you install the app but you can't add additional plugs once it is installed.


#63

i have tested both scenarios (add all and add one and then rest) without error. Let me work to duplicate the issue.

Questions:

What App name. There are two out there.


#64

Hubitat TP-Link/Kasa Manager it's v3.5 and was updated 24/11 by you (I think!)

Cheers

G


#65

Still have not encountered the problem. I am testing carefully and will get back.


#66

Thanks very much. Anything I can do to help?

I was wondering. When I added the account at the very beginning I only had one plug on it. This worked flawlessly. I then added the other two and couldn't add them through the app. When I deleted the app and re-added it all three plugs were there from the start. I'm wondering if it's a mismatch when you first add the account? i.e. the application can't add plugs unless they're there when you install/add the app.

It might explain why I could only add one plug initially and why it worked for all three when I deleted and reinstalled the app after I'd added all three plugs to Kasa.

G


#67

I have been able to duplicate the momentary error (Unexpected Error). And while trying to find the problem, I started encountering the devices not adding. Do not know why. I am currently trying to capture the problem issues. We may just have to accept the Unexpected Error (if I can find why on the non-installation).

Dave


#68

@djgutheinz

I am having refresh issues with the new parent/child app. Last night the TP-Link had a communication error with one of my outlet devices which resulted in my rule becoming false and the bedroom lights to go on at 2am while we were sleeping.

Any ideas what might be going on?


#69

Inherited from the platform that shall not be named.

I have coded three potential states for plugs/bulbs: on, off, and offline. Offline is attained when a communications error is received from either the Application (Kasa Account) or the node.js applet. This allows the error to report to the android/IoT interface. Let me experiment and see how the dashboard handles this error. If it does nothing, then I will remove the off-line.

Otherwise: Any automation would have to account for all three. If you have a rule that does not account for this, then what you are seeing is possible.


#70

Are you hub or cloud version? What explicit device is having a problem?

Note: When power is removed from a bulb and then restored (power failure or external switch), the bulb will recover in the on state. (This is true for my Zigbee and TP-Link bulbs). I assume this is to allow for a switched bulb to behave as a normal bulb when the switch is activated (off or on).


#71

I am using cloud currently. In RM I do not account for anything besides if the outlet is on or off. Should I move to node? Will this eliminate the comms error if there was any hiccups on refresh-cloud?


#72

Don't go to the node. It will be the same problem. I will investigate the Hubitat norm for switch status and fix driver accordingly. Will adjust other areas as required.


#73

Initial investigation complete. To keep you informed, I will be modifying the device handlers today to remove the off-line status from the switch state. Will follow-up with a rework to handle device health.


#74

Update 3.5.03. Modified Drivers to eliminate Switch states other than on/off. These may have been causing errors in some routines. Additionally, this conforms the attribute switch to standards.

Recommendation: Not required unless you are encountering errors.


#75

I have updated all handlers. Will let you know as I see stuff. Thanks for everything Dave!