Overhaul and rebmission of WiZ Lighting binding

Here are the mappings for the modes, hope this helps:

[supportedModes=“1=Ocean,2=Romance,3=Sunset,4=Party,5=Fireplace,6=Cozy White,7=Forest,8=Pastel Colors:Pastel,9=Wakeup,10=Bed Time,11=Warm White,12=Daylight,13=Cool White,14=Night Light,15=Focus,16=Relax,17=True Colors,18=TV Time,19=Plant Growth,20=Spring,21=Summer,22=Fall,23=Deep Dive,24=Jungle,25=Mojito,26=Club,27=Christmas,28=Halloween,29=Candle light,30=Golden White,31=Pulse,32=Steam Punk”]

1 Like

Hello,

it seems that the values are updated each hour or so since the “Last Update” status is refreshed each hour.
is there a way to change that intervall? because i want to read the current color etc but that does not work if the stauts felds are refreshed only each hour

@KrX I believe the settings you are looking for are associated with the Thing Configuration. In Paper UI navigate to Configuration > Things > Your Wiz Light, then click the pencil icon to edit it, select Show More to reveal the Update Interval and Use Heartbeat settings.

Thank you, that exactly what i wanted :wink:

under Update Intervall this text is shown: “Update time interval in seconds to request the status of the bulb while it is connected to the network.” it was set to 60.

so normally it should be updated each minute (before) but it was each hour, so the info text is wrong or somthing in the code?

I’m on a Synology NAS with two network interfaces. How do I specify which interface to use in a configuration file? I’m a complete noob. I tried creating wizlighting.config in the services directory with the following lines:

OHIPAddress = 192.168.xx.xx
OHMACAddress = 001132xxxxxx

but the log messages still say that it’s using the other interface.

It works, thank you!
How i did it? just downloaded the .jar , placed in /usr/share/oh2/addons , added manually the bulbs via ip/mac config when i add the thing and the device shows up in control tab

Got my Wiz color bulbs working as well. Thanks everyone!

  1. Place jar in /usr/share/oh2/addons
  2. PaperUI -> Add Thing Manually (specify the IP address and mac address) for the bulb and it found it right away.

Here is the sitemap I am using

    Frame label="Wiz Lamp" {
            Switch item=Lamp_BulbControl
            Slider item=Lamp_Brightness
            Colorpicker item=Lamp_Color
            Slider item=Lamp_ColorTemp
            Selection item=Lamp_LightMode
        }

is there already a version of this binding for OH3 ?

I’m sorry, guys, I haven’t had a chance to look at this in ages. I might get a chance to do some of the updating needed for OH3 over the holidays, but I can’t promise it.

3 Likes

Everyone, I have made the changes necessary to get this working in OH3. I forked the repo from @SRGDamiano’s pull request and merged just the binding related changes into the master in order to pick up the dependencies and build changes for OH3. Next I changed the package names to reflect the renaming of the ESH packages, and finally renamed the ESH-INF resource folder to OH-INF. Then rebuilt the binding.

Here is the branch where I built this:

For anyone needing the updated JAR file to use with OH3, it is available here:

I have successfully tested this in my fresh OH3 instance and was able to discover, add, and control the lights as expected.

5 Likes

Thank you! Please go ahead and create a new pull request with your work, if you feel comfortable with it. I wouldn’t be at all offended and would be happy to have the binding accepted from your PR. Just leave my name (and the original author I forked from) in the credits and add yours with it.

Thanks @frejos!

Migrated my 2.5 Openhabian to 3.0 yesterday. Dropped in the jar file into the addons directory and it detected by Wiz bulb right away and everything “just works.”

Thanks also to @SRGDamiano for getting the addon into such great shape in 2.5

Thanks for the Update! All going on OH3 :slight_smile:

FYI - I ended up doing a clean OH3.1.0-Snaptshot Install (instead of a Migration) and the Wiz Binding works but does not autodiscover the bulbs. Manually adding then controlling the bulbs is fine.

Thanks @frejos, you got to this before I did. This works perfectly here with OH3. Did you submit a pull request? On another thread, @hilbrand mentioned that there is no reason this binding wouldn’t be included in the list of official bindings.

@SRGDamiano @barthawk @jmone @ottawahacker Glad to help, I have a large installation of these bulbs and needed to get this going in order to move to OH3. I have NOT submitted a pull request yet, but don’t mind doing it. Although there are a couple other small fixes I would like to get in first.

One is related to auto discovery, the code guesses at the host broadcast address which only works on a /24 network, it isn’t working on my /23 network though because it is guessing the incorrect broadcast address. It still discovers lights passively when they power cycle, but active discovery doesn’t work for me. @jmone not sure if this is related to what you saw with discovery or not.

The other is cleaning up some of the state transitions for some of the interdependent settings that will help with rule creation. For instance setting the mode back to 0 when any color is set.

I’m using a bog standard /24 network, but I “think” the issue is related to the Wiz Binding picking the wrong (not activated) network interface for the Auto Discovery. I see the following in the logs, this set appears every hour.

2020-12-31 13:04:13.511 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.xxx.xxx.
2020-12-31 13:04:13.671 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00E04Bxxxxxx.
2020-12-31 13:04:13.847 [INFO ] [rnal.handler.WizLightingMediatorImpl] - IP of OpenHab device is 192.168.xxx.xxx.
2020-12-31 13:04:14.007 [INFO ] [rnal.handler.WizLightingMediatorImpl] - MAC Address of OpenHab device is 00E04Bxxxxxx.

The IP Address is correct, but the MAC is not for my active NIC (it is for the Realtek Motherboard NIC, I use a IBM 10Gb interface).

Yes, that caught my eye when I was looking at the broadcast setup. It is picking the MAC of the first network adapter not the the network adapter that has the matching IP address being used. I’ll see if I can clean that up some too.

I’ve made these changes now and am going to test them out for a bit, please let me know if you are able to test with this version and have any issues.

Minor fixes for autodiscovery:

  • Correctly finds configured broadcast address
  • Selects the MAC address corresponding to the configured IP Address instead of the first one

Minor fixes for state changes:

  • Now immediately requests current state from bulb once successful update has been applied
  • Other minor state change fixes

@jmone Would you mind giving it a try, I think it will resolve your MAC discovery issue.

Thanks,

1 Like

Thanks Josh, but no change for me (so I’m wondering if the version has changed?). It is showing in the log as:

WiZ Connected Lighting, binding version: v0.02.19