Overhaul and rebmission of WiZ Lighting binding

I don’t think there’s any way to downgrade the firmware on the bulbs, especially when it didn’t even tell you before upgrading them. It was working on bulb firmware 1.17.1 but in 1.18.0 they removed one of the parameters I was using from the get config command causing those null errors during set up. You can check your bulb firmware by going to the settings for the individual bulb and clicking on the bulb model name. I honestly only caught the change in firmware numbers because I had two bulbs that happened to be unpowered when the others updated.

No need to be sorry. Its not your fault that the upgrade broke your hard work!!!

HI Sara - echoing Paul’s comments, no need to be sorry - I can imagine how frustrating it is to have firmware changes break your hard work!

I’ve just checked my bulb from the app - the firmware version is 1.18.0 and the meodel ID is 6, so that seems to match your experience.

Unfortunately I’m no help with binding development, but very happy to help with testing when the next version of the binding is ready.

@SRGDamiano, strange thing, i noticed today that though i can still send commands to the bulbs and they will do the changes, i dont get an update back with current status. On paperUI they all show offline. Im guessing Wiz is tightening down on their code.

Hello, I have the binding installed. In the binding setup I have the IP of my openhab install, the mac of my openhab install, and an invite token from the integrations page (smartthings). I added a new bulb thing manually. It wont go online. Any clue?

@SRGDamiano

I have installed your binding. 2 issue I have run into. First, if you manually create the thing in a things file, the mac and ip do not get imported to paperui. Also, if you create the thing in paperui, there’re issues.

Regardless of which way I go, the device is always offline. I can see when I put “:” between the digits on the mac, the bulb will go online,then back off…it doesn’t save the mac address with the colons; and the bulb is expecting it to.

Basically, the bulbs need a real mac address, rather than one without the colons. Can you help here please.

EDIT: I looked in the jasondb things file after creation on the thing. It appears the update interval is missing quotes around it. Also, cant change the mac format here. As you can see, I added colons, but it wont save the file. I’m using winscp to access the pi, for the life of me,I cant get win10 to map the network drive, had to find another option to access the files.

When you get around (if it is possible) to update the binding, please post it here as I would be interested in trying it out. Thanks.

I too look forward to an updated binding. The Wiz lights look good and are well priced. I grabbed one of their old fashioned filament fancy bulbs to test.

I, too, am hoping an updated binding might be in the works. I’m new to OpenHAB and today installed the Wiz binding, only to find it was broken by a firmware update.

Many thanks to the OP for the effort!!

I’m sorry, I haven’t sat to work on anything with the binding since March.

I finally have an updated version for you: https://drive.google.com/file/d/1hG2RLskc7G-WXSwHjoO5nXWqizHsfx1q/view?usp=sharing

I’m not positive the errors are fixed; let me know how it works for you!

You shouldn’t use the colons. I think your errors were probably because back in March-ish WiZ changed their API very slightly which made one queries I was using to get information from the bulb start failing. Try the newer version and see if it works.

Hi Sara, Just tried you latest binding on a Wiz ST.B22led (single colour bulb).

  • It was not found automatically
  • I added it manually (puting in the MAC and IP addy) but it is marked as offline

Logs shows:

Openhab

2020-06-07 18:53:53.914 [ERROR] [nal.utils.WizLightingPacketConverter] - Error parsing json! com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 236 path $

Events

2020-06-07 18:53:53.270 [.ItemChannelLinkAddedEvent] - Link 'wizlighting_wizDimmableBulb_c704c560_state-wizlighting:wizDimmableBulb:c704c560:state' has been added.
2020-06-07 18:53:53.273 [.ItemChannelLinkAddedEvent] - Link 'wizlighting_wizDimmableBulb_c704c560_lightMode-wizlighting:wizDimmableBulb:c704c560:lightMode' has been added.
2020-06-07 18:53:53.275 [.ItemChannelLinkAddedEvent] - Link 'wizlighting_wizDimmableBulb_c704c560_speed-wizlighting:wizDimmableBulb:c704c560:speed' has been added.
2020-06-07 18:53:53.277 [.ItemChannelLinkAddedEvent] - Link 'wizlighting_wizDimmableBulb_c704c560_signalstrength-wizlighting:wizDimmableBulb:c704c560:signalstrength' has been added.
2020-06-07 18:53:53.279 [.ItemChannelLinkAddedEvent] - Link 'wizlighting_wizDimmableBulb_c704c560_lastUpdate-wizlighting:wizDimmableBulb:c704c560:lastUpdate' has been added.
2020-06-07 18:53:53.895 [hingStatusInfoChangedEvent] - 'wizlighting:wizDimmableBulb:c704c560' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2020-06-07 18:53:53.897 [hingStatusInfoChangedEvent] - 'wizlighting:wizDimmableBulb:c704c560' changed from INITIALIZING to UNKNOWN
2020-06-07 18:53:53.914 [hingStatusInfoChangedEvent] - 'wizlighting:wizDimmableBulb:c704c560' changed from UNKNOWN to OFFLINE
2020-06-07 18:53:53.915 [me.event.ThingUpdatedEvent] - Thing 'wizlighting:wizDimmableBulb:c704c560' has been updated.
2020-06-07 18:57:24.759 [me.event.ThingUpdatedEvent] - Thing 'wizlighting:wizDimmableBulb:c704c560' has been updated.
2020-06-07 18:57:24.759 [hingStatusInfoChangedEvent] - 'wizlighting:wizDimmableBulb:c704c560' changed from OFFLINE to UNKNOWN
2020-06-07 18:57:24.773 [hingStatusInfoChangedEvent] - 'wizlighting:wizDimmableBulb:c704c560' changed from UNKNOWN to OFFLINE

Hm. I don’t have any single color bulbs. There must be something different about the API. Can you bump the logging level up to trace and post some of the output?

Here some debug info:

