[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Fixed. My error on copying the file!!!!! OUCH. Must be getting old (actually, I was in a hurry to fix same issue on SmartThings).

Updated device code for all devices. Color bulbs no longer have errors except for my long name.

1 Like

Thanks for the assist in troubleshooting the problem. (BTW, your device is 1 character too long.) I would never have found without the assist.

1 Like

Hi
I just installed UDP app/driver from GitHub for my HS110 plugs realising the driver doesn't show energy usage and this is the main reason I use the plugs for (OLED TV and room A/C). So if you still need a tester here I am.

Will have a test sometime this weekend. One known issue is the weekly and monthly stat coming back from bulb in two messages (intermittent issue, usually toward end of month). I will try to mitigate - but may still occur sometimes. If these are not important to you, then it will be much easier.

Dave

Updating the existing SmartThings code for this. Will probably be sometime next week (I will announce here). What I am creating:

Current power in Watts
Usage in kWh (also as states for readability in the device detail page.
a. Use by day this month as a JSON object (if feasible)
b. Use by month this year as a Json object (if feasible)
c. Use by month last year as a Json object (if feasible)

All will be as attributes. The Json objects can be accessed in a application to create reports, as desired.

That's great work of yours. Thanks in advance and I'm here if you need me. Just bear in mind I'm in Central Europe UTC+1 - 20.50 hrs here now.

HS110 Energy Monitor Test Driver. I have created a test driver for the HS110 Energy Monitor Plug that provides energy monitor data. File is in the devices folder: "test - TP-Link Engr Meter Plug (Hubitat).groovy".

Uses capability "power" and "energy" and adds attributes "power" (current power in watts) and "energy" (consumption today in kilo watt hours). Also adds states
a, "energyThisMonth" - daily consumption for this month.
b. "energyThisYear" - monthly consumption for this year.
c. "energyLastYear" - monthly consumption last year.
Also added three exposed functions to pull the data from the three states into an application: "sendThisMonth", "sendThisYear", and "sendLastYear". The HS110 can be selected on the input of the application using either capability power or energy.

I need comments back.

Update. You can update an already installed HS110 as follows:
a. On the HE device's page, update the "type" in the Device Information section and "Save Device"
b. Select "Display trace messages", then "Save Preferences".

You can also do a clean install manually.

Example of monthly state (energy_wh will be energy for HS110): energyThisMonth : [{month=1, year=2019, energy_wh=103, day=1}, {month=1, year=2019, energy_wh=133, day=2}, {month=1, year=2019, energy_wh=50, day=3}, {month=1, year=2019, energy_wh=39, day=4}, {month=1, year=2019, energy_wh=80, day=5}, {month=1, year=2019, energy_wh=84, day=6}, {month=1, year=2019, energy_wh=120, day=7}, {month=1, year=2019, energy_wh=50, day=8}, {month=1, year=2019, energy_wh=76, day=9}]

Example of yearly state (2019) ("energy_wh" will be "energy" for HS110): energyThisYear : [{month=1, year=2019, energy_wh=1088}]

Once functionality is verified, I will update the Application to install this driver for the HS110 plug.

My HS110 plugs are arriving today so I should get a change to help with testing.

Thanks

G

Sorry for late reply. I didn't realise you posted.
So I get this:

What I do not see are

a.  Current State (upper right of device page):  
      1.  energy
      2.  power
b.  State Variables:
     1.  powerScale
     2,  energyScale
     3.  energyThisMonth

I think there is an error in the code. I have updated the file on GitHub; however, even easier is to insert a line after line 233 in the driver. Change to be:

233 def cmdResponse = parseInput(response)
234 getPower()
235 def onOff

Done

50

I just checked energy and power readings on HS110 and they match the readings from the driver.

Great. Not saying I can implement; but, any other features in these you would like? How about bulbs?

Dave

1 Like

I can see power end energy are available in RM. I haven't done anything with it yet but I can see some usage.
I don't have any bulbs. I'll get some I think. I have these plugs as I wanted them in a separate app from ST app as I was afraid to accidentally turn them off . HE doesn't need to be looked at all the time and we only get what we want on the mobile dashboard.
Thanks a lot for your ingenious work.

Bulb Buttons. I have created an application that will install a bulb-buttons device on for each selected bulb. It provides

a. individual buttons for 12 colors and 8 color temperatures (pre-programmed),
b. a button that allows scrolling through the colors,
c. another that allows scrolling through the color temperatures,
d. (for TP-Link devices) a SetCircadian button to start the Circadian mode.

It works with TP-Link and any other bulb with capability.colorControl and capability.colorTemperature.

How it works.

  1. User runs the app and selects the Color and Color Temperature bulbs from the two drop-down lists. For color, you should select both the Color and Color Temperature lists.
  2. The app installs a virtual device with the original bulb's name plus "Buttons".
  3. User can use these buttons in the Hubitat Dashboard. Button definitions are on the GitHub page.

Source Location: HubitatActive/BlubButtons at master · DaveGut/HubitatActive · GitHub

I have 2 HS-110s for my washer and dryer. I can confirm 4.0.04 works great. I am reading power values every minute and use that to drive a webcore piston that reminds me when the washer or dryer cycles are complete (power < 30W for > 2 minutes). Thanks so much for this and all of the TP-Link driver writing, Dave!

1 Like

Hi folks, I am fairly new to Hubitat. In fact, received my hub yesterday and started with apps and devices. I have both a HS100 and a HS105. I tried to use the instructions on GitHub to install the app and the driver and everything went well. However, when i launch the app, it says zero devices found. Both of my Kasa plugs are on the same network as my hub. Appreciate if someone can help me with what I might be doing wrong (since it is working for everyone else, I am sure I am missing something being a newbie).
Thanks

I need a little more information. Some notes for you:

a. The hub ip address and bulb addresses must indicate the same segment. For example, if a hub is 192.168.0.XXX, the devices must be 192.168.0.YYY. That is used for discovery.
b. The devices must be installed through the Kasa Account to attain their IP addresses. This application does not attempt that.

What I need:

a. Driver version (in the driver code, just after the initial comment section).
b. Application code (same location in app code.
c. The logs for the application during an unsuccessful installation attempt.
d. Hub IP and device IP.

Other option. You could do a manual install (without application). You apparently already have the driver uploaded and saved. The next steps are:

a. Create a virtual device using the driver as the device type in the drop-down menu.
b. Open the device and enter the IP address for the devices in preferences and then save.

Good luck.