[tplinksmarthome] Add support for TP-Link KP401 Smart WiFi Outdoor Plug (#13818)

* [tplinksmarthome] Adding support for tp-link KP401 Smart WiFi Outdoor Plug

Signed-off-by: Øystein Bedin <oybed78@gmail.com>
This commit is contained in:
Øystein Bedin 2022-12-01 14:50:28 -07:00 committed by GitHub
parent 43d01ad49c
commit 8d39875219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 14 deletions

View File

@ -307,6 +307,12 @@ Switching, Brightness and Color is done using the `color` channel.
* LED On/Off
* Wi-Fi signal strength (RSSI)
### KP401 Kasa Smart WiFi Outdoor Plug
* Power On/Off
* LED On/Off
* Wi-Fi signal strength (RSSI)
### KP405 Kasa Smart Wi-Fi Outdoor Plug-In Dimmer
* Power On/Off
@ -377,19 +383,19 @@ Either `deviceId` or `ipAddress` must be set.
All devices support some of the following channels:
| Channel Type ID | Item Type | Description | Thing types supporting this channel |
|---------------------|--------------------------|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| switch | Switch | Power the device on or off. | EP10, EP40, HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS300, KP100, KP105, KP115, KP200, KP303, KP400, KS230, RE270K, RE370K |
| brightness | Dimmer | Set the brightness of device or dimmer. | ES20M, HS220, KB100, KL50, KL60, KL110, KL120, KP405, LB100, LB110, LB120, LB200 |
| colorTemperature | Dimmer | Set the color temperature in percentage. | KB130, KL120, KL125, KL130, KL135, KL400, KL430, LB120, LB130, LB230 |
| colorTemperatureAbs | Number | Set the color temperature in Kelvin. | KB130, KL120, KL125, KL130, KL135, KL400, KL430, LB120, LB130, LB230 |
| color | Color | Set the color of the light. | KB130, KL125, KL130, KL135, KL400, KL430, LB130, LB230 |
| power | Number:Power | Actual energy usage in Watt. | HS110, HS300, KLxxx, KP115, KP125, LBxxx, |
| eneryUsage | Number:Energy | Energy Usage in kWh. | HS110, HS300, KP115, KP125 |
| current | Number:ElectricCurrent | Actual current usage in Ampere. | HS110, HS300, KP115, KP125 |
| voltage | Number:ElectricPotential | Actual voltage usage in Volt. | HS110, HS300, KP115, KP125 |
| led | Switch | Switch the status LED on the device on or off. | ES20M, EP10, EP40, HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS220, HS300, KP100, KP105, KP115, KP125, KP303, KP200, KP400, KP405, KS230 |
| rssi | Number:Power | Wi-Fi signal strength indicator in dBm. | All |
| Channel Type ID | Item Type | Description | Thing types supporting this channel |
|---------------------|--------------------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| switch | Switch | Power the device on or off. | EP10, EP40, HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS300, KP100, KP105, KP115, KP200, KP303, KP400, KP401, KS230, RE270K, RE370K |
| brightness | Dimmer | Set the brightness of device or dimmer. | ES20M, HS220, KB100, KL50, KL60, KL110, KL120, KP405, LB100, LB110, LB120, LB200 |
| colorTemperature | Dimmer | Set the color temperature in percentage. | KB130, KL120, KL125, KL130, KL135, KL400, KL430, LB120, LB130, LB230 |
| colorTemperatureAbs | Number | Set the color temperature in Kelvin. | KB130, KL120, KL125, KL130, KL135, KL400, KL430, LB120, LB130, LB230 |
| color | Color | Set the color of the light. | KB130, KL125, KL130, KL135, KL400, KL430, LB130, LB230 |
| power | Number:Power | Actual energy usage in Watt. | HS110, HS300, KLxxx, KP115, KP125, LBxxx, |
| eneryUsage | Number:Energy | Energy Usage in kWh. | HS110, HS300, KP115, KP125 |
| current | Number:ElectricCurrent | Actual current usage in Ampere. | HS110, HS300, KP115, KP125 |
| voltage | Number:ElectricPotential | Actual voltage usage in Volt. | HS110, HS300, KP115, KP125 |
| led | Switch | Switch the status LED on the device on or off. | ES20M, EP10, EP40, HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS220, HS300, KP100, KP105, KP115, KP125, KP303, KP200, KP400, KP401, KP405, KS230 |
| rssi | Number:Power | Wi-Fi signal strength indicator in dBm. | All |
The outlet devices (EP40, HS107, HS300, KP200, KP400) have group channels.
This means the channel is prefixed with the group id.
@ -418,6 +424,7 @@ tplinksmarthome:hs100:tv "TV" [ deviceId="00000000000000000
tplinksmarthome:hs300:laptop "Laptop" [ deviceId="00000000000000000000000000000004", refresh=60 ]
tplinksmarthome:lb110:bulb1 "Living Room Bulb 1" [ deviceId="00000000000000000000000000000002", refresh=60, transitionPeriod=2500 ]
tplinksmarthome:lb130:bulb2 "Living Room Bulb 2" [ deviceId="00000000000000000000000000000003", refresh=60, transitionPeriod=2500 ]
tplinksmarthome:kp401:outlet "Outdoor Outlet" [ ipAddress="192.168.1.101" ]
```
### tplinksmarthome.items:
@ -430,4 +437,5 @@ Dimmer TP_LB_Bulb "Dimmer [%d %%]" <slider> { channel="tplink
Dimmer TP_LB_ColorT "Color Temperature [%d %%]" <slider> { channel="tplinksmarthome:lb130:bulb2:colorTemperature" }
Color TP_LB_Color "Color" <slider> { channel="tplinksmarthome:lb130:bulb2:color" }
Switch TP_LB_ColorS "Switch" { channel="tplinksmarthome:lb130:bulb2:color" }
Switch TP_O_OUTLET "Outdoor Outlet" { channel="tplinksmarthome:kp401:outlet:switch" }
```

View File

@ -63,7 +63,7 @@ public enum TPLinkSmartHomeThingType {
KP105("kp105", DeviceType.PLUG),
KP115("kp115", DeviceType.PLUG_WITH_ENERGY),
KP125("kp125", DeviceType.PLUG_WITH_ENERGY),
KP405("kp405", DeviceType.DIMMER),
KP401("kp401", DeviceType.PLUG),
// Switch Thing Type UIDs
HS200("hs200", DeviceType.SWITCH),
@ -73,6 +73,7 @@ public enum TPLinkSmartHomeThingType {
ES20M("es20m", DeviceType.DIMMER),
HS220("hs220", DeviceType.DIMMER),
KS230("ks230", DeviceType.DIMMER),
KP405("kp405", DeviceType.DIMMER),
// Power Strip Thing Type UIDs.
EP40("ep40", DeviceType.STRIP, 2),

View File

@ -82,6 +82,8 @@ thing-type.tplinksmarthome.kp400.label = KP400
thing-type.tplinksmarthome.kp400.description = TP-Link KP400 Smart Outdoor Plug
thing-type.tplinksmarthome.kp400.group.outlet1.label = Outlet 1
thing-type.tplinksmarthome.kp400.group.outlet2.label = Outlet 2
thing-type.tplinksmarthome.kp401.label = KP401
thing-type.tplinksmarthome.kp401.description = TP-Link KP401 Kasa Smart WiFi Outdoor Plug
thing-type.tplinksmarthome.kp405.label = KP405
thing-type.tplinksmarthome.kp405.description = TP-Link KP405 Kasa Smart Wi-Fi Outdoor Plug-In Dimmer
thing-type.tplinksmarthome.ks230.label = KS230

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="tplinksmarthome"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<thing-type id="kp401">
<label>KP401</label>
<description>TP-Link KP401 Kasa Smart WiFi Outdoor Plug</description>
<category>PowerOutlet</category>
<channels>
<channel id="switch" typeId="system.power"/>
<channel id="led" typeId="led"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<representation-property>deviceId</representation-property>
<config-description-ref uri="thing-type:tplinksmarthome:device-plug"/>
</thing-type>
</thing:thing-descriptions>