Welcome to the Athom Community Forum! This is a place to share ideas, ask for help and discuss about Homey in general.

Please read Welcome to the forum to get started.

[ UPDATED 0.0.8 ] TP-Link Smart Devices - central topic

anneanne Member
edited June 2017 in Apps

TP-Link Smart Plug and Bulb (WIFI) app for Athom Homey

This app lets you control TP-Link Smart Plugs HS100 (plug with no energy monitoring) HS110 (plug with energy monitoring) and Smart Bulbs LB100, LB110, LB120 and LB130 from within flows and the (mobile) app. The HS200 Smart Switch is as of yet untested but should work as well (please let me know ;-) The same goes for the HS115 mini plug, this should work with the HS110 driver.

In its current state, the app can auto-detect the IP address of the device when adding a device, however it currently cannot detect when it is changed. It is advised to set it up to have a fixed IP address or a 'static lease' from the DHCP server until this feature is added.

This app is based on the following resources:

Supported flow triggers:

  • Power / total power changed (HS110/HS200)
  • On / off state changed

Supported flow conditions:

  • If on / off

Supported flow actions:

  • Switch on / off
  • Toggle on / off
  • Switch LED on / off ('nightmode', HS100/HS110)
  • reset power meter / undo reset power meter (HS110/HS200)
  • Transition on / off ('wake-up light', LB100/LB110/LB120/LB130)
  • Select mode (LB130)

Mobile capabilities:

  • On/off
  • Display power and energy usage (HS110/HS200)
  • Dim (LB100/LB110/LB120/LB130
  • Set light temperature (LB120/LB130)
  • Set hue (LB130)
  • Select mode (LB130)

Energy monitoring has currently not been implemented for the bulbs (LB110 and up) as I am not sure anyone would use it. The selection of pre-sets for the LB130 is currently not supported in the API.

  

Donate:

If you like the app you can show your appreciation by posting it in the forum, and if you really like it you can donate. Feature requests can also be placed on the forum.

Paypal donate

Changelog

Version 0.0.8:

  • Bugfixes for bulbs, added app to 'lights' category.

Comments

  • anneanne Member
    edited June 2017
    Version 0.0.8 of the app has been submitted and will hopefully shortly be published in the app store.

    The update addresses several bugs in the driver for the smart bulbs. The app now correctly tracks the state of the bulb. I have also played a bit with the Homey built-in speech commands work, these now work as well. For instance for the LB130 color bulb you can use 'OK Homey, <lamp name> <color>') and Homey will set the specified lamp to the desired color.

    One nice feature of the bulbs that is worth mentioning is the 'transition on/off', which turns the brightness of the bulb up or down over a set interval. If you set the interval to an hour, it can be used as a wake-up light (note that I don't know exactly what the maximum transition period is). Also, it is nice to slowly let the light fade when turning the light off when leaving the room for instance. 

    Finally I have included the app in the 'lights' category of the app store, making it easier to find for Homey users looking for smart lights.
  • Cannot find version 0.0.6 in the appstore yet?
  • anneanne Member
    edited May 2017
    I published it as an alpha version, however bumping it to beta didn't work due to an issue with the app store (fixed by Athom in the meantime). I ended up submitting a version with just an increased version number (0.0.7), it should be approved shortly and appear in the store. 

    [update] 0.0.7 has been published :+1:
  • Hi Anne and fellow members,
    I have a new TP Link smart plugt HS 110 and with its own Kasa app its working fine and with energy metering.
    Now i installed your latest TP Link Homey app and it works for on/off but the energy metering/voltage metering is not working.
    Tried reinstalling the app (0.08)and the HS110 device, restarting Homey etc. but nothing will make the energy metering show.
    What could be wrong?  
    I'm on Homey 1.5.11
  • anneanne Member
    Hi @Martin_vd_Aart I have seen some crash reports which indicate that the plug is sending an ‘unexpected character’ which causes an error in a function. I guess this may be related to the issue you are seeing.

    My own HS110 plug doesn’t have the problem, I can't easily reproduce it. My HS100 firmware/hardware is:
    sw_ver: '1.0.8 Build 151101 Rel.24452',  hw_ver: '1.0'

    Could you perhaps check if yours has a different software/hardware version? 

    Note that I need to rewrite the app for SDK2, I'll have a look at it while (when...) I am at it.
  • JamieJamie Member
    Hi Anne,

    I am having a somewhat different problem, when ever I try and turn on a device the app crashes.

    (From the Kasa App) I am using

    Model : HS110(AU)
    Hardware : (2.0)
    Firmware : (1.5.2)

    I notice that this is quite different versions from what you are running, is there anything I can do to help you resolve the issue?

    Thanks


  • anneanne Member
    @Jamie Thanks. I think I'll start with looking for other TP-Link projects/code in Github. If there's a hardware difference others will have run into it as well. 
  • Thanks Anne,
    I will check the hard-/software versions of my HS110 plug and report it as soon as i'm home again.
  • anneanne Member
    It seems TP-Link has recently updated the firmware causing other reverse engineered tools to break. From https://www.softscheck.com/en/reverse-engineering-tp-link-hs110/:

    UPDATE 19.06.2018:
    TP-Link has updated their firmware. If you install this firmware upgrade, tplink-smartplug.py does not work anymore.

    The tool the URL above reverse to was since updated, restoring functionality. When I have time I'll check what's different and what needs to be updated to make it work again. 
  • Hi Anne,
    This is the hard-/firmware version of my TP link plug according to the Kasa app.
    Model: HS110 (EU)
    Hardware version:  2.0  (on the back of the plug a sticker with HS110 (EU) Ver:3.0)
    Firmware version: 1.5.2

    Hope you can make the power metering work again.
    Have a nice weekend!
  • anneanne Member
    @Martin_vd_Aart Ok,  the issue with the power metering of the HS110 is that newer (v2) versions return W, Wh, mV and mA values instead of kW, kWh, V and A, and the keys of the parameters were changed in the API to reflect this.

    I am still looking into the other issue. 
  • anneanne Member
    @Martin_vd_Aart I have included a fix for the different metering keys/values in new firmware for the HS110 and HS200 plugs.

    You can manually load v.0.0.9 of the app from https://github.com/abaretta/nu.baretta.tplink, or if you DM me your email address (the one that is coupled to your Athom account) I can make the update available to you through the alpha channel of the appstore (once I add the emailaddress you will be able to select the alpha version). Can you have a look and let me know if metering works? I can't test it on the newer firmware at the moment.

    The other issue is related to a small change in the encryption function. I will not be able to work that out and test this before I leave on holiday, but it shouldn't take too long. 
Sign In or Register to comment.