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

@Sbidy UDP message lost? i solved that problem with upto a 100 retries with 0.5 second delay between each retry already in my PR merged in pywizlight. Did you revert that behavior?

@sovanyio mentioned something in a previous post. I’m not sure if this is general problem or a individual one.

@Sbidy he never said “UDP message lost in case of bad connection”. that won’t ever happen in our code - it keeps flooding the light with UDP messages upto a 100 times for getPilot and upto 10 times for setPilot.

@sovanyio btw I am experiencing the flickering of the lights even at my home since the last couple of days. btw I am the developer who implemented the UDP flooding approach. I don’t think this is causing the flickering - because - i turned off home assistant (killed power to my raspberri pi) one night and saw that the flickering continued even after that. I feel there’s something weird going on from wiz’s servers since the past week.

Can you try turning off the integration or turning off HA and see if your flickering goes away? Otherwise i’ll look into whether it is possibly caused by UDP floods from pywizlight. I’m equally annoyed by the flickering since the past couple of days so a datapoint from you will definitely help fix this.

Sure thing, I’ll try to test that in the next 24 or so. Just a slight annoyance for me, but the spouse hates it haha.

@angadsingh yes, that’s correct. It is not a “UDP connection problem” and I think it’s not a problem with your code or connection handling either. I had to be more exact with my problem definition. Sorry :wink:

I’ve tested the “flooding behavior” with my bulbs and sent 1.000.000 UDP messages sequential (turn on / setPilot). It is not a representative test and not related to the problem but I was interested if the ESP can handle such a amount of messages.
From 1.000.000 are 56 dropped by the ESP in the bulb but the light was not starting flickering or show other behavior.

@sovanyio maybe, if the disabled HA integration doesn’t stops the flickering, you can try to disable the internet connection for the bulbs (incoming and outgoing). In this case the bulb can not connect to the internet or/and WiZ cloud.

Hi Stephan, I installed the latest and tested the Filament bulb. Effects and Colour temp controls now available and working well. Logs noticeably quieter. Great work mate, thanks from down under! :slight_smile:

I don’t see this flickering issue on my side (I don’t have the filament bulb) but a color tune-able BR30 Philips one from HD. I have fire-walled my WiZ bulb (as well as other IOT devices that can work locally without going to the cloud - eg switches/plugs, cameras, etc) and exclusively control via HA if I need to access them local or remote.

But this could be some datapoint that flickering issue may be tied to some cloud access. Also since the bulbs don’t have direct Internet access it may not be able to upgrade f/w etc automatically (i think?) which may be a good thing or vendors change the API and break the integration (as some other devices like Harmony hub, Nest/google have done in the past)…

I am happy with what works and is secure as it cannot leave my local network and send back data to their home cloud without my knowledge…

@mhpetiwala thanks for the input. i’ll try firewalling my bulbs too. we don’t really need the wiz app - we’ve made all functionality available in the wizlight HA component now anyway.

nice! you really have a very good wifi network btw!

So it appears to happen less often since I blocked the internet access but not completely.
I’m wondering if there was a buggy firmware push recently; I’ve unblocked for now in case that is the case.

I have 5 bulbs currently and have only noticed this issue on 2/3 (2 are in one fixture so unsure if both or just one) of the 5 so far.

Alrighty, I found this: https://github.com/claytonjn/hass-circadian_lighting/issues/85 which appears to be the issue. Should have suspected the thing adjusting the lights sooner, but I had changed the light integration more recently than the circadian stuff :stuck_out_tongue:

The integration is now assigned in a pull request to the HA core. All checks are done an I waiting for a feedback from the maintainers.

Link: https://github.com/home-assistant/core/pull/35132

2 Likes

Hello,

I have two questions here:

  1. Does this integration create devices for the light entities? If it does, there’re not showing up in my instance. And when I open it in the UI, I get a message saying “This entity does not have a unique ID, therefore its settings cannot be managed from the UI.”

  2. The second question is how do I activate a specific preset in a bulb? Is there a service I need to call or a state I need to set? Maybe a device is supposed to be created and be able to be controlled?

Thanks

Can you please take a look at my two questions above? Thanks.

No it does not create “devices”. It creates light switches.

There is no service. You can use the built in service for switches. It shows up as a “light” and supports all the operations which a light supports including changing color, brightness, and scene (mode)

Perfect. Thank you!

Is anyone else seeing this error in their logs?:

ERROR (MainThread) [custom_components.wiz_light.light] Cannot evaluate temperature
Traceback (most recent call last):
  File "/config/custom_components/wiz_light/light.py", line 251, in update_temperature
    self._light.state.get_colortemp()
  File "/usr/src/homeassistant/homeassistant/util/color.py", line 515, in color_temperature_kelvin_to_mired
    return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero

Hello! I’m new here, and I’m very excited to get HA working with my devices!
I’ve gotten all the way to the end of setup, but I keep getting errors in my configuration.yaml

When I try to add my Wiz light’s info to configuration.yaml I get the following error:
Platform error light.wiz_light - integration 'wiz_light' not found.

Any ideas what I’ve done wrong here?

EDIT:
Of course I figured it out almost instantly after I posted…
Turned out I had cloned to the wrong directory.
I had read somewhere that when you SSH into HA you are in the config directory, well that was wrong and I had to change to the config directory before making the custom_components folder, then everything came out just fine!

Hello,

I’ve integrated about 4 weeks ago your code to my Home Assistant running on RPi4. It worked like a charm (thanks for the great project!).

But now I’ve upgraded to HA 0.110.4 and HassOS 4.8, and all my wiz lamps disappeared.

I’ve spotted following log events:

Light is deprecated, modify WizBulb to extend LightEntity
14:41:58 – Light (WARNING)

You are using a custom integration for wiz_light which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
14:41:36 – loader.py (WARNING)

Any idea, what went wrong?

Thanks
Gabor

Ok, downgraded HA to 0.109.6, and the wiz light are back. So something to watch out with HA updates.