Hi, thanks for the logs @drewHA, I’ll try to find some time until weekend.
Could one of you also add switching light on/off and setting brightness to different levels?
Also if you can delete the learning yaml, and restart home assistant, please provide logs of the brightness set to 100% afterwards, there should be some log lines showing learning information.
To show the significance of the integration when talking to support I longed for installation statistics. Thanks to Home Assistant Analytics and some scripts finally this is possible.
So I found out what the issue was. First, you have to install HACS. This allows you to use community integrations. You can find many tutorials on youtube. Once there you can find the govee integration.
I did overlook your question, yes you need HACS. Hacs is great for developers and users, deployment of new features is easy and installing updates is a click away.
I’ll try and revisit tomorrow afternoon. Its tough to troubleshoot in the kid’s room; I seem to have more time when he’s asleep in there.
My brightness on full has been working well since setting the set and get to 100 in the learning file. But i’ll delete the learning file, then restart and turn on many times to get some reproducible results for you - at least on my system.
I also set my analaytics to on for you. Tally up another one - I didn’t know I had to do that, thanks for pointing that out.
I posted my updates in the issue that I opened on github. I opened it in the python library and not the HACS repo - wasn’t sure which one was the best fit… happy to give you more info if you need it. Let me know how I can help!
Thanks for the informations, especially because this is in the kid’s room.
Oh great, I’ve never seen negative brightness values. So I need a new plan for auto-learning
I’m still a bit confused what this device expects.
-4 (or -11 according to a post above) seems to be the lowest the app is setting.
254 is unsupported, so the max value must be lower. Up to know this indicated max value is 100, but who knows. According to the 40% issue the correct value must be somewhere around 254, maybe the whole range is -4 to 250. Don’t know why they change this with every model.
if -4 is already powered on, there may also be a brightness of -5 for off. I also need to consider this in the logic assuming the device is on/off after a control command.
maybe the negative values are some special values, the app uses for something. A lot of question marks appear here.
Think before digging into the code, I’ll try to contact Govee API support on that, to get some light on that issue
Well, you don’t have to, but I apprecate that alot.I hope to get some API features with this backing stats. Thank you.
How did you pull out your integration?
I did not see Govee listed nor would it come up in search on the analytics page, but I also don’t see HACS either. https://analytics.home-assistant.io/#integrations
I was playing with it a bit more. This time via google. I was successfully able to control the brightness via the google home app. Whatever I set to it using google, it was spot on in the govee app, 49% in google, 49% in govee. This was not the case in HA, though it was not off by much.
When I set the brightness to 1% via google I get the same -4 / -11 in the HA logs. I suppose this is good that I am seeing some consistency.
Yes, still wonder why -4 or -11, this is a bit inconsistency if there is no difference.
Govee answered with a new API doc v1.3, which just has some reformatting and some new models listed. So I sent them a second mail.
I lost power and now my states are showing inverse on Home Assistant. When the LED is on, it shows off in Home Assistant and when it is off, it shows On in Home Assistant.
I tried powering them on on the app with it showing as on on Home Assistant, changing the Configuration to:
API:online;HISTORY:online
and reboot, but it is still showing the inverse of what it should be.
Just saw we get no status from Govee API currently. Shouldn’t be a big issue for the integration as we manage a state locally. I just informed Govee api support.
To provide a quick view if the Govee API is running normally I did a graph.
It tests every 30 minutes:
get_devices(): this returns a list of devices registered
get_states(): this gets the state for every device
for both i plot a ‘+’ sign, if the request was answered correctly, or a dot if the request failed somehow.
This does test the functionality of the library, AND Govee API. Both must work.
you may also want to disable the two-button-View, so that the history state is shown final:
You don’t want to ignore the online state, which just tells if the device is online. Instead you want to ignore the power_state if coming from API, there is an issue we get no state currently.
Just for clarification: with this option, we only use assumed state - this is the state we remember when we switch something. If you switch with another application, e.g. Govee Home, we do not know that with that option.
If you still think this is an error - could you provide debug logs while switching your light on using Home Assistant? Would be interesting to see which state you get from where, and why the integration thinks the light is off.
edit: ah yes, and maybe provide screenshots what the UI shows.