While trying to get my Yeelight Bedside Lamp to work with the miio binding I noticed that the Paper UI was not properly functioning (Using the Color item, changing settings did not go through to the lamp and got “reset” to the initial state of the UI). When looking at the debug log I noticed an exception being thrown, which is that my UID (which is being returned by the bedside lamp on the MII_INFO command) is not an integer, but a long (6267812796). This is a bug that also occured when I first got these lamps and as a solution I had to log in on an Xiaomi owned account to update the firmware of these lamps to support long UIDs. I dont know if this exception is why my Paper UI isnt behaving like it should, but I think its still an interesting bug that is worth mentioning.
The debug log:
21:31:11.125 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error while handing message {"result":{"life":182857,"token":"xxxxxxxxxxxxxxxxxxxxxx","mac":"xxxxxxxxxxxxxxxx","fw_ver":"1.6.6_0172","hw_ver":"MTK7697","uid":"6267812796","model":"yeelink.light.bslamp1","wifi_fw_ver":"20190313111057","config_type":"app","ap":{"rssi":-61,"ssid":"xxxxxxx","bssid":"xxxxxxx"},"netif":{"localIp":"xxxxxxxxxx","mask":"255.255.255.0","gw":"192.168.178.1","gw_mac":"xxxxxxxxxxxx"},"mmfree":54512},"id":327}
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "6267812796"
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:227) ~[bundleFile:?]
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:217) ~[bundleFile:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) ~[bundleFile:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) ~[bundleFile:?]
at com.google.gson.Gson.fromJson(Gson.java:888) ~[bundleFile:?]
at com.google.gson.Gson.fromJson(Gson.java:953) ~[bundleFile:?]
at com.google.gson.Gson.fromJson(Gson.java:926) ~[bundleFile:?]
at org.openhab.binding.miio.internal.handler.MiIoAbstractHandler.updateProperties(MiIoAbstractHandler.java:358) ~[bundleFile:?]
at org.openhab.binding.miio.internal.handler.MiIoAbstractHandler.defineDeviceType(MiIoAbstractHandler.java:353) ~[bundleFile:?]
at org.openhab.binding.miio.internal.handler.MiIoAbstractHandler.onMessageReceived(MiIoAbstractHandler.java:462) [bundleFile:?]
at org.openhab.binding.miio.internal.handler.MiIoBasicHandler.onMessageReceived(MiIoBasicHandler.java:499) [bundleFile:?]
at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:236) [bundleFile:?]
Caused by: java.lang.NumberFormatException: For input string: "6267812796"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_152]
at java.lang.Integer.parseInt(Integer.java:583) ~[?:1.8.0_152]
at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_152]
at com.google.gson.JsonPrimitive.getAsInt(JsonPrimitive.java:264) ~[bundleFile:?]
at com.google.gson.internal.bind.JsonTreeReader.nextInt(JsonTreeReader.java:243) ~[bundleFile:?]
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:225) ~[bundleFile:?]
... 11 more