| model | text | false | Device model string, used to determine the subtype |
| refreshInterval | integer | false | Refresh interval for refreshing the data in seconds. (0=disabled) |
| timeout | integer | false | Timeout time in milliseconds |
-| communication | test | false | Communicate direct or via cloud (options values: 'direct', 'cloud') |
+| communication | text | false | Communicate direct or via cloud (options values: 'direct', 'cloud') |
+| cloudServer | text | false | Identifies the country server to use in case of cloud communication |
-Note: Suggest to use the cloud communication only for devices that require it. It is unknown at this time if Xiaomi has a rate limit or other limitations on the cloud usage. e.g. if having many devices would trigger some throttling from the cloud side.
+Note: Suggest to use the cloud communication only for devices that require it.
+It is unknown at this time if Xiaomi has a rate limit or other limitations on the cloud usage. e.g. if having many devices would trigger some throttling from the cloud side.
### Example Thing file
or in case of unknown models include the model information of a similar device that is supported:
-`Thing miio:vacuum:s50 "vacuum" @ "livingroom" [ host="192.168.15.20", token="xxxxxxx", deviceId="326xxxx", model="roborock.vacuum.s4", communication="direct" ]`
+`Thing miio:vacuum:s50 "vacuum" @ "livingroom" [ host="192.168.15.20", token="xxxxxxx", deviceId="326xxxx", model="roborock.vacuum.s4", communication="direct", cloudServer="de" ]`
# Advanced: Unsupported devices
| model | text | false | Device model string, used to determine the subtype |
| refreshInterval | integer | false | Refresh interval for refreshing the data in seconds. (0=disabled) |
| timeout | integer | false | Timeout time in milliseconds |
-| communication | test | false | Communicate direct or via cloud (options values: 'direct', 'cloud') |
+| communication | text | false | Communicate direct or via cloud (options values: 'direct', 'cloud') |
+| cloudServer | text | false | Identifies the country server to use in case of cloud communication |
-Note: Suggest to use the cloud communication only for devices that require it. It is unknown at this time if Xiaomi has a rate limit or other limitations on the cloud usage. e.g. if having many devices would trigger some throttling from the cloud side.
+Note: Suggest to use the cloud communication only for devices that require it.
+It is unknown at this time if Xiaomi has a rate limit or other limitations on the cloud usage. e.g. if having many devices would trigger some throttling from the cloud side.
### Example Thing file
or in case of unknown models include the model information of a similar device that is supported:
-`Thing miio:vacuum:s50 "vacuum" @ "livingroom" [ host="192.168.15.20", token="xxxxxxx", deviceId="326xxxx", model="roborock.vacuum.s4", communication="direct" ]`
+`Thing miio:vacuum:s50 "vacuum" @ "livingroom" [ host="192.168.15.20", token="xxxxxxx", deviceId="326xxxx", model="roborock.vacuum.s4", communication="direct", cloudServer="de" ]`
# Advanced: Unsupported devices
* @param value
* @return RGB value + brightness as first byte
*/
- private static @Nullable JsonElement HsvToBRGB(@Nullable Command command, @Nullable JsonElement value) {
+ private static @Nullable JsonElement hsvToBRGB(@Nullable Command command, @Nullable JsonElement value) {
if (command != null && command instanceof HSBType) {
HSBType hsb = (HSBType) command;
Color color = Color.getHSBColor(hsb.getHue().floatValue() / 360, hsb.getSaturation().floatValue() / 100,
case "BRIGHTNESSEXISTING":
return brightnessExists(value);
case "HSVTOBRGB":
- return HsvToBRGB(command, value);
+ return hsvToBRGB(command, value);
case "BRIGHTNESSONOFF":
return brightness(value);
case "HSBONLY":
String deviceId = configuration.deviceId;
if (deviceId.length() == 8 && deviceId.matches("^.*[a-zA-Z]+.*$")) {
logger.warn(
- "As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration");
+ "As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration. Expected change for thing '{}': Update current deviceId: '{}' to '{}'",
+ getThing().getUID(), deviceId, Utils.fromHEX(deviceId));
deviceId = "";
}
try {
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
-import java.text.SimpleDateFormat;
import java.time.Instant;
+import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.Collections;
-import java.util.Date;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class MiIoVacuumHandler extends MiIoAbstractHandler {
private final Logger logger = LoggerFactory.getLogger(MiIoVacuumHandler.class);
private static final float MAP_SCALE = 2.0f;
- private static final SimpleDateFormat DATEFORMATTER = new SimpleDateFormat("yyyyMMdd-HHmmss");
+ private static final DateTimeFormatter DATEFORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd-HHmmss");
private static final Gson GSON = new GsonBuilder().serializeNulls().create();
private final ChannelUID mapChannelUid;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
if (logger.isDebugEnabled()) {
final String mapPath = BINDING_USERDATA_PATH + File.separator + map
- + DATEFORMATTER.format(new Date()) + ".rrmap";
+ + LocalDateTime.now().format(DATEFORMATTER) + ".rrmap";
CloudUtil.writeBytesToFileNio(mapData, mapPath);
logger.debug("Mapdata saved to {}", mapPath);
}
"actions": [
{
"command": "start_cf",
- "parameterType": "EMPTY",
+ "parameterType": "NONE",
"parameters": [
0,
0,