]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] update readme (#9014)
authorMarcel <marcelrv@users.noreply.github.com>
Mon, 16 Nov 2020 20:26:50 +0000 (21:26 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 20:26:50 +0000 (12:26 -0800)
* [miio] update readme

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/README.base.md
bundles/org.openhab.binding.miio/README.md
bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java

index 791f81a23b6090cdf1efa57bd9227905136dfe6d..2591657065b6940f72009d02de40d4f32ecd32a0 100644 (file)
@@ -30,7 +30,8 @@ The binding needs a token from the Xiaomi Mi Device in order to be able to contr
 The binding can retrieve the needed tokens from the Xiaomi cloud. 
 Go to the binding config page and enter your cloud username and password. 
 The server(s) to which your devices are connected need to be entered as well. 
-Use the one of the regional servers: ru,us,tw,sg,cn,de. Multiple servers can be separated with comma, or leave blank to test all known servers.
+Use the one of the regional servers: cn,de,i2,tw,ru,sg,us.
+Multiple servers can be separated with comma, or leave blank to test all known servers.
 
 ## Tokens without cloud access
 
@@ -50,7 +51,8 @@ Note. The Xiaomi devices change the token when inclusion is done. Hence if you g
 ## Binding Configuration
 
 No binding configuration is required. However to enable cloud functionality enter your Xiaomi username, password and server(s).
-The list of the known countries and related severs is [here](#Country-Servers)
+The list of the known countries and related severs is [here](#Country-Servers).
+
 After successful Xiaomi cloud login, the binding will use the connection to retrieve the required device tokens from the cloud. 
 For Xiaomi vacuums the map can be visualized in openHAB using the cloud connection.
 
@@ -100,10 +102,10 @@ Besides the regular configuration (like ip address, token) the modelId needs to
 Normally the modelId is populated with the model of your device, however in this case, use the modelId of a similar device.
 Look at the openHAB forum, or the openHAB GitHub repository for the modelId of similar devices.
 
-## Supported property test
+## Supported property test for unsupported devices
 
 The unsupported device has a test channel with switch. When switching on, all known properties are tested, this may take few minutes.
-A test report will be shown in the log and is saved in the userdata/miio folder.
+A test report will be shown in the log and is saved in the `userdata/miio` folder with a filename `test-[your model]-[timestamp].txt`.
 If supported properties are found, an experimental database file is saved to the conf/misc/miio folder (see below chapter).
 The thing will go offline and will come back online as basic device, supporting the found channels.
 The database file may need to be modified to display the right channel names.
@@ -250,6 +252,7 @@ Additionally depending on the capabilities of your robot vacuum other channels m
 ### <a name="Country-Servers">Country Servers</a>
 
 Known country Servers: cn, de, i2, ru, sg, us
+
 Mapping of countries in mihome app to server:
 
 | Country                  | Country Code | Server |
index 9e08ec8fc526e60b80139ae16891cd98022aeed1..f0f96d84ef01d702492492b263e52d77a4e60689 100644 (file)
@@ -30,7 +30,8 @@ The binding needs a token from the Xiaomi Mi Device in order to be able to contr
 The binding can retrieve the needed tokens from the Xiaomi cloud. 
 Go to the binding config page and enter your cloud username and password. 
 The server(s) to which your devices are connected need to be entered as well. 
-Use the one of the regional servers: ru,us,tw,sg,cn,de. Multiple servers can be separated with comma, or leave blank to test all known servers.
+Use the one of the regional servers: cn,de,i2,tw,ru,sg,us.
+Multiple servers can be separated with comma, or leave blank to test all known servers.
 
 ## Tokens without cloud access
 
@@ -50,7 +51,8 @@ Note. The Xiaomi devices change the token when inclusion is done. Hence if you g
 ## Binding Configuration
 
 No binding configuration is required. However to enable cloud functionality enter your Xiaomi username, password and server(s).
-The list of the known countries and related severs is [here](#Country-Servers)
+The list of the known countries and related severs is [here](#Country-Servers).
+
 After successful Xiaomi cloud login, the binding will use the connection to retrieve the required device tokens from the cloud. 
 For Xiaomi vacuums the map can be visualized in openHAB using the cloud connection.
 
@@ -82,6 +84,8 @@ or in case of unknown models include the model information of a similar device t
 
 # Mi IO Devices
 
+Currently the miio binding supports more than 200 different models.
+
 | Device                       | ThingType        | Device Model           | Supported | Remark     |
 |------------------------------|------------------|------------------------|-----------|------------|
 | AUX Air Conditioner          | miio:unsupported | aux.aircondition.v1    | No        |            |
@@ -346,10 +350,10 @@ Besides the regular configuration (like ip address, token) the modelId needs to
 Normally the modelId is populated with the model of your device, however in this case, use the modelId of a similar device.
 Look at the openHAB forum, or the openHAB GitHub repository for the modelId of similar devices.
 
-## Supported property test
+## Supported property test for unsupported devices
 
 The unsupported device has a test channel with switch. When switching on, all known properties are tested, this may take few minutes.
-A test report will be shown in the log and is saved in the userdata/miio folder.
+A test report will be shown in the log and is saved in the `userdata/miio` folder with a filename `test-[your model]-[timestamp].txt`.
 If supported properties are found, an experimental database file is saved to the conf/misc/miio folder (see below chapter).
 The thing will go offline and will come back online as basic device, supporting the found channels.
 The database file may need to be modified to display the right channel names.
@@ -6631,6 +6635,7 @@ Number usedhours "Run Time" (G_heater) {channel="miio:basic:heater:usedhours"}
 ### <a name="Country-Servers">Country Servers</a>
 
 Known country Servers: cn, de, i2, ru, sg, us
+
 Mapping of countries in mihome app to server:
 
 | Country                  | Country Code | Server |
index baf2592c2bde9f1b9c9c6eccfed6c1a3cf3116c8..090e22b9579bdad100e4819273fee2e76fc9f179 100644 (file)
@@ -79,8 +79,14 @@ public class ReadmeHelper {
     }
 
     private StringWriter deviceList() {
+        long items = Arrays.asList(MiIoDevices.values()).stream()
+                .filter(device -> !device.getThingType().equals(MiIoBindingConstants.THING_TYPE_UNSUPPORTED)).count();
+        String devicesCount = String.format("Currently the miio binding supports more than %d different models.",
+                (items / 10) * 10);
+        LOGGER.info(devicesCount);
         StringWriter sw = new StringWriter();
-
+        sw.write(devicesCount);
+        sw.write("\r\n\r\n");
         sw.write(
                 "| Device                       | ThingType        | Device Model           | Supported | Remark     |\r\n");
         sw.write(
@@ -177,7 +183,9 @@ public class ReadmeHelper {
         for (MiIoBasicDevice entry : findDatabaseEntrys()) {
             for (String id : entry.getDevice().getId()) {
                 if (!MiIoDevices.getType(id).getThingType().equals(MiIoBindingConstants.THING_TYPE_BASIC)) {
-                    LOGGER.info("id :" + id + " not found");
+                    LOGGER.info("id : {} " + id
+                            + " not found. Suggested line to add to MiIoDevices.java: {}(\"{}\", \"{}\", THING_TYPE_BASIC),",
+                            id, id.toUpperCase().replace(".", "_"), id, id);
                 }
             }
         }