From 8d398752198e0ec49e890613f92d45d714c0215e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Bedin?= Date: Thu, 1 Dec 2022 14:50:28 -0700 Subject: [PATCH] [tplinksmarthome] Add support for TP-Link KP401 Smart WiFi Outdoor Plug (#13818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [tplinksmarthome] Adding support for tp-link KP401 Smart WiFi Outdoor Plug Signed-off-by: Øystein Bedin --- .../README.md | 34 ++++++++++++------- .../internal/TPLinkSmartHomeThingType.java | 3 +- .../OH-INF/i18n/tplinksmarthome.properties | 2 ++ .../src/main/resources/OH-INF/thing/KP401.xml | 22 ++++++++++++ 4 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/thing/KP401.xml diff --git a/bundles/org.openhab.binding.tplinksmarthome/README.md b/bundles/org.openhab.binding.tplinksmarthome/README.md index cd820ce41..2facf9603 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/README.md +++ b/bundles/org.openhab.binding.tplinksmarthome/README.md @@ -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 %%]" { channel="tplink Dimmer TP_LB_ColorT "Color Temperature [%d %%]" { channel="tplinksmarthome:lb130:bulb2:colorTemperature" } Color TP_LB_Color "Color" { 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" } ``` diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java index c4b35b711..396200595 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java @@ -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), diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/i18n/tplinksmarthome.properties b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/i18n/tplinksmarthome.properties index 9fde9b44e..90f527a75 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/i18n/tplinksmarthome.properties +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/i18n/tplinksmarthome.properties @@ -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 diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/thing/KP401.xml b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/thing/KP401.xml new file mode 100644 index 000000000..6613d587f --- /dev/null +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/OH-INF/thing/KP401.xml @@ -0,0 +1,22 @@ + + + + + + TP-Link KP401 Kasa Smart WiFi Outdoor Plug + PowerOutlet + + + + + + + + deviceId + + + +