Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tplinksmarthome] Add support for TP-Link HS107, HS300, KP200, and KP400 #5051

Closed
Hilbrand opened this issue Mar 6, 2019 · 9 comments · Fixed by #5716
Closed

[tplinksmarthome] Add support for TP-Link HS107, HS300, KP200, and KP400 #5051

Hilbrand opened this issue Mar 6, 2019 · 9 comments · Fixed by #5716
Assignees
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@Hilbrand
Copy link
Member

Hilbrand commented Mar 6, 2019

HS107, HS300, KP200, and KP400 are devices with more than 1 outlet on the same device. The HS107, KP200 and KP400 all have 2, and the HS300 has 6 outlets. These outlets can be controlled separately and also have the ability to read power usage. Because of this they also have different control commands and require additional programming to be supported by the tplinksmarthome binding.

This issue report is also to report some work already has been done to add support for these devices. However since not all commands are known it's still a work in progress. And since I don't have either device I can't test this.

Anyone who has such a device and is interested in support for one of these devices please comment in this item.

Power outlet devices:

  • HS107 Smart Wi-Fi Plug, 2-Outlets
  • HS300 Smart Wi-Fi Power Strip
  • KP200 Smart Wi-Fi Power Outlet, 2-Sockets
  • KP400 Smart Outdoor Plug

Open questions

The following questions remain open with regards to how the devices work:

  1. Is it possible to switch all outlets at once?
  2. Energy reading command needs to be given for each outlet (based on what I see with other implementations of support for these devices). Is is possible to get readings for multiple devices at once?
  3. Is is possible to get a total energy reading for all outlets combined?
  4. Can the status leds be switch on and off like with the plugs and switched?
@Hilbrand Hilbrand self-assigned this Mar 6, 2019
@Hilbrand Hilbrand changed the title [tplinksmarthome] Add support for TP-Link HS107 and HS300 [tplinksmarthome] Add support for TP-Link HS107, HS300, KP200, and KP400 Mar 7, 2019
@davidgraeff davidgraeff added the enhancement An enhancement or new feature for an existing add-on label Mar 18, 2019
@babela
Copy link

babela commented Mar 27, 2019

In regard to the open questions:

  1. on the KP200 it is possible to switch both outlets at once. I have been using tasker to control a HS100 as described here:
    https://www.reddit.com/r/tasker/comments/52lvhq/how_to_control_a_tplink_hs100/

The same code when sent to the KP200 switches on/off both outlets. I have not figured out how to automate switching the KP200 outlets individually.

  1. from the KASA app you can disable/enable the leds, so we should be able to do this programmatically as well.

@Hilbrand
Copy link
Member Author

@babela do you mean the kp200 instead of the hs200?

@babela
Copy link

babela commented Mar 28, 2019

Sorry, yes, I meant KP200. I have updated the original comment. Separate from OpenHab, I am using tasker specifically to turn switches on/off when phone's charge is at a certain percentage to maximize the useful lifespan of the battery... The comment was to answer the question of turning on/off all sockets at once on the KP200. This does work via the same methods as the already supported devices. My OpenHab is currently down so I can not test via OpenHab currently. I have not figured out or found any info on controlling the KP200 individual sockets. It certainly is possible. Hoping to find time to do some packet sniffing in the near future.

@c6fc
Copy link

c6fc commented Mar 31, 2019

@Hilbrand I have a Kasa HS300 6-outlet power strip, and I'd be happy to help you test!

@mythbai
Copy link

mythbai commented Apr 8, 2019

I have a HS300 too, and would appreciate the support for it. I can help with the test as well.

@c6fc
Copy link

c6fc commented Apr 11, 2019

Another project seems to have had a lot of luck developing support for the HS300, and it's currently licensed MIT: https://github.com/plasticrake/tplink-smarthome-api/

The API documentation would probably shed a great deal of light on the questions you have about how the device behaves: https://github.com/plasticrake/tplink-smarthome-api/blob/master/API.md

@Hilbrand
Copy link
Member Author

Hilbrand commented Apr 19, 2019

@babela, @mythbai and @c6fc I've create an initial version supporting HS107, HS300, KP200 and KP400. The binding is available through the Eclipse IoT marketplace and can thus be installed from PaperUI when the MarketPlace is enabled in PaperUI -> Configuration -> System with Maturity Level Beta.

Let me know what works and what doesn't. If you are experiencing problems please enable log level TRACE. In karaf console: log:set TRACE org.openhab.binding.tplinksmarthome. Make sure to disable it when done, otherwise you'll get lots of logging: log:set DEFAULT org.openhab.binding.tplinksmarthome

@Hilbrand
Copy link
Member Author

I've made some changes. I changed the channels of the power outlet devices to channel groups. So it shows up nicer. If you had the experimental binding installed before this day you need to re-add the new things as the channels have changed.

@MyRaceData
Copy link

MyRaceData commented May 13, 2019

Hilbrand:
Do I need to uninstall the 2.4 version before installing the beta? My gut is telling me yes and because it is probably 4am in the Netherlands I'm going to try that first. Let you know
andy
OK... it works! great work Hilbrand. I uninstalled the regular 2.4 binding first, then install the beta and HS300 popped up immediately in inbox. Each outlet has power (switch) power (number) energy usage, current and voltage (all numbers) In addition there is an Outlet Group Power (switch) SwitchLED (switch) and Signal (number) channels
Also all items, channels from 2.4 binding still work and I created an switch item for LED light on HS300 and turned it off and viola! LED is off BRAVO!

Hilbrand added a commit to Hilbrand/openhab-addons that referenced this issue Jun 12, 2019
… and KP400

Closes openhab#5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
martinvw pushed a commit that referenced this issue Jun 27, 2019
…, KP400 (#5716)

Closes #5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this issue Jul 3, 2019
…, KP400 (openhab#5716)

Closes openhab#5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
ne0h pushed a commit to ne0h/openhab-addons that referenced this issue Sep 15, 2019
…, KP400 (openhab#5716)

Closes openhab#5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Maximilian Hess <mail@ne0h.de>
Pshatsillo pushed a commit to Pshatsillo/openhab-addons that referenced this issue Dec 8, 2019
…, KP400 (openhab#5716)

Closes openhab#5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
tmrobert8 pushed a commit to tmrobert8/openhab-addons that referenced this issue Jan 21, 2020
…, KP400 (openhab#5716)

Closes openhab#5051

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Tim Roberts <timmarkroberts@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants