Govee integration

I’ not at home and cannot test, but I got a response they fixed it.

edit: CONFIRMED, the workaround isn’t necessary anymore.

Please remove the Workaround by typing SPACE in that field (Integration Options):
mr8RHor5Sg

Just clearing the field doesn’t work for me.

If it’s installed correctly using HACS (see first Post) you probably need to wait a bit.

1 Like

fyi: I started a pull request to add the integration by default in HACS.

Oh wow, that was it. Thank you!

1 Like

Thanks so much for this!
Do you know when we will see govee integration inside the official docker?

1 Like

I switched to HACS and stopped my pull request to core.

Some days ago i started a request to be included as default repo in HACS. No idea if and when this will happen.

I’m trying to install the Govee HACS integration. I was able to install HACS fine, and was able to get the custom hacs-govee repo to show up. I installed v0.1.10 through HACS, but am having a problem adding the Govee integration to my HA proper. When I try to input the API key I received from Govee, I get the following error (please see attached screenshot). I tried uninstalling and reinstalling, but the error persists. I tried getting a new API Key from Govee, but no dice. I even tried installing a prior version of the hacs-govee integration in HACS, but still nothing. I’m sorry if this isn’t the proper place to ask (if it’s not, please let me know where I should repost this!), but can anyone help?

1 Like

Think this happens, if the Key is correct, but the API is returning no device (I expected an empty list here, but maybe it’s just returning null or so). I also thought I addressed that exception, I added a list check and hope it will show an good error now. v0.1.11 is out for that.

Anyhow - you could probably fix your issue by re-pairing your device to wifi and your Govee Home app. Please tell me if that worked.

1 Like

Ah, I see my issue now after reading your response: my bulb doesn’t connect to wifi, it connects to my phone directly through bluetooth. Oh well! Thanks for the speedy response :smile:

I did attempt to install the Govee integration again, after downloading v0.1.11, and I got a different error message from before, so the bugfix definitely worked. I’m not sure I would have understood the error without talking to you, though. If it’s possible it might be a good idea to raise a NoDevicesFound error instead if, like in my case, there are no devices on the network. That’s a small thing though!

Thanks again for the help! The new error I got in v0.1.11 is below.

1 Like

Glad it works for you now. Data has an empty struct here, should be enough for a better message. I’ll pick up that idea for next version.

1 Like

Hi LaggAt thanks for the integration. I am having issues where the immersion led H1699 keeps becoming unavailable and then I have to use the govee app to turn it on and it reappears. From what I can see this is not related to wifi drop outs on the govee light itself. I have reinstalled the light on the govee app and reinstalled the integration.

I am also unable to tick option “When a led is offline, show it as off (default doesn’t change state). Default: False”. “It comes up with user input malformed”.

Can you please provide some guidance. thank you.

1 Like

Hi, think that is related to another field in the options, could you try to enter a space in the ‘DISABLE state updates’ text box on the bottom? It seems it doesn’t allow empty strings, I’m still fiddling with the validator here.

Could you provide debug logs when it becomes unavailable? See first post for instructions.

Thanks @LaggAt . That worked for setting the “When a led is offline, show it as off (default doesn’t change state). Default: False”. I will post the logs when it next becomes unavailable.

1 Like

Hi @LaggAt see below copy of my log from the time it goes from being online to offline as seen in the log. The light is still connected to wifi as seen in the govee app and once turned on in the app the light reappears in HA.

