Philips Wiz (not Hue) Bulbs: how can we advocate for an API

@atomken this integration isn’t a “drop in” solution : you do need to have a little bit of an understanding of how node-red and mqtt work and how your bulbs are communicating with node-red. You do need to install the node-red and mqtt integrations into HA, and then you can import the flow I’ve posted and the configuration that @ogremustcrush has given. Essentially, the yaml that @ogremustcrush provides tells HA to create entities that will send and receive mqtt messages when you either interact with them via the UI or when they’re changed by the Wiz app.

Then, the node-red flows look for those same MQTT messages and send commands to the bulbs. In addition, they poll the bulbs for changes and send corresponding messages to MQTT that update the bulb status.

Best of luck to you. It’s a fun project, and it continues to work well for me.

2 Likes

@atomken Yeah, agreed with @wilvancleve…spent an entire weekend on setting up Home Assistant, those two addons and trying to figure out what went wrong (mqtt needed me to make a username, woops). For the most part, unless you get into the nitty gritty, just follow addon instructions and import their code above, then configure the IP address fields/mqtt servers. Definitely more hands on than some stuff in HASSIO. Enjoyed it though, forced me to understand quite a few things.

1 Like

I’ve got to kinda work one bulb too, thanks a lot to @wilvancleve and @ogremustcrush for your groundbreaking work :slight_smile:

One thing I’ve noticed is when I use “scenes” from the app, the msg.payload will contain the scene id like in "state":"on","sceneId":13,"speed":100,"temp":6500,"dimming":100, but if setting a color via the color picker there will be the actual RGB values (e.g. "state":"on","sceneId":0,"r":0,"g":255,"b":126,"c":0,"w":52,"dimming":68); now the widget in Lovelace UI will show proper RGB values only when the bulb is not set to a scene. I’m trying to tie “effect” to “scenes” although would need to map them manually first.

Question: I can see the status in the light card in Lovelace, and it updates correctly, I can also issue changes to the bulb via MQTT, but when changing anything on the card it doesn’t create any MQTT message… am I missing something? I’d expect to see a command_topic to be created and sent.

1 Like

Hey,

I’m still working on a python3 translation/implementation to push a home assistant integration.
Contributions are welcome :smile: - the repo. can be found on GitHub: https://github.com/sbidy/pywizlight
Currently only tested with the SLV Play bulb.

1 Like

Hi guys

thanks for all the useful information regarding UDP commands. I just recently discovered the WiZ light bulbs and started experimenting with them.

@Sbidy Stephan: I think the parameter ‘w’ stands for warm white and ‘c’ for cold white. At least the WiZ bulb I am using has both types of LEDs in it.

Felix

1 Like

I’ve been controlling these using scripts from HA. Some more info if helpful to your work…
I’m trying to see if i can somehow connect them to a RPi and control via music (something that Hue and other bulbs natively support thru their apps)

  • sceneId - calls one of the predefined scenes (int from 0 to 32)
    scene 0 - Red
    scene 0 - Green
    scene 0 - Blue
    scene 0 - Yellow
    scene 1 - Ocean
    scene 2 - Romance
    scene 3 - Sunset
    scene 4 - Party
    scene 5 - Fireplace
    scene 6 - Cozy
    scene 7 - Forest
    scene 8 - Pastel Colors
    scene 9 - Wake-up
    scene 10 - Bedtime
    scene 11 - Warm White
    scene 12 - Day light
    scene 13 - Cool white
    scene 14 - Night light
    scene 15 - Focus
    scene 16 - Relax
    scene 17 - True colors
    scene 18 - TV time
    scene 19 - Plant growth
    scene 20 - Spring
    scene 21 - Summer
    scene 22 - Fall
    scene 23 - Deep dive
    scene 24 - Jungle
    scene 25 - Mojito
    scene 26 - Club
    scene 27 - Christmas
    scene 28 - Halloween
    scene 29 - Candlelight
    scene 30 - Golden white
    scene 31 - Pulse
    scene 32 - Steampunk
  • speed - sets the color changing speed in percent
  • dimming - sets the dimmer of the bulb in percent
  • r - red color range 0-255
  • g - green color range 0-255
  • b - blue color range 0-255
  • c - cool?? range 0-255
  • w - warm?? range 0-255
  • id - the bulb id

Let me know if you need any help with the integration of the component and if you can make it as a custom component that would help with validation…

1 Like

Thanks for the feedback!!
I’m still upgrading the class and try to implement all features from the bulb :wink:

A fist integration is done under https://github.com/sbidy/wiz_light you can clone this to your HA for testing. Currently on/off, brightness and the color temperature is working. But still under “heavy” development.

The documentation for the light platform integration is not really detailed.

2 Likes

Soo… the first usable version is ready for testing :slight_smile:

Implemented is:

  • Brightness
  • RGB Color with picker
  • On/Off
  • White Color Temperature

My problem is that I have only one SLV LED Bulb here.
Can somebody test the integration with other Bulb types? I think the code should be getting more flexible to support different types of lights (eg with or without RGB).

Next steps will be some improvements to the stability and I’ll try to implement and improve the pywizlight class to support the different scenes.

Doc. and code can be found her: https://github.com/sbidy/wiz_light

Please leave a star in the repo if you like the integration :upside_down_face:

3 Likes

Yw. This is great. I’ll check your component later today. One more param that is supported by the API is temp which can help control brightness
{“method”:“setPilot”,“params”:{“sceneId”:13,“r”:0,“g”:0,“b”:0,“c”:0,“w”:0,“temp”:5500,“dimming”:100}}

