sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

TV time effect not correct colour #123

Closed enrauk closed 3 years ago

enrauk commented 3 years ago

Switching to TV time effect in home assistant does not output the correct colour. TV time is meant to be blue with a low brightness. Selecting the effect through home assistant outputs a low brightness daylight white.

andrew-engdahl commented 3 years ago

I am having a similar issue when selecting the warm white effect. I also get the daylight white color temperature. Logged the following error:

Source: custom_components/wiz_light/light.py:282
Integration: Light (documentation, issues)
First occurred: 10:44:56 AM (1 occurrences)
Last logged: 10:44:56 AM

wiz_light: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pywizlight/bulb.py", line 473, in sendUDPMessage
    stream = await asyncio.wait_for(
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.8/site-packages/asyncio_dgram/aio.py", line 247, in connect
    transport, protocol = await loop.create_datagram_endpoint(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1265, in create_datagram_endpoint
    infos = await self._ensure_resolved(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1365, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pywizlight/bulb.py", line 510, in sendUDPMessage
    stream.close()
UnboundLocalError: local variable 'stream' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 465, in async_device_update
    await task
  File "/config/custom_components/wiz_light/light.py", line 241, in async_update
    await self.update_state()
  File "/config/custom_components/wiz_light/light.py", line 282, in update_state
    await self._light.updateState()
  File "/usr/local/lib/python3.8/site-packages/pywizlight/bulb.py", line 415, in updateState
    resp = await self.sendUDPMessage(message)
  File "/usr/local/lib/python3.8/site-packages/pywizlight/bulb.py", line 512, in sendUDPMessage
    raise WizLightConnectionError(
pywizlight.exceptions.WizLightConnectionError: Bulb is offline or IP address is not correct.
sbidy commented 3 years ago

It seems to be an issue with the Scene-ID in the light mode.

Can you please provide the full bulb type (ESP32-TWxx-xxx) via nc? Because it seems to be a bug in some bulb types.

andrew-engdahl commented 3 years ago

This is blub type ESP03_SHRGB1C_01 which for me is a BR30 E26 Color & Tunable White