]> git.basschouten.com Git - openhab-addons.git/commitdiff
[tapocontrol] fix "device not found" with L510/L530 hw rev2 / add L920 and P110 thing...
authorChristian Wild <40909464+wildcs@users.noreply.github.com>
Thu, 6 Jan 2022 11:29:44 +0000 (12:29 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Jan 2022 11:29:44 +0000 (12:29 +0100)
* [tapocontrol] P110 and L920 Things added
* [tapocontrol] Fixed L510/L530 Series Bug with HW-Rev2.0

Signed-off-by: Christian Wild <christian@wild-bw.de>
13 files changed:
bundles/org.openhab.binding.tapocontrol/README.md
bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/TapoDiscoveryService.java
bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/constants/TapoThingConstants.java
bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/structures/TapoDeviceInfo.java
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510.xml [new file with mode: 0644]
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510_Series.xml [deleted file]
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530.xml [new file with mode: 0644]
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530_Series.xml [deleted file]
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L900.xml
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L920.xml [new file with mode: 0644]
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/P105.xml
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/P110.xml [new file with mode: 0644]

index 77074f476d8ab83d6073ad6b5db8de3077825e38..843f7cc584863745177701378ebb5f89c39dde07 100644 (file)
@@ -6,13 +6,13 @@ This binding adds support to control Tapo (Copyright © TP-Link Corporation Limi
 
 The following Tapo-Devices are supported
 
-### P100/P105 SmartPlug (WiFi)
+### P100/P105/P110 SmartPlug (WiFi)
 
 * Power On/Off
 * Wi-Fi signal (SignalStrength)
 * On-Time (Time in seconds device is switched on)
 
-### L510_Series dimmable SmartBulb (WiFi)
+### L510(Series) dimmable SmartBulb (WiFi)
 
 * Light On/Off
 * Brightnes (Dimmer)  0-100 %
@@ -20,7 +20,7 @@ The following Tapo-Devices are supported
 * Wi-Fi signal (SignalStrength)
 * On-Time (Time in seconds device is switched on)
 
-### L530_Series MultiColor SmartBulb (WiFi)
+### L530(Series) MultiColor SmartBulb (WiFi)
 
 * Light On/Off
 * Brightnes (Dimmer)  0-100 %
@@ -29,7 +29,7 @@ The following Tapo-Devices are supported
 * Wi-Fi signal (SignalStrength)
 * On-Time (Time in seconds device is switched on)
 
-### L900 MultiColor LightStrip (WiFi)
+### L900/L920 LED-LightStrip (WiFi)
 
 * Light On/Off
 * Brightnes (Dimmer)  0-100 %
@@ -79,14 +79,14 @@ The thing has the following configuration parameters:
 
 All devices support some of the following channels:
 
-| group     | channel          |type                    | description                  | things supporting this channel  |
-|-----------|----------------- |------------------------|------------------------------|---------------------------------|
-| actuator  | output           | Switch                 | Power device on or off       | P100, P105,L510, L530, L900     |
-|           | brightness       | Dimmer                 | Brightness 0-100%            | L510, L530, L900                |
-|           | colorTemperature | Number                 | White-Color-Temp 2500-6500K  | L510, L530, L900                |
-|           | color            | Color                  | Color                        | L530, L900                      |
-| device    | wifiSignal       | system.signal-strength | WiFi-quality-level           | P100, P105, L510, L530, L900    |
-|           | onTime           | Number:Time            | seconds output is on         | P100, P105, L510, L530, L900    |
+| group     | channel          |type                    | description                  | things supporting this channel              |
+|-----------|----------------- |------------------------|------------------------------|---------------------------------------------|
+| actuator  | output           | Switch                 | Power device on or off       | P100, P105, P110, L510, L530, L900, L920    |
+|           | brightness       | Dimmer                 | Brightness 0-100%            | L510, L530, L900                            |
+|           | colorTemperature | Number                 | White-Color-Temp 2500-6500K  | L510, L530, L900                            |
+|           | color            | Color                  | Color                        | L530, L900                                  |
+| device    | wifiSignal       | system.signal-strength | WiFi-quality-level           | P100, P105, P110, L510, L530, L900, L920    |
+|           | onTime           | Number:Time            | seconds output is on         | P100, P105, P110, L510, L530, L900, L920    |
 
 
 ## Channel Refresh
@@ -102,8 +102,8 @@ To minimize network traffic the default refresh-rate is set to 30 seconds. This
 ```
 tapocontrol:bridge:myTapoBridge                     "Cloud-Login"               [ username="you@yourpovider.com", password="verysecret" ]
 tapocontrol:P100:myTapoBridge:mySocket              "My-Socket"                 [ ipAddress="192.168.178.150", pollingInterval=30 ]
-tapocontrol:L510_Series:myTapoBridge:whiteBulb      "white-light"               [ ipAddress="192.168.178.151", pollingInterval=30 ]
-tapocontrol:L530_Series:myTapoBridge:colorBulb      "color-light"               [ ipAddress="192.168.178.152", pollingInterval=30 ]
+tapocontrol:L510:myTapoBridge:whiteBulb                "white-light"               [ ipAddress="192.168.178.151", pollingInterval=30 ]
+tapocontrol:L530:myTapoBridge:colorBulb                "color-light"               [ ipAddress="192.168.178.152", pollingInterval=30 ]
 tapocontrol:L900:myTapoBridge:myLightStrip          "light-strip"               [ ipAddress="192.168.178.153", pollingInterval=30 ]
 ``` 
 
index 12bd4ea07a4df4662c5561454f457c5e9a819028..1926e5b2b3a1d70296d951208aa28411b69152b6 100644 (file)
@@ -193,6 +193,7 @@ public class TapoDiscoveryService extends AbstractDiscoveryService implements Th
             String deviceModel = device.get(CLOUD_PROPERTY_MODEL).getAsString();
             deviceModel = deviceModel.replaceAll("\\(.*\\)", ""); // replace (DE)
             deviceModel = deviceModel.replace("Tapo", "");
+            deviceModel = deviceModel.replace("Series", "");
             deviceModel = deviceModel.trim();
             deviceModel = deviceModel.replace(" ", "_");
             return deviceModel;
index faa22611a2f93d47c5ab52235443da5a661a43a1..4f8620629fbea025193487b1df19e778ebb15c1e 100644 (file)
@@ -36,9 +36,11 @@ public class TapoThingConstants {
     public static final String DEVICE_BRIDGE = "bridge";
     public static final String DEVICE_P100 = "P100";
     public static final String DEVICE_P105 = "P105";
-    public static final String DEVICE_L510E = "L510_Series";
-    public static final String DEVICE_L530E = "L530_Series";
+    public static final String DEVICE_P110 = "P110";
+    public static final String DEVICE_L510 = "L510";
+    public static final String DEVICE_L530 = "L530";
     public static final String DEVICE_L900 = "L900";
+    public static final String DEVICE_L920 = "L920";
     public static final String DEVICE_UNIVERSAL = "Test_Device";
 
     /*** LIST OF SUPPORTED DEVICE DESCRIPTIONS ***/
@@ -52,17 +54,20 @@ public class TapoThingConstants {
     public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_BRIDGE);
     public static final ThingTypeUID P100_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P100);
     public static final ThingTypeUID P105_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P105);
-    public static final ThingTypeUID L510E_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L510E);
-    public static final ThingTypeUID L530E_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L530E);
+    public static final ThingTypeUID P110_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P110);
+    public static final ThingTypeUID L510_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L510);
+    public static final ThingTypeUID L530_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L530);
     public static final ThingTypeUID L900_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L900);
+    public static final ThingTypeUID L920_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L920);
     public static final ThingTypeUID UNIVERSAL_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_UNIVERSAL);
 
     /*** SET OF SUPPORTED UIDS ***/
     public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_UIDS = Set.of(BRIDGE_THING_TYPE);
-    public static final Set<ThingTypeUID> SUPPORTED_SMART_PLUG_UIDS = Set.of(P100_THING_TYPE, P105_THING_TYPE);
-    public static final Set<ThingTypeUID> SUPPORTED_WHITE_BULB_UIDS = Set.of(L510E_THING_TYPE);
-    public static final Set<ThingTypeUID> SUPPORTED_COLOR_BULB_UIDS = Set.of(L530E_THING_TYPE);
-    public static final Set<ThingTypeUID> SUPPORTED_LIGHT_STRIP_UIDS = Set.of(L900_THING_TYPE);
+    public static final Set<ThingTypeUID> SUPPORTED_SMART_PLUG_UIDS = Set.of(P100_THING_TYPE, P105_THING_TYPE,
+            P110_THING_TYPE);
+    public static final Set<ThingTypeUID> SUPPORTED_WHITE_BULB_UIDS = Set.of(L510_THING_TYPE);
+    public static final Set<ThingTypeUID> SUPPORTED_COLOR_BULB_UIDS = Set.of(L530_THING_TYPE);
+    public static final Set<ThingTypeUID> SUPPORTED_LIGHT_STRIP_UIDS = Set.of(L900_THING_TYPE, L920_THING_TYPE);
     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
             .unmodifiableSet(Stream
                     .of(SUPPORTED_BRIDGE_UIDS, SUPPORTED_SMART_PLUG_UIDS, SUPPORTED_WHITE_BULB_UIDS,
index 641d3578b6ada2f13eac7b57db823be07c99cc3a..1ca699bc5b1728edd0dff75f6412c797409f6e58 100644 (file)
@@ -166,7 +166,7 @@ public class TapoDeviceInfo {
     }
 
     public String getModel() {
-        return model.replace(" ", "_");
+        return model.replace(" Series", "");
     }
 
     public String getNickname() {
index 57d88f6eda97cd0ebaea7a4ff790761e76c26b54..b0586bc6b9ef568465d31bcf0fe72b0be9a663a7 100644 (file)
@@ -5,16 +5,20 @@ binding.tapocontrol.description = Control your TAPO-SmartHome Devices
 
 # thing types
 
-thing-type.tapocontrol.L510_Series.label = L510 Series White-Bulb
-thing-type.tapocontrol.L510_Series.description = Tapo Smart dimmable White-Light-Bulb
-thing-type.tapocontrol.L530_Series.label = L530 Series Color-Bulb
-thing-type.tapocontrol.L530_Series.description = Tapo Smart Multicolor Light-Bulb
+thing-type.tapocontrol.L510.label = L510 Series White-Bulb
+thing-type.tapocontrol.L510.description = Tapo Smart dimmable White-Light-Bulb
+thing-type.tapocontrol.L530.label = L530 Series Color-Bulb
+thing-type.tapocontrol.L530.description = Tapo Smart Multicolor Light-Bulb
 thing-type.tapocontrol.L900.label = L900 LightStrip
-thing-type.tapocontrol.L900.description = Tapo Smart Multicolor Light-Lightstrip
+thing-type.tapocontrol.L900.description = Tapo Smart LED-Lightstrip
+thing-type.tapocontrol.L920.label = L920 LightStrip
+thing-type.tapocontrol.L920.description = Tapo Smart Multicolor LED-Lightstrip
 thing-type.tapocontrol.P100.label = P100 SmartPlug
 thing-type.tapocontrol.P100.description = Tapo Smart Wifi Plug
 thing-type.tapocontrol.P105.label = P105 SmartPlug
 thing-type.tapocontrol.P105.description = Tapo Mini Smart Wifi Plug
+thing-type.tapocontrol.P110.label = P110 SmartPlug
+thing-type.tapocontrol.P110.description = Tapo Smart Monitoring Wifi Plug
 thing-type.tapocontrol.bridge.label = Cloud-Login
 thing-type.tapocontrol.bridge.description = Cloud Connector. Acts as device-bridge
 
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510.xml
new file mode 100644 (file)
index 0000000..d6a47a0
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="tapocontrol"
+       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">
+
+       <!-- L510 THING-TYPE (WHITE-LIGHT-BULB) -->
+       <thing-type id="L510">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+               </supported-bridge-type-refs>
+
+               <label>L510 Series White-Bulb</label>
+               <description>Tapo Smart dimmable White-Light-Bulb</description>
+               <channel-groups>
+                       <channel-group id="actuator" typeId="lightBulb"/>
+                       <channel-group id="device" typeId="deviceState"/>
+               </channel-groups>
+               <representation-property>macAddress</representation-property>
+
+               <config-description-ref uri="thing-type:tapo:device"/>
+       </thing-type>
+</thing:thing-descriptions>
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510_Series.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L510_Series.xml
deleted file mode 100644 (file)
index ff96871..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<thing:thing-descriptions bindingId="tapocontrol"
-       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">
-
-       <!-- L510E THING-TYPE (WHITE-LIGHT-BULB) -->
-       <thing-type id="L510_Series">
-               <supported-bridge-type-refs>
-                       <bridge-type-ref id="bridge"/>
-               </supported-bridge-type-refs>
-
-               <label>L510 Series White-Bulb</label>
-               <description>Tapo Smart dimmable White-Light-Bulb</description>
-               <channel-groups>
-                       <channel-group id="actuator" typeId="lightBulb"/>
-                       <channel-group id="device" typeId="deviceState"/>
-               </channel-groups>
-               <representation-property>macAddress</representation-property>
-
-               <config-description-ref uri="thing-type:tapo:device"/>
-       </thing-type>
-</thing:thing-descriptions>
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530.xml
new file mode 100644 (file)
index 0000000..679cbb3
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="tapocontrol"
+       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">
+
+       <!-- L530 THING-TYPE (COLOR-LIGHT-BULB) -->
+       <thing-type id="L530">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+               </supported-bridge-type-refs>
+
+               <label>L530 Series Color-Bulb</label>
+               <description>Tapo Smart Multicolor Light-Bulb</description>
+               <channel-groups>
+                       <channel-group id="actuator" typeId="colorBulb"/>
+                       <channel-group id="device" typeId="deviceState"/>
+               </channel-groups>
+               <representation-property>macAddress</representation-property>
+
+               <config-description-ref uri="thing-type:tapo:device"/>
+       </thing-type>
+</thing:thing-descriptions>
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530_Series.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L530_Series.xml
deleted file mode 100644 (file)
index 4f94a24..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<thing:thing-descriptions bindingId="tapocontrol"
-       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">
-
-       <!-- L530 Series THING-TYPE (COLOR-LIGHT-BULB) -->
-       <thing-type id="L530_Series">
-               <supported-bridge-type-refs>
-                       <bridge-type-ref id="bridge"/>
-               </supported-bridge-type-refs>
-
-               <label>L530 Series Color-Bulb</label>
-               <description>Tapo Smart Multicolor Light-Bulb</description>
-               <channel-groups>
-                       <channel-group id="actuator" typeId="colorBulb"/>
-                       <channel-group id="device" typeId="deviceState"/>
-               </channel-groups>
-               <representation-property>macAddress</representation-property>
-
-               <config-description-ref uri="thing-type:tapo:device"/>
-       </thing-type>
-</thing:thing-descriptions>
index 36b2c0614b9d9e1c018c181c22550026dbd690dd..d6948c8f79426799eaac39e6e6e92f24a9432afc 100644 (file)
@@ -4,14 +4,14 @@
        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">
 
-       <!-- L530 Series THING-TYPE (COLOR-LIGHT-BULB) -->
+       <!-- L900 Series THING-TYPE (COLOR-LED-Lightstrip) -->
        <thing-type id="L900">
                <supported-bridge-type-refs>
                        <bridge-type-ref id="bridge"/>
                </supported-bridge-type-refs>
 
                <label>L900 LightStrip</label>
-               <description>Tapo Smart Multicolor Light-Lightstrip</description>
+               <description>Tapo Smart LED-Lightstrip</description>
                <channel-groups>
                        <channel-group id="actuator" typeId="lightStrip"/>
                        <channel-group id="device" typeId="deviceState"/>
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L920.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/L920.xml
new file mode 100644 (file)
index 0000000..d62285c
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="tapocontrol"
+       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">
+
+       <!-- L920 THING-TYPE (Multicolor LED-Lightstrip) -->
+       <thing-type id="L920">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+               </supported-bridge-type-refs>
+
+               <label>L920 LightStrip</label>
+               <description>Tapo Smart Multicolor LED-Lightstrip</description>
+               <channel-groups>
+                       <channel-group id="actuator" typeId="lightStrip"/>
+                       <channel-group id="device" typeId="deviceState"/>
+               </channel-groups>
+               <representation-property>macAddress</representation-property>
+
+               <config-description-ref uri="thing-type:tapo:device"/>
+       </thing-type>
+</thing:thing-descriptions>
index f3819cea149bace47490ea123b622204c125a1ca..e567d790b0612da9a6f6ea496786bf8d962df31f 100644 (file)
@@ -4,7 +4,7 @@
        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">
 
-       <!-- P100 THING-TYPE (SOCKET) -->
+       <!-- P105 THING-TYPE (SOCKET) -->
        <thing-type id="P105">
                <supported-bridge-type-refs>
                        <bridge-type-ref id="bridge"/>
diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/P110.xml b/bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/thing/P110.xml
new file mode 100644 (file)
index 0000000..7eb4bff
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="tapocontrol"
+       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">
+
+       <!-- P110 THING-TYPE (SOCKET) -->
+       <thing-type id="P110">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+               </supported-bridge-type-refs>
+
+               <label>P110 SmartPlug</label>
+               <description>Tapo Smart Monitoring Wifi Plug</description>
+               <channel-groups>
+                       <channel-group id="actuator" typeId="smartPlug"/>
+                       <channel-group id="device" typeId="deviceState"/>
+               </channel-groups>
+               <representation-property>macAddress</representation-property>
+
+               <config-description-ref uri="thing-type:tapo:device"/>
+       </thing-type>
+</thing:thing-descriptions>