# ON with "0" typed in
type: turn_on
device_id: 9c47418f0c0b11eb80f6af0639fb12d6
entity_id: light.h6104_22dc
domain: light
brightness_pct: 0
The issue may not entirely be with your integration since it is using the light domain, HA may assume that any brightness command with turn on the light so that it only send the brightness. In the H6104âs case a brightness command will NOT turn on the light. So maybe a way around this is the send an âonâ command with each brightness change
As you can see above if someone does not look at the YAML it is impossible for them to know when brightness is â0â if they are sending an âONâ or a brightness to â0â command.
At least my issues are helping you build a better integration.
So, I did your tests.
Iâve some details for your that might help you with your automations:
Here I agree with you - showing 0 brightness here, when NO brightness is set, is a bit confusing. Anyhow nothing I could handle in the Govee integration. If you call me with the brightness_pct: 0 as here:
type: turn_on
device_id: 620340a3fc4411ea9b5a796102a41718
entity_id: light.hallway_h6163_7a1c
domain: light
brightness_pct: 0 <-- this line is added entering a 0 once.
home assistant is calling the
async def async_turn_off(self, **kwargs)
Well, I also tried to send brightness 0 to the govee lights, which also turns them off. For the UI showing the same no matter âbrightness_pct: 0â is there or not, you may search for or open an issue in the core project here: Issues ¡ home-assistant/core ¡ GitHub
Anyhow: you know it now, if you want to remove the 0 quickly switch to yaml view and remove the line.
I configured all your automations in my test envoronment, and saw no action failing or results, I didnât expect. Here are my details:
# On command via automation brightness at default "0"
2020-10-12 20:00:54 DEBUG (MainThread) [homeassistant.components.govee.light] async_turn_on for Govee light 40:83:FF:FF:FF:FF:FF:FF, kwargs: {}
2020-10-12 20:01:20 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control 40:83:FF:FF:FF:FF:FF:FF: {'name': 'turn', 'value': 'on'}
## result: light is turning on with last brightness value
## the integration doesn't get this brightness == 0 information, which seems legit, as allowed range on home assistant is 1-255 and this is not in the automation yaml.
# Off command via automation
2020-10-12 20:09:50 DEBUG (MainThread) [homeassistant.components.govee.light] async_turn_off for Govee light 40:83:FF:FF:FF:FF:FF:FF
2020-10-12 20:09:50 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control 40:83:FF:FF:FF:FF:FF:FF: {'name': 'turn', 'value': 'off'}
## result: light turned off
# On command via automation brightness set to "100"
2020-10-12 20:14:08 DEBUG (MainThread) [homeassistant.components.govee.light] async_turn_on for Govee light 40:83:FF:FF:FF:FF:FF:FF, kwargs: {'brightness': 255}
2020-10-12 20:14:48 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control 40:83:FF:FF:FF:FF:FF:FF: {'name': 'brightness', 'value': 100}
## result: light was off, it turned on with full brightness
## result: light was on already, brightness is changed to full
# On commnad via automation, brightness set to "10"
2020-10-12 20:19:36 DEBUG (MainThread) [homeassistant.components.govee.light] async_turn_on for Govee light 40:83:FF:FF:FF:FF:FF:FF, kwargs: {'brightness': 26}
2020-10-12 20:19:45 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control 40:83:FF:FF:FF:FF:FF:FF: {'name': 'brightness', 'value': 9}
## result: brightness is set to 10% (26 on the 1-255 scale, 9 in the 1-100 scale)
## flooring from 10% to 9/100 is a bit ugly, but works and is close enough.
# On Command via automation with Brightness set to "0"
2020-10-12 20:23:19 DEBUG (MainThread) [homeassistant.components.govee.light] async_turn_off for Govee light 40:83:FF:FF:FF:FF:FF:FF
2020-10-12 20:23:19 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] control 40:83:FF:FF:FF:FF:FF:FF: {'name': 'turn', 'value': 'off'}
## result: as described above we're called with off. This is a bit confusing with turn_on, but as stated above nothing the integration handles. As seen in the first debug line our entry point is the "async_turn_off"
Only real difference I see is in the state results, as I get results from the api, and your device probably doesnât support api results and isnât even requesting them.
So besides the view issue with the existing or missing 0 line, all is fine here and worked as expected.
Yes, for me (H6104) a brightness command will not turn on the lights.
I donât see any issue (other than if someone has too much polling) with sending an âONâ and then a brightness; for most this will have no effect, but for those with lights similar to H6104 it has a huge effect.
Well, sending a on command before brightness > 0 (0-254 range of govee) has some downsides:
this would hit the api limit faster (especially if you have more led strips, as we must send two commands instead of one, and
the latency to set brightness is a bit higher.
the lights would flash bright if turned off whti a high brightness before.
But there is an easy and intelligent solution to this:
We already have this govee_learning.yaml, which is autocreated and remembers the ranges to set/get values from api as they differ in some led strips.
I would introduce a third value here:
Please add the H6195 to the perfectly working list.
However, I am noticing an issue with displaying in the dashboard. When the light is off, the entity on/off switch shows normal, but when on it changes. See images below.
Hi and welcome onboard!
We manage state in locally by tracking what has been set. As long as we do not get a state from API this picture is shown, with the blue âonâ and inactive black âoffâ button. If your led supports getting state, this will be updated from API on next request.
I assume your device doesnât support getting state, and added it to the first post.
Thanks for the input. Iâm going to test a Zigbee LED controller and see if I can get them accessible in HA. Iâll update here if I get them working with the controller model.
Thanks for your hard work on this @LaggAt. I had made my own led controller using ESPhome but sadly it got a bit crispy last night⌠and caused a big issue at my house.
I just bought the govee based on your integration, I see its still not in the main repo, but I would love to help where I can with this integration.
I recently made my own integration with another product in my house that calls an API so I am familiar with how to develop for home assistant. Let me know if you need any help testing or finalizing the PR.
Hi and welcome onboard, I should take money from them
I think for the PR there isnât much I could do, itâs in âNeeds reviewâ in Dev. So a core developer needs to pick up here.
The feaure/option to send a turn on before a brightness change is developed in the lib, just needs some testing (and tests), Iâm just busy setting up some camera gear here for another project.
When the above mentioned is done, I consider it complete for now.
What could be done are unit tests for the integration (config_flow is tested 100%, library is tested well, integration itself needs some work here). Also if someone wants to jump in on some bluetooth control (best in a second library/package, by turning the current lib in a handler for both variants) we could add some value here. What else? Are there other devices than lights from govee to support? Documentation?
What do you think you want to help on? I just wanted to give some ideas here, but you are probably best suited by adding your needs.
Got the HUE Bridge connected to the Zigbee controller after cutting the Govee strip up and learning that the RGB + 12V lines were not color-coded intuitivelyâŚ
Unfortunately after the power was connected, only green LEDs would reliably appear based on HUE controls. Seemed like cheap wiring on the part of Govee.