Control TP-Link Smart Plug with Harmony Hub via Emulated Hue Bridge

Smart Home
This entry is part 7 of 11 in the series Creating My Smart Home.

One of my first smart devices was a TP-Link Wi-fi Smart Plug (model HS100). I used it to control the lights in our Christmas tree by voice control using an Amazon Echo. It worked great then, and after Christmas I moved it to our family room to control a floor lamp that we usually turn on in the evenings while watching TV or reading stories to our daughter. Unfortunately it is not compatible with Logitech’s Harmony Hub, so I wasn’t able to control it with my Harmony app/remote.

This is where Home Assistant proved how good it is at bridging the gaps between smart home devices. Adding it was easy enough. I assigned it a static IP address–all of my Home Assistant-related devices have a static IP address set–and followed the documentation to add it to my configuration.yaml file:

switch:
  - platform: tplink
    host: 192.168.0.150

After checking the configuration and restarting Home Assistant it showed up as a switch in the web UI. It even used the name I had assigned the plug in the TP-Link Kasa app. I went on to customize it using the customize section of the configuration.yaml file by changing the icon, capitalizing the friendly_name, and enabling control of it with the Emulated Hue Bridge component.

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # ... some code omitted for brevity
  customize:
    # ... some code omitted for brevity
    switch.lamp:
      friendly_name: Lamp
      icon: mdi:lamp
      emulated_hue: true

After another restart of Home Assistant, my Logitech Harmony Hub picked up the “Lamp” as a Philips Hue bulb, getting around the incompatibility issue. Now I’m able to assign one of the smart home buttons on my Harmony remote to turn the lamp on/off. That was one of my initial complaints in the first post in this series, and it really does add convenience when watching a movie at night.

By exposing the TP-Link plug via the Emulated Hue Bridge, I can control my “Lamp” with the Harmony app/remote.

Another bonus (in my mind) is that to use Alexa for voice control of the plug, now I can disable the “Remote Control” feature in the TP-Link Kasa app–bypassing TP-Link’s cloud service–and instead have Alexa see it as a Hue bulb and control it locally within my network.

My TP-Link Wi-Fi Smart Plug is configured for local control only; no remote access via the internet through TP-Link’s cloud service.

Comments

  1. Thanks, finally got it working, I would like to point out that in the MyHarmony app in Windows 10 you need to "Scan for Devices" to find the emulated Hue device. (If you "Add Device" under "Home Control" and Add Philips Hue it will continuously search for Hue Hub without ever finding it.)
  2. Does this require a physical phillips hue bridge to work ?
    1. No, it just requires Home Assistant running on a computer or Raspberry Pi.
  3. Finally got it working too! I had a hard time understanding what I was doing wrong has I wanted to control several lights. (I am absolutely not a programmer) I added a name line in the configuration.yaml between platform and IP:
    switch:
      - platform: tplink
        name:  lamp1
        host:  192.168.1.X1
      - platform: tplink
        name:  lamp2
        host:  192.168.1.X2
    then in the customize.yaml
    switch.lamp1:
      friendly_name: Main light
      icon: mdi:lamp
      emulated_hue: true
    switch.lamp2:
      friendly_name: TV lamp
      icon: mdi:lamp
      emulated_hue: true
    Many thanks for your tutorial Josh ;)
    1. This comment helped clarify the alias assignment, thanks PS Great post Josh
  4. Would this also work with a WeMo switch?
  5. Really need some help here please. I am trying to bridge a wemo switch to the harmony remote and not having much luck. First question, do I need to add code to the configuration.yaml to enable the hue bridge and if so what should this be? Second question, my wemo switch has been auto discovered by HASS so how do I customize this devices settings to emulate hue?
    1. Yes you'll need to enable the emulated hue bridge by adding emulated_hue: to your configuration.yaml file. You can view the documentation for more info on configuring this component. After updating configuration.yaml make sure you check your config so it's valid and then restart Home Assistant. For your second question, you might just have to scan for new devices with the Harmony app once you've enable the emulated hue bridge. It depends on your emulated_hue configuration. You can customize devices in Home Assistant via the web UI Configuration > Customize.
  6. When I try to add Philips Hue in the Harmony iOS app it asks me to press the center button on the bridge. Given that this is a virtual bridge how do I achieve that?
    1. It's been a while since I did this, but I believe the Harmony Hub will detect the emulated Hue bridge automatically, although it may take several minutes.

Comments are closed