Govee integration

Just been glazing through the thread, but H6196 doesn’t seem to work with the integration at the moment (since it’s Bluetooth only)

1 Like

correct. Only WIFI/Cloud.

@hnlkaitan , the thread. Govee Bluetooth lights is a work in progress for the bluetooth govee bulbs. I also have a couple of them and working on something that may be a solution. Sounds like this wifi govee bulb/led strip is farther along.

Regards

1 Like

Correct, but I do no promises I may not hold. Hope we will have both integrated later. It’s all open sourced.

1 Like

I do have brightness controls also working now with a custom component. I’m not sure how much time I’ll spend on it though since I’m really just looking something that meets for my own needs. But I might try to clean it up and release it one day.

1 Like

Something weird started happening today with the Govee integration.
Every few seconds the on/off button for the Govee lights displays unavailable. It will still turn the lights on and off (most times). When it comes back from unavailable it will display the last state. The Govee App displays available at all times.
I’m wondering if the API has changed or am I missing something?

1 Like

Havn’t seen that here, could you enable debug log and try to capture it while showing unavailable? Please also consider other issues, like flappy Internet connection.

Well…of course, it is stable now. It just did it yesterday but I could still control the lights. No issues today, I don’t know what the deal was.

1 Like

Do you remember if the issue persisted a restart?
I’m just trying to think of possible reasons.

It started (or I noticed) probably 2 days after a restart. Did a restart yesterday (due to a sensor change) and it continued after that. Looked at it this morning and it is stable off (which it is). Yesterday when it cycling unavailable, I could still turn it on and off with HA and the APP. The App never indicated unavailable.

1 Like

Well, the App has the BLE always available, if WiFi or API fails.
I just looked over the code, when you really talk about ‘unavailable’ there are not many reasons:

a request failed to connect, to be exact the underlying aiohttp returns a ClientError. This may be a broken internet, an unreachable API server, dropped packages on Govee site (I don’t think they’ll drop even if we hit the api limits, but let’s consider the eventuallity).

The method handling these requests doesn’t log an error by itself, but leaves it to the calling methods to handle it. But the integration should log a warning, which you should see without debug logging enabled. So …

Do you see these warnings around the time you saw the issues?

def is_online(online: bool):
    """Log online/offline change."""
    msg = "API is offline."
    if online:
        msg = "API is back online."
    _LOGGER.warning(msg)

When I first noticed it, I was not home; so the app was using the API and not bluetooth.
Since at the time I did not have extra logging on; all that I saw was Govee unavailable; Govee set to Off; rinse and repeat and repeat and repeat.
I was just curious if anyone else saw this; not much for you or I to troubleshoot since it isn’t doing it anymore.
TV Backlight is my Govee lights


I just have hours and hours of this in my logs with nothing else related to it.

1 Like

yes, you 're right. If I see something like that i want to know what it is.
Curious to see the 10 minute pattern here.
off to unavail: 4 minutes, followed by
unavail to off: 6 minutes.
repeat.

That was every 10 seconds, I have a very lengthy log for that period of time.

1 Like

oh sure, seconds.
probably your pull interval.
Maybe the state request fails after 4s, and the ping to check connection succeeds. I’ll add some information to the logs when going unavailable/available to see more next time.

Hi everyone! I added Govee LED via HACS but I can’t add it via the integrations page. Am I missing something? I’m relatively new with HA so it absolutely could be me.

image

Thank you!

1 Like

Try a restart. It also may take some minutes to download the python packages.

If this still fails, please try another custom component using HACS (to check HACS is working). If nothing works come back here, we will try to help.

Thanks for the work you’ve done on this integration. I’ve got a problem setting up control with a Govee H6160. It appears to be detected, but I can’t control this device to turn it on or off or set brightness.

Here is part of the debug log:
`2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] govee_api_laggat v0.1.37

2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_devices

2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 95 in 12.296708106994629 seconds

2021-01-22 20:05:34 INFO (MainThread) [custom_components.govee.learning_storage] Loaded learning information from /config/govee_learning.yaml.

2021-01-22 20:05:34 DEBUG (MainThread) [custom_components.govee.light] Setting up Govee lights

2021-01-22 20:05:34 DEBUG (MainThread) [custom_components.govee.light] _async_update

2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states

2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 98 in 52.23232889175415 seconds

2021-01-22 20:05:34 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {‘data’: {‘device’: ‘16:24:A4:C1:38:48:1C:40’, ‘model’: ‘H6160’, ‘properties’: [{‘online’: ‘false’}, {‘powerState’: ‘off’}, {‘brightness’: 100}, {‘color’: {‘r’: 165, ‘b’: 165, ‘g’: 165}}]}, ‘message’: ‘Success’, ‘code’: 200}, resulting state object: GoveeDevice(device=‘16:24:A4:C1:38:48:1C:40’, model=‘H6160’, device_name=‘Smart 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=254, color=(165, 165, 165), color_temp=0, timestamp=1611363934.797938, source=‘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)

2021-01-22 20:05:34 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.058 seconds

2021-01-22 20:05:44 DEBUG (MainThread) [custom_components.govee.light] _async_update

2021-01-22 20:05:44 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states

2021-01-22 20:05:44 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 94 in 2.9644711017608643 seconds

2021-01-22 20:05:44 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {‘data’: {‘device’: ‘16:24:A4:C1:38:48:1C:40’, ‘model’: ‘H6160’, ‘properties’: [{‘online’: ‘false’}, {‘powerState’: ‘off’}, {‘brightness’: 100}, {‘color’: {‘r’: 165, ‘b’: 165, ‘g’: 165}}]}, ‘message’: ‘Success’, ‘code’: 200}, resulting state object: GoveeDevice(device=‘16:24:A4:C1:38:48:1C:40’, model=‘H6160’, device_name=‘Smart 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=254, color=(165, 165, 165), color_temp=0, timestamp=1611363944.064263, source=‘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)`

Here is the image on Device Configuration.

Here is my /config/govee_learning.yaml:
16:24:A4:C1:38:48:1C:40: set_brightness_max: 100 get_brightness_max: 100 before_set_brightness_turn_on: false config_offline_is_off: false

I’m really new at Home Assistant and not sure where else to look to test or for configuration. Any help would be greatly appreciated! (I hope I didn’t mess up copying the log entries)

1 Like

Seems your device is not connected to the API.

Thank you. Do you have any suggestions on how I can connect the device to the API? Is there a file that I can change the setting to ‘true’?

1 Like