021-05-06 01:01:15 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {‘data’: {‘device’: ‘XXXX’, ‘model’: ‘H6199’, ‘properties’: [{‘online’: True}, {‘powerState’: ‘off’}, {‘brightness’: 50}, {‘color’: {‘r’: 255, ‘b’: 255, ‘g’: 255}}]}, ‘message’: ‘Success’, ‘code’: 200}, resulting state object: GoveeDevice(device=‘XXXX’, model=‘H6199’, device_name=‘living_room_tv_light’, 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=127, color=(255, 255, 255), color_temp=0, timestamp=1620226875.31712, source=<GoveeSource.API: ‘api’>, error=None, lock_set_until=0, lock_get_until=0, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-05-06 01:01:15 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.314 seconds
2021-05-06 01:01:19 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/config/custom_components/fronius_inverter/sensor.py”, line 319, in async_update
await self._update()
File “/config/custom_components/fronius_inverter/sensor.py”, line 367, in _update
self._data = (await self.fetch_data(self._build_url()))[‘Body’][‘Data’]
File “/config/custom_components/fronius_inverter/sensor.py”, line 335, in fetch_data
response = await self._session.get(url, timeout=10)
File “/usr/local/lib/python3.8/site-packages/aiohttp/client.py”, line 619, in _request
break
File “/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py”, line 656, in exit
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/config/custom_components/fronius_inverter/sensor.py”, line 116, in fetch_data
await fetcher.async_update()
File “/config/custom_components/fronius_inverter/sensor.py”, line 322, in async_update
except asyncio.TimeoutError:
NameError: name ‘asyncio’ is not defined
2021-05-06 01:01:19 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/config/custom_components/fronius_inverter/sensor.py”, line 319, in async_update
await self._update()
File “/config/custom_components/fronius_inverter/sensor.py”, line 381, in _update
self._data = (await self.fetch_data(self._build_url()))[‘Body’][‘Data’][‘Site’]
File “/config/custom_components/fronius_inverter/sensor.py”, line 335, in fetch_data
response = await self._session.get(url, timeout=10)
File “/usr/local/lib/python3.8/site-packages/aiohttp/client.py”, line 619, in _request
break
File “/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py”, line 656, in exit
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/config/custom_components/fronius_inverter/sensor.py”, line 116, in fetch_data
await fetcher.async_update()
File “/config/custom_components/fronius_inverter/sensor.py”, line 322, in async_update
except asyncio.TimeoutError:
NameError: name ‘asyncio’ is not defined
2021-05-06 01:01:20 ERROR (MainThread) [custom_components.fronius_inverter.sensor] Failed to update: connection error
2021-05-06 01:01:25 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-05-06 01:01:25 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-05-06 01:01:25 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 99 in 59.786585092544556 seconds
2021-05-06 01:01:25 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {‘data’: {‘device’: ‘XXXX’, ‘model’: ‘H6199’, ‘properties’: [{‘online’: ‘false’}, {‘powerState’: ‘off’}, {‘brightness’: 50}, {‘color’: {‘r’: 255, ‘b’: 255, ‘g’: 255}}]}, ‘message’: ‘Success’, ‘code’: 200}, resulting state object: GoveeDevice(device=‘XXXX’, model=‘H6199’, device_name=‘living_room_tv_light’, controllable=True, retrievable=True, support_cmds=[‘turn’, ‘brightness’, ‘color’, ‘colorTem’], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=False, power_state=False, brightness=127, color=(255, 255, 255), color_temp=0, timestamp=1620226885.352289, source=<GoveeSource.API: ‘api’>, error=None, lock_set_until=0, lock_get_until=0,
learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-05-06 01:01:25 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.351 seconds
2021-05-06 01:01:28 ERROR (MainThread) [homeassistant.components.wled] Error fetching wled data: Invalid response from API: Timeout occurred while connecting to WLED device at 192.168.1.35

1 Like

@LaggAt
First of all your integration is awesome!
Using govee immersion (h6199) and since the last update having same unavailable issues on home assistant.

Tried wake up on lan method without luck.
The only fix for me is to open govee app, and the device then available again on home assistant.

Is there any walkthrough I need to do?

1 Like

I ignore the asyncio errors from custom_component fronius_inverter, they do not relate to us.
Hi, wonder what it causes you got that offline response from the API, havn’t seen that on my site. Seems their state is wrong in API, Govee Home can still use them because of the BLE support.

Seems to be the same issue here, led reporting offline here.

I would suggest the following:

  • make sure there are no network issues hindering the Govee lights to reach internet.
  • make sure the device isn’t really off (power failure, e.g. a TV as power source)
  • once this is eliminated as issue, as a workaround try to ignore ‘online’ state updates from API, you do this on the Govee integration using the ‘Configure’ button, and enter this “DISABLE state updates” as seen in the last row here:
    image

This may work, but please consider this a workaround. If you have issues your light is reporting wrong state from Govee API you should contact Govee Support on that and ask for a fix on this.

Kindly tell me if the hints here help you.

Call to all the coders here…

do you have an solution to this behavour? (click link below)

I must miss something, but I don’t get it.

Thanks for your quick reply!

Govee is connected to the internet, also check that on my router settings and power on.

I did what you wrote (add “api:online”) and restarted home assistant.
Govee was still unavailable.

I turned off Bluetooth on my phone and lunch the govee app. Then govee become available again.

Now I need to wait a few hours to see if this fixed the problem… Will let you know!

1 Like

Thanks @LaggAt I checked the wifi connectivity and did not observe any drop in connection. I have also checked the power supply and did not did not any problems. I have now disbaled api:online and will monitor if that fixes the problem.

1 Like

Please also report this to Govee api support, use the mail address in the mail you got the API key. They 're very helpful, think they can help more than just this workaround.