Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Instances of Govee Integration not working right #57

Open
Snuffy2 opened this issue Jan 26, 2022 · 3 comments
Open

Multiple Instances of Govee Integration not working right #57

Snuffy2 opened this issue Jan 26, 2022 · 3 comments

Comments

@Snuffy2
Copy link

Snuffy2 commented Jan 26, 2022

We got my 3 children each Govee strip lights for their Bedrooms (2 H6110 & 1 H619C). Because they are kids and keep messing with each other, we've separated each strip light into a separate Govee account, 1 for each kid/strip light. I added each Govee account into Home Assistant with the Govee integration and API.

This initially works ok, but over time and reboots, the integration stops working and creates duplicate device/entities under each integration.

Example:
Integration: Govee - Kid1
Device/Entity:
Kid1's Strip Lights/light.kid1s_strip_lights
Kids2's Strip Lights/light.kid2s_strip_lights
Kid3's Strip Lights/light.kid3s_strip_lights

It has also created duplicate devices under the same Integration:
Integration: Govee - Kid1
Device/Entity:
Kid1's Strip Lights/light.kid1s_strip_lights
Kid1's Strip Lights/light.kid1s_strip_lights_2

Additionally, the entities stop working even though the strip lights have not been unplugged and the WiFi network has not gone down.

Overall, it's just very unpredictable.

Version of the custom_component

0.2.1

Debug log

There are several different errors that appear in the logs, here are a few:

2022-01-25 21:28:36 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/govee_api_laggat/govee_api_laggat.py", line 309, in _schedule_get_devices
await asyncio.sleep(SCHEDULE_GET_DEVICES_SECONDS)
NameError: name 'SCHEDULE_GET_DEVICES_SECONDS' is not defined


2022-01-25 21:35:10 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Govee - Kid1 for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 452, in async_unload
    result = await component.async_unload_entry(hass, self)  # type: ignore
  File "/config/custom_components/govee/__init__.py", line 83, in async_unload_entry
    await asyncio.gather(
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 827, in gather
    fut = ensure_future(arg, loop=loop)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 680, in ensure_future
    raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
TypeError: An asyncio.Future, a coroutine or an awaitable is required

2022-01-24 08:50:06 WARNING (MainThread) [govee_api_laggat.govee_api_laggat] error getting state for device GoveeDevice(device='<MAC>', model='H6110', device_name='Kid3 Strip Lights', controllable=True, retrievable=True, support_cmds=['turn', 'brightness', 'color', 'colorTem'], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=True, power_state=False, brightness=129, color=(255, 0, 0), color_temp=0, timestamp=1643032203.042125, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=0, lock_get_until=0, learned_set_brightness_max=None, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False): API-Error 400: {"message":"Device Not Found","status":400}

2022-01-25 06:06:35 WARNING (MainThread) [govee_api_laggat.govee_api_laggat] error getting state for device GoveeDevice(device='<MAC>', model='H6110', device_name='Kid3 Strip Lights', controllable=True, retrievable=True, support_cmds=['turn', 'brightness', 'color', 'colorTem'], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=True, power_state=False, brightness=129, color=(255, 0, 0), color_temp=0, timestamp=1643108785.059516, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=0, lock_get_until=0, learned_set_brightness_max=None, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False): API-Error 502: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

2022-01-25 06:10:55 WARNING (MainThread) [govee_api_laggat.govee_api_laggat] error getting state for device GoveeDevice(device='<MAC>', model='H6110', device_name='Kid3 Strip Lights', controllable=True, retrievable=True, support_cmds=['turn', 'brightness', 'color', 'colorTem'], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=True, power_state=False, brightness=129, color=(255, 0, 0), color_temp=0, timestamp=1643109045.047372, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=0, lock_get_until=0, learned_set_brightness_max=None, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False): API-Error 504: <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>
@LaggAt
Copy link
Owner

LaggAt commented Apr 4, 2022

Are you trying to use the integration twice with different API keys?

@sstarcher
Copy link

That was what I was attempting to do when I ran into this issue.

@LaggAt
Copy link
Owner

LaggAt commented Apr 4, 2022

ah - just reading the title. Never tried that, I thought home assistant doesn't allow that.
Think this would be quite some effort, what's the use case why you need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants