[miio] add new country server and improve readme (#8816)

* [miio] add new country server and improve readme
* [miio] apply spotless

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel 2020-10-21 23:14:14 +02:00 committed by GitHub
parent 998d11455c
commit ed6d68ffd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 521 additions and 8 deletions

View File

@ -50,7 +50,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).
After succesfull Xiaomi cloud login, the binding will use the connection to retrieve the required device tokens from the cloud.
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.
![Binding Config](doc/miioBindingConfig.jpg)
@ -197,3 +198,258 @@ Additionally depending on the capabilities of your robot vacuum other channels m
!!!itemFileExamples
###(<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 |
|--------------------------|--------------|--------|
| Afghanistan | AF | sg |
| Albania | AL | de |
| Algeria | DZ | sg |
| American Samoa | AS | sg |
| Andorra | AD | de |
| Angola | AO | sg |
| Anguilla | AI | us |
| Antarctica | AQ | sg |
| Antigua and Barbuda | AG | us |
| Argentina | AR | us |
| Armenia | AM | sg |
| Aruba | AW | us |
| Ascension Island | AC | sg |
| Australia | AU | sg |
| Austria | AT | de |
| Azerbaijan | AZ | sg |
| Bahamas | BS | us |
| Bahrain | BH | sg |
| Bangladesh | BD | sg |
| Barbados | BB | us |
| Belarus | BY | de |
| Belgium | BE | de |
| Belize | BZ | us |
| Benin | BJ | sg |
| Bermuda | BM | us |
| Bhutan | BT | sg |
| Bolivia | BO | us |
| Bosnia and Herzegovina | BA | de |
| Botswana | BW | sg |
| Bouvet Island | BV | sg |
| Brazil | BR | us |
| British Indian Ocean Territory | IO | sg |
| British Virgin Islands | VG | us |
| Brunei | BN | sg |
| Bulgaria | BG | de |
| Burkina Faso | BF | sg |
| Burundi | BI | sg |
| Cambodia | KH | sg |
| Cameroon | CM | sg |
| Canada | CA | us |
| Canary Islands | IC | sg |
| Cape Verde | CV | sg |
| Cayman Islands | KY | us |
| Central African Republic | CF | sg |
| Ceuta and Melilla | EA | de |
| Chad | TD | sg |
| Chile | CL | us |
| Chinese mainland | CN | cn |
| Christmas Island | CX | sg |
| Cocos Islands | CC | sg |
| Colombia | CO | us |
| Comoros | KM | sg |
| Congo - Brazzaville | CG | sg |
| Congo - Kinshasa | CD | sg |
| Cook Islands | CK | sg |
| Costa Rica | CR | us |
| Croatia | HR | de |
| Curaçao | CW | us |
| Cyprus | CY | de |
| Czechia | CZ | de |
| Côte d'Ivoire | CI | sg |
| Denmark | DK | de |
| Diego Garcia | DG | sg |
| Djibouti | DJ | sg |
| Dominica | DM | us |
| Dominican Republic | DO | us |
| Dutch Caribbean | BQ | us |
| Ecuador | EC | us |
| Egypt | EG | sg |
| El Salvador | SV | us |
| Equatorial Guinea | GQ | sg |
| Eritrea | ER | sg |
| Estonia | EE | de |
| Ethiopia | ET | sg |
| Falkland Islands | FK | us |
| Faroe Islands | FO | de |
| Fiji | FJ | sg |
| Finland | FI | de |
| France | FR | de |
| French Guiana | GF | de |
| French Southern Territories | TF | sg |
| French polynesia | PF | sg |
| Gabon | GA | sg |
| Gambia | GM | sg |
| Georgia | GE | sg |
| Germany | DE | de |
| Ghana | GH | sg |
| Gibraltar | GI | de |
| Greece | GR | de |
| Greenland | GL | us |
| Grenada | GD | us |
| Guadeloupe | GP | us |
| Guam | GU | sg |
| Guatemala | GT | us |
| Guernsey | GG | de |
| Guinea | GN | sg |
| Guinea-Bissau | GW | sg |
| Guyana | GY | us |
| Haiti | HT | us |
| Honduras | HN | us |
| Hong Kong | HK | sg |
| Hungary | HU | de |
| Iceland | IS | de |
| India | IN | i2 |
| Indonesia | ID | sg |
| Iraq | IQ | sg |
| Ireland | IE | de |
| Isle of Man | IM | de |
| Israel | IL | sg |
| Italy | IT | de |
| Jamaica | JM | us |
| Japan | JP | sg |
| Jersey | JE | de |
| Jordan | JO | sg |
| Kazakhstan | KZ | sg |
| Kenya | KE | sg |
| Kiribati | KI | sg |
| Kosovo | XK | de |
| Kuwait | KW | sg |
| Kyrgyzstan | KG | sg |
| Laos | LA | sg |
| Latvia | LV | de |
| Lebanon | LB | sg |
| Lesotho | LS | sg |
| Liberia | LR | sg |
| Libya | LY | sg |
| Liechtenstein | LI | de |
| Lithuania | LT | de |
| Luxembourg | LU | de |
| Macao | MO | sg |
| Macedonia | MK | de |
| Madagascar | MG | sg |
| Malawi | MW | sg |
| Malaysia | MY | sg |
| Maldives | MV | sg |
| Mali | ML | sg |
| Malta | MT | de |
| Marshall islands | MH | sg |
| Martinique | MQ | us |
| Mauritania | MR | sg |
| Mauritius | MU | sg |
| Mayotte | YT | sg |
| Mexico | MX | us |
| Micronesia | FM | sg |
| Moldova | MD | de |
| Monaco | MC | de |
| Mongolia | MN | sg |
| Montenegro | ME | de |
| Montserrat | MS | us |
| Morocco | MA | sg |
| Mozambique | MZ | sg |
| Myanmar (Burma) | MM | sg |
| Namibia | NA | sg |
| Nauru | NR | sg |
| Nepal | NP | sg |
| Netherlands | NL | de |
| New Caledonia | NC | sg |
| New Zealand | NZ | sg |
| Nicaragua | NI | us |
| Niger | NE | sg |
| Nigeria | NG | sg |
| Niue | NU | sg |
| Norfolk Island | NF | sg |
| Northern Mariana Islands | MP | sg |
| Norway | NO | de |
| Oman | OM | sg |
| Pakistan | PK | sg |
| Palau | PW | sg |
| Palestinian Territories | PS | sg |
| Panama | PA | us |
| Papua New Guinea | PG | sg |
| Paraguay | PY | us |
| Peru | PE | us |
| Philippines | PH | sg |
| Pitcairn Islands | PN | sg |
| Poland | PL | de |
| Portugal | PT | de |
| Puerto Rico | PR | us |
| Qatar | QA | sg |
| Romania | RO | de |
| Russia | RU | ru |
| Rwanda | RW | sg |
| Réunion | RE | sg |
| Saint Barthélemy | BL | us |
| Saint Helena | SH | sg |
| Saint Kitts and Nevis | KN | us |
| Saint Lucia | LC | us |
| Saint Martin | MF | de |
| Saint Pierre and Miquelon | PM | us |
| Saint Vincent and The Grenadines | VC | us |
| Samoa | WS | sg |
| San Marino | SM | de |
| Saudi Arabia | SA | sg |
| Senegal | SN | sg |
| Serbia | RS | de |
| Seychelles | SC | sg |
| Sierra Leone | SL | sg |
| Singapore | SG | sg |
| Slovakia | SK | de |
| Slovenia | SI | de |
| Solomon Islands | SB | sg |
| Somalia | SO | sg |
| South Africa | ZA | sg |
| South Georgia and South Sandwich Islands | GS | us |
| South Korea | KR | sg |
| South Sudan | SS | sg |
| Spain | ES | de |
| Sri Lanka | LK | sg |
| Suriname | SR | us |
| Svalbard and Jan Mayen | SJ | de |
| Swaziland | SZ | sg |
| Sweden | SE | de |
| Switzerland | CH | de |
| São Tomé and Príncipe | ST | sg |
| Taiwan | TW | sg |
| Tajikistan | TJ | sg |
| Tanzania | TZ | sg |
| Thailand | TH | sg |
| Timor-Leste | TL | sg |
| Togo | TG | sg |
| Tokelau | TK | sg |
| Tonga | TO | sg |
| Trinidad and Tobago | TT | us |
| Tristan da Cunha | TA | sg |
| Tunisia | TN | sg |
| Turkey | TR | sg |
| Turkmenistan | TM | sg |
| Turks and Caicos Islands | TC | us |
| Tuvalu | TV | sg |
| U.S. Virgin Islands | VI | us |
| Uganda | UG | sg |
| Ukraine | UA | de |
| United Arab Emirates | AE | sg |
| United Kingdom | GB | de |
| United States | US | us |
| United States Minor Outlying Islands | UM | us |
| Uruguay | UY | us |
| Uzbekistan | UZ | sg |
| Vanuatu | VU | sg |
| Vatican | VA | de |
| Vietnam | VN | sg |
| Wallis and Futuna | WF | sg |
| Western Sahara | EH | sg |
| Yemen | YE | sg |
| Zambia | ZM | sg |
| Zimbabwe | ZW | sg |
| Åland Islands | AX | de |

View File

@ -50,7 +50,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).
After succesfull Xiaomi cloud login, the binding will use the connection to retrieve the required device tokens from the cloud.
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.
![Binding Config](doc/miioBindingConfig.jpg)
@ -164,7 +165,7 @@ or in case of unknown models include the model information e.g.:
| Philips Light | miio:basic | [philips.light.cbulb](#philips-light-cbulb) | Yes | |
| Philips Light | miio:basic | [philips.light.cbulbs](#philips-light-cbulbs) | Yes | |
| Philips Light | miio:basic | [philips.light.dcolor](#philips-light-dcolor) | Yes | |
| Light | miio:basic | [philips.light.rwread](#philips-light-rwread) | Yes | |
| Philips Light | miio:basic | [philips.light.rwread](#philips-light-rwread) | Yes | |
| Philips Light | miio:basic | [philips.light.lnblight1](#philips-light-lnblight1) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Philips Light | miio:basic | [philips.light.lnblight2](#philips-light-lnblight2) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
| Philips Light | miio:basic | [philips.light.lnlrlight](#philips-light-lnlrlight) | Yes | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
@ -1423,7 +1424,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena
| switch_en | Switch | Switch Enabled | |
| delayoff | Switch | Delay Off | |
### Light (<a name="philips-light-rwread">philips.light.rwread</a>) Channels
### Philips Light (<a name="philips-light-rwread">philips.light.rwread</a>) Channels
| Channel | Type | Description | Comment |
|------------------|---------|-------------------------------------|------------|
@ -4373,12 +4374,12 @@ Switch switch_en "Switch Enabled" (G_light) {channel="miio:basic:light:switch_en
Switch delayoff "Delay Off" (G_light) {channel="miio:basic:light:delayoff"}
```
### Light (philips.light.rwread) item file lines
### Philips Light (philips.light.rwread) item file lines
note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.
```java
Group G_light "Light" <status>
Group G_light "Philips Light" <status>
Switch power "Power" (G_light) {channel="miio:basic:light:power"}
Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
Number scene "Scene" (G_light) {channel="miio:basic:light:scene"}
@ -6377,3 +6378,258 @@ 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 |
|--------------------------|--------------|--------|
| Afghanistan | AF | sg |
| Albania | AL | de |
| Algeria | DZ | sg |
| American Samoa | AS | sg |
| Andorra | AD | de |
| Angola | AO | sg |
| Anguilla | AI | us |
| Antarctica | AQ | sg |
| Antigua and Barbuda | AG | us |
| Argentina | AR | us |
| Armenia | AM | sg |
| Aruba | AW | us |
| Ascension Island | AC | sg |
| Australia | AU | sg |
| Austria | AT | de |
| Azerbaijan | AZ | sg |
| Bahamas | BS | us |
| Bahrain | BH | sg |
| Bangladesh | BD | sg |
| Barbados | BB | us |
| Belarus | BY | de |
| Belgium | BE | de |
| Belize | BZ | us |
| Benin | BJ | sg |
| Bermuda | BM | us |
| Bhutan | BT | sg |
| Bolivia | BO | us |
| Bosnia and Herzegovina | BA | de |
| Botswana | BW | sg |
| Bouvet Island | BV | sg |
| Brazil | BR | us |
| British Indian Ocean Territory | IO | sg |
| British Virgin Islands | VG | us |
| Brunei | BN | sg |
| Bulgaria | BG | de |
| Burkina Faso | BF | sg |
| Burundi | BI | sg |
| Cambodia | KH | sg |
| Cameroon | CM | sg |
| Canada | CA | us |
| Canary Islands | IC | sg |
| Cape Verde | CV | sg |
| Cayman Islands | KY | us |
| Central African Republic | CF | sg |
| Ceuta and Melilla | EA | de |
| Chad | TD | sg |
| Chile | CL | us |
| Chinese mainland | CN | cn |
| Christmas Island | CX | sg |
| Cocos Islands | CC | sg |
| Colombia | CO | us |
| Comoros | KM | sg |
| Congo - Brazzaville | CG | sg |
| Congo - Kinshasa | CD | sg |
| Cook Islands | CK | sg |
| Costa Rica | CR | us |
| Croatia | HR | de |
| Curaçao | CW | us |
| Cyprus | CY | de |
| Czechia | CZ | de |
| Côte d'Ivoire | CI | sg |
| Denmark | DK | de |
| Diego Garcia | DG | sg |
| Djibouti | DJ | sg |
| Dominica | DM | us |
| Dominican Republic | DO | us |
| Dutch Caribbean | BQ | us |
| Ecuador | EC | us |
| Egypt | EG | sg |
| El Salvador | SV | us |
| Equatorial Guinea | GQ | sg |
| Eritrea | ER | sg |
| Estonia | EE | de |
| Ethiopia | ET | sg |
| Falkland Islands | FK | us |
| Faroe Islands | FO | de |
| Fiji | FJ | sg |
| Finland | FI | de |
| France | FR | de |
| French Guiana | GF | de |
| French Southern Territories | TF | sg |
| French polynesia | PF | sg |
| Gabon | GA | sg |
| Gambia | GM | sg |
| Georgia | GE | sg |
| Germany | DE | de |
| Ghana | GH | sg |
| Gibraltar | GI | de |
| Greece | GR | de |
| Greenland | GL | us |
| Grenada | GD | us |
| Guadeloupe | GP | us |
| Guam | GU | sg |
| Guatemala | GT | us |
| Guernsey | GG | de |
| Guinea | GN | sg |
| Guinea-Bissau | GW | sg |
| Guyana | GY | us |
| Haiti | HT | us |
| Honduras | HN | us |
| Hong Kong | HK | sg |
| Hungary | HU | de |
| Iceland | IS | de |
| India | IN | i2 |
| Indonesia | ID | sg |
| Iraq | IQ | sg |
| Ireland | IE | de |
| Isle of Man | IM | de |
| Israel | IL | sg |
| Italy | IT | de |
| Jamaica | JM | us |
| Japan | JP | sg |
| Jersey | JE | de |
| Jordan | JO | sg |
| Kazakhstan | KZ | sg |
| Kenya | KE | sg |
| Kiribati | KI | sg |
| Kosovo | XK | de |
| Kuwait | KW | sg |
| Kyrgyzstan | KG | sg |
| Laos | LA | sg |
| Latvia | LV | de |
| Lebanon | LB | sg |
| Lesotho | LS | sg |
| Liberia | LR | sg |
| Libya | LY | sg |
| Liechtenstein | LI | de |
| Lithuania | LT | de |
| Luxembourg | LU | de |
| Macao | MO | sg |
| Macedonia | MK | de |
| Madagascar | MG | sg |
| Malawi | MW | sg |
| Malaysia | MY | sg |
| Maldives | MV | sg |
| Mali | ML | sg |
| Malta | MT | de |
| Marshall islands | MH | sg |
| Martinique | MQ | us |
| Mauritania | MR | sg |
| Mauritius | MU | sg |
| Mayotte | YT | sg |
| Mexico | MX | us |
| Micronesia | FM | sg |
| Moldova | MD | de |
| Monaco | MC | de |
| Mongolia | MN | sg |
| Montenegro | ME | de |
| Montserrat | MS | us |
| Morocco | MA | sg |
| Mozambique | MZ | sg |
| Myanmar (Burma) | MM | sg |
| Namibia | NA | sg |
| Nauru | NR | sg |
| Nepal | NP | sg |
| Netherlands | NL | de |
| New Caledonia | NC | sg |
| New Zealand | NZ | sg |
| Nicaragua | NI | us |
| Niger | NE | sg |
| Nigeria | NG | sg |
| Niue | NU | sg |
| Norfolk Island | NF | sg |
| Northern Mariana Islands | MP | sg |
| Norway | NO | de |
| Oman | OM | sg |
| Pakistan | PK | sg |
| Palau | PW | sg |
| Palestinian Territories | PS | sg |
| Panama | PA | us |
| Papua New Guinea | PG | sg |
| Paraguay | PY | us |
| Peru | PE | us |
| Philippines | PH | sg |
| Pitcairn Islands | PN | sg |
| Poland | PL | de |
| Portugal | PT | de |
| Puerto Rico | PR | us |
| Qatar | QA | sg |
| Romania | RO | de |
| Russia | RU | ru |
| Rwanda | RW | sg |
| Réunion | RE | sg |
| Saint Barthélemy | BL | us |
| Saint Helena | SH | sg |
| Saint Kitts and Nevis | KN | us |
| Saint Lucia | LC | us |
| Saint Martin | MF | de |
| Saint Pierre and Miquelon | PM | us |
| Saint Vincent and The Grenadines | VC | us |
| Samoa | WS | sg |
| San Marino | SM | de |
| Saudi Arabia | SA | sg |
| Senegal | SN | sg |
| Serbia | RS | de |
| Seychelles | SC | sg |
| Sierra Leone | SL | sg |
| Singapore | SG | sg |
| Slovakia | SK | de |
| Slovenia | SI | de |
| Solomon Islands | SB | sg |
| Somalia | SO | sg |
| South Africa | ZA | sg |
| South Georgia and South Sandwich Islands | GS | us |
| South Korea | KR | sg |
| South Sudan | SS | sg |
| Spain | ES | de |
| Sri Lanka | LK | sg |
| Suriname | SR | us |
| Svalbard and Jan Mayen | SJ | de |
| Swaziland | SZ | sg |
| Sweden | SE | de |
| Switzerland | CH | de |
| São Tomé and Príncipe | ST | sg |
| Taiwan | TW | sg |
| Tajikistan | TJ | sg |
| Tanzania | TZ | sg |
| Thailand | TH | sg |
| Timor-Leste | TL | sg |
| Togo | TG | sg |
| Tokelau | TK | sg |
| Tonga | TO | sg |
| Trinidad and Tobago | TT | us |
| Tristan da Cunha | TA | sg |
| Tunisia | TN | sg |
| Turkey | TR | sg |
| Turkmenistan | TM | sg |
| Turks and Caicos Islands | TC | us |
| Tuvalu | TV | sg |
| U.S. Virgin Islands | VI | us |
| Uganda | UG | sg |
| Ukraine | UA | de |
| United Arab Emirates | AE | sg |
| United Kingdom | GB | de |
| United States | US | us |
| United States Minor Outlying Islands | UM | us |
| Uruguay | UY | us |
| Uzbekistan | UZ | sg |
| Vanuatu | VU | sg |
| Vatican | VA | de |
| Vietnam | VN | sg |
| Wallis and Futuna | WF | sg |
| Western Sahara | EH | sg |
| Yemen | YE | sg |
| Zambia | ZM | sg |
| Zimbabwe | ZW | sg |
| Åland Islands | AX | de |

View File

@ -56,7 +56,7 @@ public class CloudConnector {
private String username = "";
private String password = "";
private String country = "ru,us,tw,sg,cn,de";
private String country = "ru,us,tw,sg,cn,de,i2";
private List<CloudDeviceDTO> deviceList = new ArrayList<>();
private boolean connected;
private final HttpClient httpClient;

View File

@ -18,7 +18,8 @@
</parameter>
<parameter name="country" type="text">
<label>Xiaomi server country</label>
<description>Xiaomi server country(s) (e.g. sg,de). Separate multiple servers with comma</description>
<description>Xiaomi server country(s) (e.g. sg,de). Separate multiple servers with comma. Leave empty for all. See
binding readme for country to server mapping</description>
<required>false</required>
</parameter>
</config-description>