1 Like

Thank you for the feedback!

The current implementation supports in the HA UI

  • On/Off
  • RGB Colors
  • White Color Temeprature in Kelvin
  • Brightness
  • Scenes (0-32)
  • Transition Speed (still work in progress)

Next will be a deterministic bulb identification (only White or RGB).

If you are testing the implementation, please check frequently the repo for an updated version.
Versioning will be introduced :smile:

1 Like

Thank you for developing this custom component!

I have several WiZ G25 Filament bulbs, which can now be controlled much more quickly. Had previously set up via WiZ -> SmartThings -> Home Assistant, which as you’d expect had significant latency.

Looking forward to the transition speed implementation as this was something that would not work with my previous setup.

May I suggest you make this repository HACS compatible for easier management through Home Assistant? See https://hacs.xyz/docs/publish/start

I’ll try familiarise myself with your repo and contribute if I can.

2 Likes

Hey do you found some time to test the integration in your enviroment?
Can you please post the system config from this types of bulbs? I would like to find out if it is possible to determine the supported features form the system config informations.

The get these infos send
echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 <YOU BULB IP> 38899 .

You will receive a result like this:
{"method":"getSystemConfig","env":"pro","result":{"mac":"a8bbeb","homeId":65xxx,"roomId":98xxxxx,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP01_SHRGB_03","fwVersion":"1.17.1","groupId":0,"drvConf":[20,2]}}

I expect that these type of bulbs only support the brightness features.

Thank you!!

Stephan - I have the Wiz Home Depot BR30 color model #9290022657, which is probably no different to yours, but here is the report in case it is of interest:

{"method":"getSystemConfig","env":"pro","result":{"mac":"a8xxx”,”homeId":25xxx,”roomId":41xxx,”homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP01_SHRGB1C_31","fwVersion":"1.17.1","groupId":0,"drvConf":[37,1]}}

By the way - Home Depot has color BR30’s on sale for $6 each at the moment!! https://www.homedepot.com/p/WiZ-72W-Equivalent-BR30-Colors-and-Tunable-White-Wi-Fi-Connected-Smart-LED-Light-Bulb-IZ0087581/303143219

The Wiz Tunable White 5/6 in. LED 65W recessed lights return (mac, homeId, roomId redacted):

{"method":"getSystemConfig","env":"pro","result":{"mac":"","homeId":,"roomId":,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP01_SHTW1C_31","fwVersion":"1.16.0","groupId":9,"drvConf":[20,1]}}

Some feedback on the integration - all works great, even the effects drop down and color wheel. I do have an enhancement request though - all my lights are behind their own wifi router/subnet, all appearing on the same nat’d IP address to my HA. In order to test I forwarded external port 38899 to just one of my lights. I would like to be able to port forward unique external ports to my other lights, e.g. 38900 to 38899, 38901 to 38899 etc. Would it be possible for you to add a “port:” config option in addition to the current “host:” config option? My router would then forward the different ports to 38899 for each of the lights behind the single host ip. Thanks for the great work so far!

Sbidy: I can try to gather that info on the Wiz GU10 bulb tonight.

How do I add your integrations to my HA, when I’m running everything in docker?

Hi, and thanks all for sharing your experience, and my very first post.
I am new to Home Assistant but not to home automation.
I just wanted to share how I got this component working with hass.io

First I used the SSH addon in hass.io and ran the command:
git clone https://github.com/sbidy/wiz_light in folder config/custom_components/

Then I uploaded the files from https://github.com/sbidy/pywizlight in folder config/custom_components/wiz_light/pywizlight/

Because you cant run pip install pywizlight in hass.io (don’t know?) you will have to change the code line 13 in config/custom_components/wiz_light/light.py to
from . pywizlight import wizlight <- just added the dot between from and pywizlight otherwise HA wouldnt find the script.

I created my device in /config/configuration.yaml

light:
platform: wiz_light
name: Bathroom
host: 192.168.1.11

That worked like a charm. Using it with a ceiling light named “Trio Reality WIZ Fara”.

Hope this could help someone.

4 Likes

Hi Janne, welcome to our community - your tip solved how to reference my own tweaked version of pywizlight, thanks! I needed to override the default port due to my unique situation of having all the lights behind another router on a single nat’d ip. Now I can access all 4 of my lights with a modified config that passes the port value through to the sendUDPMessage method (the router remaps the ports back to 38889 on the subnet):

light:
  - platform: wiz_light
    name: Porch
    host: 192.168.0.128
  - platform: wiz_light
    name: Bookshelf
    host: 192.168.0.128
    port: 38900
  - platform: wiz_light
    name: Right
    host: 192.168.0.128
    port: 38901
  - platform: wiz_light
    name: Left
    host: 192.168.0.128
    port: 38902

Warning: the port parameter above will be treated as invalid with Stephan’s version. Just illustrating how I overcame the ‘hidden behind another router’ problem.

1 Like

Hello all, I’m new to HA as of yesterday, glad I found this thread. I’ve gotten this to kinda work on my A19 light bulbs from Costco. The on/off function works but nothing else.

Here’s the output from that command:

{"method":"getSystemConfig","env":"pro","result":{"mac":,"homeId":,"roomId":,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP05_SHRGBL_21","fwVersion":"1.17.1","groupId":0,"drvConf":[30,1]}}

Something interesting I found was that if I change the settings in the WiZ app, the next time I send any signal from HA it reverts back to its “favorite” setting that it initializes with, which in my case is Circadian Rhythm. To clarify, it isn’t the first preset, its just the setting that is enabled when I turn it on from any source.