2020-06-08 08:13:50.557 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xxx.
2020-06-08 08:13:50.788 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00FFxxxxx.
2020-06-08 08:13:51.095 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xxx.
2020-06-08 08:13:51.329 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00FFxxxxx.
2020-06-08 08:13:51.329 [DEBUG] [nal.utils.WizLightingPacketConverter] - JSON Command: {"id":0,"method":"registration","params":{"phoneIp":"192.168.1.xx","register":true,"phoneMac":"00FFxxxxxx"}}
2020-06-08 08:13:51.330 [DEBUG] [iscovery.WizLightingDiscoveryService] - Sent packet to address: /192.168.4.231 and port 38899
2020-06-08 08:15:55.777 [DEBUG] [g.internal.WizLightingHandlerFactory] - Creating a new WizLightingHandler...
2020-06-08 08:15:56.054 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xxxx.
2020-06-08 08:15:56.289 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00FFxxxx.
2020-06-08 08:15:56.290 [DEBUG] [g.internal.WizLightingHandlerFactory] - WizLightingMediator will register the handler.
2020-06-08 08:15:56.295 [INFO ] [.internal.handler.WizLightingHandler] - WiZ lighting binding has been updated.
2020-06-08 08:15:56.295 [INFO ] [.internal.handler.WizLightingHandler] - Current version is v0.02.06, prior version was null.
2020-06-08 08:15:56.308 [DEBUG] [g.internal.WizLightingHandlerFactory] - Creating a new WizLightingHandler...
2020-06-08 08:15:56.665 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xxxxx.
2020-06-08 08:15:56.882 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00FFxxxxx.
2020-06-08 08:15:56.883 [DEBUG] [g.internal.WizLightingHandlerFactory] - WizLightingMediator will register the handler.
2020-06-08 08:15:56.885 [DEBUG] [nal.utils.WizLightingPacketConverter] - JSON Command: {"id":0,"method":"getSystemConfig"}
2020-06-08 08:15:56.886 [DEBUG] [.internal.handler.WizLightingHandler] - Sent packet to address: /192.168.1.xxx and port 38899
2020-06-08 08:15:56.903 [DEBUG] [nal.utils.WizLightingPacketConverter] - Incoming packet from 192.168.1.xxx to convert -> {"method":"getSystemConfig","env":"pro","result":{"mac":"a8bb5xxxxxx","homeId":10xxxxx,"roomId":15xxxxx,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP56_SHTW3_01","fwVersion":"1.18.3","groupId":0,"drvConf":[20,1]}}
2020-06-08 08:15:56.904 [ERROR] [nal.utils.WizLightingPacketConverter] - Error parsing json! com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 236 path $
2020-06-08 08:15:56.904 [DEBUG] [.internal.handler.WizLightingHandler] - No response to registration request from bulb at 192.168.1.xx - a8:bb:xx:xx:xx:xx
2020-06-08 08:15:56.905 [DEBUG] [.internal.handler.WizLightingHandler] - Finished initialization for bulb at 192.168.1.xx - a8:bb:xx:xx:xx:xx
2020-06-08 08:15:58.356 [DEBUG] [.internal.handler.WizLightingHandler] - Bulb at 192.168.1.xx - a8:bb:xx:xx:xx:xx is offline.  Will not query for status until a firstBeat is received.

There seems to be two issues:

  • The discovery is trying to use 192.168.4.231 (which is not on my network)
  • When I add the bulb manually there is a parsing issue

Thanks
Nathan

Thanks for the debugging. I’ll try to look into it.

Here’s a new jar to try: https://drive.google.com/file/d/1UpjrRaSKIMKglOkx6aoEE1XAy_2hfsSL/view?usp=sharing

Thanks - getting closer :slight_smile: Autodiscovery now works but still getting a json parsing error:

2020-06-09 09:05:08.563 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Starting Update Receiver Runnable...
2020-06-09 09:05:08.563 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Opening socket and start listening UDP port: 38900
2020-06-09 09:05:08.564 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Update Receiver Runnable and socket started with success...
2020-06-09 09:05:08.566 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Starting Update Receiver Runnable...
2020-06-09 09:05:08.566 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Opening socket and start listening UDP port: 38900
2020-06-09 09:05:08.567 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - Update Receiver Runnable and socket started with success...
2020-06-09 09:05:10.301 [DEBUG] [nal.utils.WizLightingPacketConverter] - Incoming packet from 192.168.1.xxx to convert -> {"method":"firstBeat","env":"pro","params":{"mac":"a8xxxxxxx","homeId":10xxxxx,"fwVersion":"1.18.3"}}
2020-06-09 09:05:10.302 [ERROR] [nal.utils.WizLightingPacketConverter] - Error parsing json! com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 106 path $
2020-06-09 09:05:10.303 [DEBUG] [le.WizLightingUpdateReceiverRunnable] - No WizLightingResponse was parsed from returned packet

Thanks
Nathan

When I then try to “+” and item using the binding I get these errors:

2020-06-09 09:16:23.555 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xx.
2020-06-09 09:16:23.797 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00xxxxxx.
2020-06-09 09:16:24.094 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xx.
2020-06-09 09:16:24.336 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00Fxxxx.
2020-06-09 09:16:24.336 [DEBUG] [nal.utils.WizLightingPacketConverter] - JSON Command: {"id":0,"method":"registration","params":{"phoneIp":"192.168.1.xx","register":true,"phoneMac":"00xxxxx"}}
2020-06-09 09:16:24.336 [DEBUG] [iscovery.WizLightingDiscoveryService] - Sent packet to address: /192.168.4.231 and port 38899

When I try to manually add the item (using the IP and MAC address) I get

2020-06-09 09:19:07.245 [DEBUG] [g.internal.WizLightingHandlerFactory] - Creating a new WizLightingHandler...
2020-06-09 09:19:07.528 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xx.
2020-06-09 09:19:07.774 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00xxxxxx.
2020-06-09 09:19:07.775 [DEBUG] [g.internal.WizLightingHandlerFactory] - WizLightingMediator will register the handler.
2020-06-09 09:19:07.779 [INFO ] [.internal.handler.WizLightingHandler] - WiZ lighting binding has been updated.
2020-06-09 09:19:07.779 [INFO ] [.internal.handler.WizLightingHandler] - Current version is v0.02.06, prior version was null.
2020-06-09 09:19:07.789 [DEBUG] [g.internal.WizLightingHandlerFactory] - Creating a new WizLightingHandler...
2020-06-09 09:19:08.145 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.1.xx.
2020-06-09 09:19:08.367 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00xxxxxx.
2020-06-09 09:19:08.367 [DEBUG] [g.internal.WizLightingHandlerFactory] - WizLightingMediator will register the handler.
2020-06-09 09:19:08.370 [DEBUG] [nal.utils.WizLightingPacketConverter] - JSON Command: {"id":0,"method":"getSystemConfig"}
2020-06-09 09:19:08.370 [DEBUG] [.internal.handler.WizLightingHandler] - Sent packet to address: /192.168.1.xx and port 38899
2020-06-09 09:19:08.388 [DEBUG] [nal.utils.WizLightingPacketConverter] - Incoming packet from 192.168.1.xx to convert -> {"method":"getSystemConfig","env":"pro","result":{"mac":"a8xxxxx","homeId":10xxxxx,"roomId":15xxxx,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP56_SHTW3_01","fwVersion":"1.18.3","groupId":0,"drvConf":[20,1]}}

What does it show on TRACE?