With regards to the device token, that is the one I got with the MIIO tool. When I created the think (with cloud credentials for Xiaomi) it got the same token so it should be good.
08:17:00.661 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for 060C931A type: MIIO_INFO, result: {}, fullresponse: {“error”:“Given final block not properly padded. Such issues can arise if a bad key is used during decryption.”}
Hey it works, the token must have changed because I factory reset the bulb several times. I go the token using the old version of the mi home app and it’s fine now. Thanks a lot for your help.
Something that I noticed now it an exception when serializing the response from the bulb. number format exception. This is the stack trace in case there is an issue.
13:37:50.929 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error while handing message {“result”:{“life”:160590,“token”:“ecbae18f773c861846edbf1c6b3c8488”,“mac”:“7C:49:EB:C6:CE:A8”,“fw_ver”:“1.3.7_0029”,“hw_ver”:“ESP8266”,“uid”:“6199171985”,“model”:“philips.light.hbulb”,“wifi_fw_ver”:“1.5.0-dev(7efd021)”,“ap”:{“rssi”:-66,“ssid”:“April”,“bssid”:“F8:08:4F:88:54:06”},“netif”:{“localIp”:“192.168.1.236”,“mask”:“255.255.255.0”,“gw”:“192.168.1.254”},“mmfree”:17600},“id”:8342}
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: “6199171985”
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:?]
Has anyone experienced the device ThingType to not get automatically changed upon provision of the token?
I am willing to add a Philips Zhirui E14 candle bulb, I am able to add it as a thing and provide the token, but still the binding reports it as miio:generic. Respectively the channels needed to manipulate the light are missing: only available is Execute Command
Nevertheless, the bulb does communicate with the binding as it is reported online and its id gets populated.
Maybe something missing in the database configuration?
Here the debug log. https://pastebin.com/tkDYstnP
It is the same number format exception as reported few posts above. The token certainly works as I see device online, and also able to communicate with it via python-miio
BTW, I also tried to define manually as miio:basic via things and items files, but this did not work.
Update: reading the comment of @marcel_verpaalen regarding bug for uid > 2147483647, I tried to installing newer snapshot. Originally I was running 2.5.4 and after some search managed to find jar with 2.5.4.202004171947. Installed and run it, but behavior is the same (and the NumberFormatException as in the log above thrown) …
The latest 2.5.5 (202005150359) worked out - the issue is not in place there.
Discovered channels 2.5.4 vs 2.5.5. Thanks for the link with the latest snapshots!
For the testing yet just linked Power, but will try all and provide update here.