User Tools

Site Tools


supported_hardware:tplink

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
supported_hardware:tplink [2019/11/15 17:50]
James Sentman [TP-Link/Kasa Powerstrip]
supported_hardware:tplink [2020/02/19 22:05] (current)
James Sentman updated version numbers
Line 1: Line 1:
 =====TP-Link / Kasa===== =====TP-Link / Kasa=====
  
-Currently at version ​0.1 beta released 11/15/2019 and included in XTension 9.4.26+Currently at version ​1.1 2/19/2020 and included in XTension 9.4.28
  
 The TP-Link/​Kasa plugin is included in the standard XTension distribution and supports the currently shipping appliance modules, dimming modules, non-color bulbs, color bulbs and color temperature bulbs as well as their multi-controllable outlet power strips. If the device supports the energy monitor functions then some combination of current usage in watts as well as historical KWH usage may also be available. The TP-Link/​Kasa plugin is included in the standard XTension distribution and supports the currently shipping appliance modules, dimming modules, non-color bulbs, color bulbs and color temperature bulbs as well as their multi-controllable outlet power strips. If the device supports the energy monitor functions then some combination of current usage in watts as well as historical KWH usage may also be available.
Line 8: Line 8:
  
 **Note:** There are many and varied WiFi controllable devices out there. This one is compatible only with devices branded as TP-Link or Kasa. This is not compatible with Sonoff or any other devices that I am aware of. There may be other off brand ones that use the same local network protocol, but I wouldn’t count on it just because they are made to look like the TP-Link devices. **Note:** There are many and varied WiFi controllable devices out there. This one is compatible only with devices branded as TP-Link or Kasa. This is not compatible with Sonoff or any other devices that I am aware of. There may be other off brand ones that use the same local network protocol, but I wouldn’t count on it just because they are made to look like the TP-Link devices.
 +
 +====Requirements:​====
 +This plugin requires Python3 which is not part of the standard MacOSX install. If you haven’t already done so for one of the other plugins that also require python3 please download and install that from [[https://​www.python.org/​downloads/​]]
  
 ====Device Configuration:​==== ====Device Configuration:​====
Line 15: Line 18:
 {{:​supported_hardware:​tplink-settings.png?​400 |}}Only a single instance of the plugin is necessary to control all the devices on the local subnet. {{:​supported_hardware:​tplink-settings.png?​400 |}}Only a single instance of the plugin is necessary to control all the devices on the local subnet.
  
-**Automatically Create Units In XTension:** defaults to On. If checked then any devices ​discovered on the local network will automatically have a Unit in XTension ​created ​for them when they are discovered. If you do not wish all the units on the network to be in the XTension ​database then turn this off after creating the ones that you need. +**Device Discovery:​** If the “Automatically Create Units In XTension” checkbox is checked then any new device ​discovered on the network will automatically have a corresponding unit created in XTension. The “Discover New Devices Now” button ​should be clicked after you add new devices to the network so that they can be added to XTension’s database. There is also a scripting command to trigger ​a discovery ​process:
- +
-**Default Polling Interval:** TP-Link/​Kasa devices do not send a message when their state is controlled locally or via the iOS or other app. The only way to know if you have controlled a device through another channel is to poll them regularly. Set to 0 to make the default to not poll a device or any number of seconds larger than 10. This is a very small amount of network traffic and doing it even as much as every 30 seconds ​should ​not cause any problematic usage on your network unless you have hundreds of devices. If you never control your devices from any other place than XTension you can turn this off entirely. The other purpose that regularly polling devices serves is to check for them to actually ​be online. When a device is controlled or polled and it is not responding, either because it has been manually turned off in the case of a bulb or unplugged in the case of an outlet it will figure that out and set a unit error at the poll. If you are not polling the devices ​then you will not have an indication that the device is not available until you try to control it and it is not there. +
- +
-Each Unit has a configuration option to override ​the default polling interval for that specific device. +
- +
- +
-**Discovery Interval:** The number of seconds between automatic discovery intervals. Set to 0 to disable automatic discovery. This will do a discovery looking for new devices at this interval. If this is running then if you add new devices ​they will create a new Unit in XTension as soon as they are found. This also creates only a small amount of network traffic and should not cause a problem unless you have very many devices. You can use the “Discover Devices Now” button ​to run a discovery manually at any time. There is also a scripting command to run a discovery. In AppleScript you would do something like: +
 <​code>​ <​code>​
 tell xInterface “this interface name” to discover() tell xInterface “this interface name” to discover()
Line 29: Line 24:
  
 That will return immediately as the discovery is an async process. If the “Create New Units” checkbox above is selected then any new units discovered will be created in XTension. That will return immediately as the discovery is an async process. If the “Create New Units” checkbox above is selected then any new units discovered will be created in XTension.
 +
 +**Default Polling Interval:** TP-Link/​Kasa devices do not send a message when their state is controlled locally or via the iOS or other app. The only way to know if you have controlled a device through another channel is to poll them regularly. Set to 0 to make the default to not poll a device or any number of seconds larger than 10. This is a very small amount of network traffic and doing it even as much as every 30 seconds should not cause any problematic usage on your network unless you have hundreds of devices. If you never control your devices from any other place than XTension you can turn this off entirely. The other purpose that regularly polling devices serves is to check for them to actually be online. When a device is controlled or polled and it is not responding, either because it has been manually turned off in the case of a bulb or unplugged in the case of an outlet it will figure that out and set a unit error at the poll. If you are not polling the devices then you will not have an indication that the device is not available until you try to control it and it is not there.
 +
 +Each Unit has a configuration option to override the default polling interval for that specific device.
 +
  
 ====XTension Unit Types:==== ====XTension Unit Types:====
Line 34: Line 34:
 In XTension a Unit will be created for each Device discovered. You can manually create other units for the energy monitor functions if available. The Units when created will be given the same name that you have configured in the Kasa app when you set them up. After that you can change the name of the XTension unit to anything you wish. These changes are not sent back to the Devices. The names are only read when creating the units. Once the unit is created you can change the name of either the XTension Unit or the Device without affecting the other. In XTension a Unit will be created for each Device discovered. You can manually create other units for the energy monitor functions if available. The Units when created will be given the same name that you have configured in the Kasa app when you set them up. After that you can change the name of the XTension unit to anything you wish. These changes are not sent back to the Devices. The names are only read when creating the units. Once the unit is created you can change the name of either the XTension Unit or the Device without affecting the other.
  
-The address of the XTension Units will be the MAC address of the device with the exception of the powerstrip outlet Units which will be the MAC address followed by a period and then the index of the outlet starting at 0.+The address of the XTension Units will be the MAC address of the device with the exception of the powerstrip outlet Units which will be the MAC address followed by a period and then the index of the outlet starting at 0. So something like 12:​34:​56:​78:​90:​A1:​FF.0 for the first outlet and .1 for the second etc.
  
 +All units support the [[dictionary:​unitinformation:​queryof|Query]] command. If you have polling turned off or just want to check the state or value of a unit at a specific time you can issue a query to ask the device for it’s current info.
 +
 +<​code>​
 +query “name of unit you wish to query”
 +</​code>​
 +
 +Remember that the query is done async. The query command returns immediately and if there is any change to the unit status then the unit will update when that is received back from the device.
  
 ===TP-Link/​Kasa Device:=== ===TP-Link/​Kasa Device:===
 {{:​supported_hardware:​tplink-devicesettings.png?​400 |}}All single end point devices like Smart Outlets and Smart Bulbs will create a single XTension Unit of type “Kasa Device”. Depending on the capabilities discovered when the unit is created it will be properly setup as dimmable or non-dimmable,​ as well as having it’s color and color temperature capabilities turned on or off automatically. {{:​supported_hardware:​tplink-devicesettings.png?​400 |}}All single end point devices like Smart Outlets and Smart Bulbs will create a single XTension Unit of type “Kasa Device”. Depending on the capabilities discovered when the unit is created it will be properly setup as dimmable or non-dimmable,​ as well as having it’s color and color temperature capabilities turned on or off automatically.
 +
 +Dimmable TP-Link/​Kasa devices do not appear to have any support for the “rate” parameter. There is no way to control how rapidly they dim or brighten or change color. If you wish you can use the scripted [[tutorials:​slow_fade|Slow Fade]] example to emulate such a function for dimming. Color changes are not so easily adjusted that way.
  
 **Device Polling:** **Device Polling:**
Line 74: Line 83:
 ===History=== ===History===
   * The TP-Link/​Kasa plugin was added as a beta version in XTension build 9.4.26 on 11/15/2019   * The TP-Link/​Kasa plugin was added as a beta version in XTension build 9.4.26 on 11/15/2019
 +  * The automatic discovery interval was removed in version 1.1 of the plugin which was included in XTension build 9.4.28. The discovery would cause units to be lost if it intersected with an actual control or poll of a device. If you need to discover a new device click the Discover New Devices Now button at any time or use the scripting command documented above.
supported_hardware/tplink.1573840257.txt.gz · Last modified: 2019/11/15 17:50 by James Sentman