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

Thank you for your hard work! Just to let you know that its working with the WIZ A.E27 lamps as well!
Hope to see a HACS or core component soon.

Thx @Sbidy and @angadsingh for the updates. Seems I have issues with the older version of the custom component too due to the blocking call. The async approach seems to be the correct way to go. But after trying to install the asyncio-dgram package my HASS is giving issues. Not sure if it’s related to some version compatibility as I’m still on version 0.95.4 and Python 3.5.4 (I need to move it but have to make sure nothing breaks as I’ve lot of components and integrations/scripts working flawlessly for now and hence not taking the newer releases that require Python upgrade - maybe will create 2nd instance and cutover to it).
But for the interim is there an alternate option to move to asyncio/non-blocking option without going via the asyncio-dgram option. I would like to move to async operations as the core keeps on getting stuck and at that point the current task (as mentioned above by @angadsingh times out or doesn’t return back if from the UI);

Any option to move forward on this is appreciated.

what issues are you seeing? its really a small simple single file wrapper over asyncio’s datagram API. HomeAssistant natively and internally uses asyncio. The core runs on it. So this is nothing different. Just a utility wrapper: asyncio-dgram/asyncio_dgram/aio.py at 71e2e2fad8cf210b9551ca3281c95b96c88adc84 · jsbronder/asyncio-dgram · GitHub

Thx for your prompt response. I was trying to install the lib using pip3 but it is only compatible with python 3.6+ and my python version is 3.5.3.

Based on your suggestion i’ll try to natively import this lib/aio.py and see if that works… something that can bring this up quickly without going thru lot of changes plus avoiding the lockup problem with the wiz integration…

thx again, any other insights on this welcome…

Updated the changes from your repo (not original from @Sbidy) and updated it to make it compatible with Python version < 3.7 also removed the external dependency on the asyncio_dgram module as it couldn’t be installed via pip3 due to older Python version.

This version is only meant for use in case someone has an older version of HASS with Python <=3.6 and cannot move to a new version due some specific integrations/needs. All others should use the updated @Sbidy version of Wiz light component along with asyncio_dgram.

My changes are forked and available at:

thx @angadsingh for your insight and great work on making this async (no more lockups seen) and also thx to @Sbidy for this custom component that allows folks to use relatively inexpensive Wiz lights with HASS (fraction of the cost of other lights with similar or less capabilities and no need for a hub!)

1 Like

Good for your @mhpetiwala. Do plan to upgrade your python version soon, so that you can use the updated pywizlight component directly and get new features/fixes being added by @Sbidy

Hi, I have a tunable white bulb and it shows up as a bulb able to change all colors. How can I contribute to iron this out?

@sbidy: I’m more than happy to contribute hardware. How can I help?

Do you guys have any plans for auto-detection of lamps in the network?

Hey, yes that’s a problem. We try to figure out how the bulbs can be detected as RGB+W or single color. The quick and easy way is to add a additional parameter into the the config.
But the final solution should be a auto-detection.

I’ll try to bring in the configuration parameter into the code on Friday.
Can you post your system config and type of your bulb?

echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 <YOU BULB IP> 38899

The response of my Philips Wiz Connected Tunable White Wi-Fi LED (A19) is:

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

I also have Philips Wiz Full color recessed Downlights:
{"method":"getSystemConfig","env":"pro","result":{"mac":"a8bb50f22e05","homeId":654213,"roomId":1000729,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP01_SHRGB1C_31","fwVersion":"1.18.0","groupId":0,"drvConf":[44,1]}}

Just loaded your custom component - controlling well! Many thanks for your work so far!

To assist understanding bulb types, I have a Wiz brand A B22 WiZ60 DW

Fixed colour (Warm White), dimmable bulb. I noticed that many of the scenes options in the light controller cause errors (not available) as well as a colour picker (which is also not applicable).

Bulb response is:
{"method":"getSystemConfig","env":"pro","result":{"mac":"zzthemac","homeId":zzhomeid,"roomId":zz,"homeLock":false,"pairingLock":false,"typeId":0,"moduleName":"ESP01_SHDW_01","fwVersion":"1.18.0","groupId":0,"drvConf":[20,2]}}

I am having trouble getting @Sbidy’s repo to fully work.

My lights were created fine but I always get the following logs due to UDP connection refusal:

I made sure the IP addresses for my lights are static before getting these logs.

Any help would be greatly appreciated!

is the physical switch to the light on and the light connected to your router on specific IP 192.168.1.41 as shown in the error above. Seems it’s not able to reach the bulb’s controller and repeatedly attempting and failing with timeout…

Are you able to reach this bulb and control via the WiZ app? or have you tried any command line options to try and reach it…

I’ll give those a try this weekend and get back to you on that.

So the physical switches to all of my lights are on.

I also checked that I can ping one of the bulbs (I control them through Smart Life/Alexa on my phone but if it is a must I can set them up with WiZ).

Here’s my static IP mapping for all of the smart bulbs. The only extra info that may matter is they are connected to my Unifi Access Point, but I am not sure if I would need to do any changes on the access point software to make this work (I don’t have a strong infrastructure background):

So I was an idiot and forgot I switched to Merkury bulbs, so I used the Tuya built-in integration to handle that via Smart Life.

sorry -so is the issue still valid? or you’re not using WiZ? If you’re using WiZ bulbs (either Philips or older Wiz ones) try to connect thru the app - and if that works then @Sbidy component should work fine as it uses the same API in the backend.

I’m not using WiZ so there’s no actual issue (my bad).

So - I added a automatic detection of some reported bulb types.
Please clone the new version into your custom_components folder and test against your bulb types.
The code and a feature matrix can be found in the github :arrow_right: https://github.com/sbidy/wiz_light/blob/master/README.md#bulbs
If your bulb type is not detected with the correct set of supported features - please search in the log for the [custom_components.wiz_light.light] log entries. Please report the bulb type and the supported features. The log should be provide some information about your bulb type and the used hardware module.

In the next days the integration will be queued as standard component for the next HA release. So that the integration will be a part of the build-in light platform integrations.

I can confirm ‘my lights’ are both detected properly. Thanks.

My Wiz brand BR30 color bulbs are not detected.

On a related note, although I can create the entities, I’m faced with the following situation. I’m sure it’s user error, but any help would be appreciated: