Govee integration

Thank you for this cool custom component @LaggAt, very useful! I did a review of some of these lights a few weeks back and I included your work in that video and gave you a mention, I forgot to come here to let you know but just wanted to drop in and say thanks for making this! :slight_smile:

1 Like

I tried something like this too, it has some more caveats as you must remember the state before starting, and restore it afterwards.

Thank you, that is great, and would make a good howto video for newbies. Just watching your video, may I link it in the intro post?

1 Like

Oh of course of course, please feel free!

2 Likes

Finally made it.
The trigger its the Aqara Vibration sensor attached in my door bell (from street)

action:
sequence:

  • service: light.turn_off
    data:
    device_id: xxxxxxx
    entity_id: light.despacho_mesa
    domain: light
  • delay: ā€˜00:00:02ā€™
  • service: light.turn_on
    data:
    device_id: xxxxxxx
    entity_id: light.despacho_mesa
    domain: light
  • delay: ā€˜00:00:02ā€™

Now i will try to some color changes :wink:

2 Likes

I decided to provide a HACS repository.
Itā€™s very minimalistic right now, but anything is there so that you can add it.

In HACS, add a custom repository using the three dots button in the upper right corner:

Repo-URL: https://github.com/LaggAt/hacs-govee
Choose Category: Integration
Click Add.

This should bring you updates in HACS, I just need some time to work into hacs fundamentals.
That all said, i have set my core pull requests to draft state, not walking in that direction anymore for now.
Maybe I do that later, for now I want to provide a quick update mechanism and HACS seems good suited for this.

Iā€™ll continue to update the integration, you may help me turning coffee into codeā€¦


Thanks!

4 Likes

Good call, Iā€™ve been running HACS for awhile now and itā€™s been great.

1 Like

You have all my thanks for your work and a coffe :wink:
Hope that in some point can have some scenes :slight_smile:

1 Like

Tastes great, thanks.

1 Like

Am I correct in understanding that the error being reported below can still be ignored and is not an issue?

Logger: govee_api_laggat.govee_api_laggat
Source: /usr/local/lib/python3.8/site-packages/govee_api_laggat/govee_api_laggat.py:579
First occurred: November 10, 2020, 12:08:31 PM (18857 occurrences)
Last logged: 11:19:39 AM

unknown state property {ā€˜colorTemInKelvinā€™: 5800}

1 Like

Yes, you can savly ignore that, here is the ticket to track the progress here:

Hi Iā€™ve just installed the h6182 to my tv connected via USB from the tv.

HA keeps reporting the lights as on even when the tv is off and not giving the lights power. Is there any way to change this?

1 Like

Hi, welcome onboard. Iā€™m a bit confused you connected via USB to the PC? API needs TCP/Internet connection, so I would expect WIFI connected and working internet access.

1 Like

I think what he means in that the Govee Lights are powered via the TV USB port.

Actually having read his comment i believe I have the same issue. HA sees govee lights as always on
(with same model as above).
May be to do with how the API reports to HA tho rather than an actual error.

2 Likes

Ah thanks, connected to USB for power, sure :slight_smile:
Could one of you enable debug log (see first post how to do that) and show a log containing a state result from api when the device is off, but showing as on? That should be enough for finding the issue.Thanks.

edit: I updated the first post accordingly.

2 Likes

Does this give you what you needā€¦

What Iā€™ve done is rebooted HA with my TV (and Govee) offā€¦HA/API reports light as Onā€¦toggled it off via HA and a few seconds later it reappears as On in HA.
Let me know if you need more

> 2020-11-12 21:12:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 97 in 3.1672420501708984 seconds
> 2020-11-12 21:12:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {'data': {'device': 'REDACTED', 'model': 'H6182', 'properties': [{'online': 'false'}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 127, 'b': 255, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='REDACTED', model='H6182', device_name='Govee TV', 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=True, brightness=254, color=(127, 0, 255), timestamp=1605215530.507044, 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)
> 2020-11-12 21:12:10 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 2.895 seconds
> 2020-11-12 21:12:30 DEBUG (MainThread) [custom_components.govee.light] _async_update
> 2020-11-12 21:12:30 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
> 2020-11-12 21:12:30 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 98 in 16.21656084060669 seconds
> 2020-11-12 21:12:30 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {'data': {'device': 'REDACTED', 'model': 'H6182', 'properties': [{'online': 'false'}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 127, 'b': 255, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='
REDACTED', model='H6182', device_name='Govee TV', 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=True, brightness=254, color=(127, 0, 255), timestamp=1605215550.785988, 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)
> 2020-11-12 21:12:30 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.779 seconds
> 2020-11-12 21:12:50 DEBUG (MainThread) [custom_components.govee.light] _async_update
> 2020-11-12 21:12:50 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
> 2020-11-12 21:12:50 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 99 in 59.93871092796326 seconds
> 2020-11-12 21:12:50 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {'data': {'device': 'REDACTED', 'model': 'H6182', 'properties': [{'online': 'false'}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 127, 'b': 255, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='REDACTED', model='H6182', device_name='Govee TV', 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=True, brightness=254, color=(127, 0, 255), timestamp=1605215570.583801, 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)
> 2020-11-12 21:12:50 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.552 seconds
> 2020-11-12 21:13:06 DEBUG (MainThread) [custom_components.govee.light] async_turn_off for Govee light REDACTED
> 2020-11-12 21:13:06 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control REDACTED: {'name': 'turn', 'value': 'off'}
> 2020-11-12 21:13:06 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 98 in 43.969337940216064 seconds
> 2020-11-12 21:13:10 DEBUG (MainThread) [custom_components.govee.light] _async_update
> 2020-11-12 21:13:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
> 2020-11-12 21:13:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] Rate limit total: 100, remaining: 99 in 59.92372798919678 seconds
> 2020-11-12 21:13:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] state returned from API: {'data': {'device': 'REDACTED', 'model': 'H6182', 'properties': [{'online': 'false'}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 127, 'b': 255, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='REDACTED', model='H6182', device_name='Govee TV', 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=True, brightness=254, color=(127, 0, 255), timestamp=1605215590.130717, source='api', error=None, lock_set_until=0, lock_get_until=1605215588.553215, learned_set_brightness_max=None, learned_get_brightness_max=100, before_set_brightness_turn_on=False)
> 2020-11-12 21:13:10 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.130 seconds

(REDACTED is where Iā€™ve taken out the mac address)

2 Likes

Apologise and thank you @LaggAt @Gav_in
Yes the lights are powered by the usb on my tv, due to the tv being mounted the wall with no access to a spare socket.

Again thank you @Gav_in for posting the logs

2 Likes

Probably, result from API is ā€¦

{
  "data": {
    "device": "REDACTED",
    "model": "H6182",
    "properties": [
      { "online": "false" },
      { "powerState": "on" },
      { "brightness": 100 },
      { "color": { "r": 127, "b": 255, "g": 0 } }
    ]
  },
  "message": "Success",
  "code": 200
}

I wonder about the online: false - seems your led couldnā€™t connect to the API.
Are these lights able to connect to the internet? Could be some IOT VLAN you use which is firewalled, non-working Gateway connection, ā€¦ some network stuff.

The state here is clearly ON with a brightness of 100, this seems to be the last known value.

1 Like

No need to apoligise, Iā€™m ready to ask questions when I donā€™t get it :smiley:

No Iā€™ve nothing fancy like that going onā€¦itā€™s on the list but no IOT VLAN yet :grin:

From what I can guess the API is not reporting correctly or not updating as the device is being turned off (with the TV powering down). When the TV and Light are on they can be controlled via the Govee App via Wifi so I believe the device is connecting correctly when powered on
Might just be ā€œone of those thingsā€ :thinking:

1 Like