python-govee-api icon indicating copy to clipboard operation
python-govee-api copied to clipboard

minimum 7% brightness via HA

Open georgejung opened this issue 4 years ago • 7 comments

Hi there, first thanks for your work I got one for my son's room for his birthday and got this because of your integration. I was also having the same issue in #69 and got that resolved via setting get_max to 100.

But this issue has to do with minimum brightness. Via the govee app i can set the brightness to 1% and increment up and see the changes in the brightness of the light. But in HA the minimum birghtness I can set is 7% according to the govee app. If I set the slider to the minimum in HA it will only go as low as 7% in the govee app, and it is much brighter than if I set it via the govee app to 1%.

An interesting thing is using the states, state attributes within HA, I can see that the brightness is -10 (-11 in logs below it would seem) when I manually set govee to 1%. if I go from 1% to 4% it goes to -5 brightness. If I go up to 5% in govee it shows as 1 in HA. At 7% I get a brightness of 6 or 8. Note that besides the -10 the brightness when i set 1% in govee, the readings in HA are not consistent.

If I try to set the "brightness" manually via the set state, or via an automation, anything 1 or below won't turn the lights on. But if i set "brightness" to 2 or above, it turns them on, but at that 7% level in the govee app - not the 1% that I would like.

2021-07-28 16:24:16 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-07-28 16:24:16 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-07-28 16:24:16 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.92808389663696 seconds
2021-07-28 16:24:16 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': -4}, {'color': {'r': 255, 'b': 0, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=-11, color=(255, 0, 0), color_temp=0, timestamp=1627489456.10377, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1627489396.502493, lock_get_until=1627489397.502496, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-07-28 16:24:16 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.103 seconds
2021-07-28 16:24:26 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-07-28 16:24:26 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-07-28 16:24:26 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 95 in -0.10951399803161621 seconds
2021-07-28 16:24:26 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': -4}, {'color': {'r': 255, 'b': 0, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=-11, color=(255, 0, 0), color_temp=0, timestamp=1627489466.146496, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1627489396.502493, lock_get_until=1627489397.502496, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-07-28 16:24:26 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.145 seconds

georgejung avatar Jul 29 '21 03:07 georgejung

So here are the results of test #1. I stopped my container, deleted the learning file, then satrted back up. Light was off, i turned on in HA by sliding the brightness all the way to the top. Then in HA i slid it all the way to the lowest. Then I went into govee app and it said 7% so i manually slide it down to 1%, which is when I start getting the wierd errors of negative.

2021-08-07 17:17:21 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] govee_api_laggat v0.2.1
2021-08-07 17:17:21 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_devices
2021-08-07 17:17:21 DEBUG (MainThread) [govee_api_laggat.api] get_devices

2021-08-07 17:17:23 WARNING (MainThread) [custom_components.govee] API is back online.
2021-08-07 17:17:23 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 0.3851938247680664 seconds
2021-08-07 17:17:23 WARNING (MainThread) [custom_components.govee.learning_storage] There is no /config/govee_learning.yaml file containing learned information about your devices. This is normal for first start of Govee integration.
2021-08-07 17:17:23 DEBUG (MainThread) [custom_components.govee.light] Setting up Govee lights
2021-08-07 17:17:23 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:17:23 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:17:23 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.92126107215881 seconds
2021-08-07 17:17:23 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] learned device 5C:XX:XX:XX:XX uses range 0-100 for getting brightness state.
2021-08-07 17:17:23 INFO (MainThread) [govee_api_laggat.govee_api_laggat] brightness range for 5C:XX:XX:XX:XX is assumed. If the brightness slider doesn't match the actual brightness pull the brightness up to max once.
2021-08-07 17:17:23 INFO (MainThread) [custom_components.govee.learning_storage] Stored learning information to /config/govee_learning.yaml.
2021-08-07 17:17:23 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=254, color=(75, 231, 255), color_temp=0, timestamp=1628356643.921396, source=<GoveeSource.API: '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-08-07 17:17:23 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.109 seconds

2021-08-07 17:17:33 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:17:33 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:17:33 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 50.727017879486084 seconds
2021-08-07 17:17:33 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=254, color=(75, 231, 255), color_temp=0, timestamp=1628356653.111351, source=<GoveeSource.API: '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-08-07 17:17:33 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.109 seconds


Here is where I set the brightness in HA manually down to thr lowest the slider would go:

2021-08-07 17:18:35 DEBUG (MainThread) [custom_components.govee.light] async_turn_on for Govee light 5C:XX:XX:XX:XX, kwargs: {'brightness': 255}
2021-08-07 17:18:35 DEBUG (MainThread) [govee_api_laggat.api] control 5C:XX:XX:XX:XX: {'name': 'brightness', 'value': 254}
2021-08-07 17:18:35 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 57.672571897506714 seconds
2021-08-07 17:18:35 WARNING (MainThread) [govee_api_laggat.api] control 5C:XX:XX:XX:XX failed: API-Error 400 on command {'name': 'brightness', 'value': 254}: {"status":400,"errors":"Unsupported Cmd Value"} for device GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=254, color=(75, 231, 255), color_temp=0, timestamp=1628356713.11306, source=<GoveeSource.API: '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-08-07 17:18:35 DEBUG (MainThread) [govee_api_laggat.api] control 5C:XX:XX:XX:XX: {'name': 'brightness', 'value': 100}
2021-08-07 17:18:35 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 17.846872091293335 seconds
2021-08-07 17:18:35 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] learned device 5C:XX:XX:XX:XX uses range 0-100 for setting brightness.
2021-08-07 17:18:35 INFO (MainThread) [custom_components.govee.learning_storage] Stored learning information to /config/govee_learning.yaml.
2021-08-07 17:18:41 DEBUG (MainThread) [custom_components.govee.light] async_turn_on for Govee light 5C:XX:XX:XX:XX, kwargs: {'brightness': 3}
2021-08-07 17:18:41 DEBUG (MainThread) [govee_api_laggat.api] control 5C:XX:XX:XX:XX: {'name': 'brightness', 'value': 1}
2021-08-07 17:18:41 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 97 in 51.0780930519104 seconds
2021-08-07 17:18:43 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:18:43 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:18:43 DEBUG (MainThread) [govee_api_laggat.api] state object returned from cache: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=3, color=(75, 231, 255), color_temp=0, timestamp=1628356723.002615, source=<GoveeSource.HISTORY: 'history'>, error=None, lock_set_until=1628356722.953803, lock_get_until=1628356723.95381, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False), next state for 5C:XX:XX:XX:XX from api allowed in 0.9512648582458496 seconds
2021-08-07 17:18:43 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.001 seconds
2021-08-07 17:18:53 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:18:53 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:18:53 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 97 in 0.14850902557373047 seconds
2021-08-07 17:18:53 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': 1}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=2, color=(75, 231, 255), color_temp=0, timestamp=1628356733.168918, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1628356722.953803, lock_get_until=1628356723.95381, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-08-07 17:18:53 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.169 seconds

And then i went into the govee app - shows at 7% brightness, and i slide that as far down as it will go. Then on the next HA sync I start to get a negative brightness
2021-08-07 17:19:13 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:19:13 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:19:13 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 95 in 19.91328501701355 seconds
2021-08-07 17:19:13 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': -4}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=-11, color=(75, 231, 255), color_temp=0, timestamp=1628356753.118813, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1628356722.953803, lock_get_until=1628356723.95381, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-08-07 17:19:13 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.118 seconds
2021-08-07 17:19:23 DEBUG (MainThread) [custom_components.govee.light] _async_update

georgejung avatar Aug 07 '21 17:08 georgejung

This time I had the light on at 1% when i stopped the HA container. deleted the learning, turned off the light in govee app, then rebooted HA.

Both times to far the learning file seems to get the same values - which are different than the very first time. I forget exactly what i did the very first time to get the 254 instead of 100. When set to 100%, it stays at 100% in HA and doesn't jump back down to 40% like it did the very first time.

Unfortunately I still cant seem to get a brightness below 7% via HA...

2021-08-07 17:37:46 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] govee_api_laggat v0.2.1
2021-08-07 17:37:46 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_devices
2021-08-07 17:37:46 DEBUG (MainThread) [govee_api_laggat.api] get_devices

2021-08-07 17:37:48 WARNING (MainThread) [custom_components.govee] API is back online.
2021-08-07 17:37:48 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.825252056121826 seconds
2021-08-07 17:37:48 WARNING (MainThread) [custom_components.govee.learning_storage] There is no /config/govee_learning.yaml file containing learned information about your devices. This is normal for first start of Govee integration.
2021-08-07 17:37:48 DEBUG (MainThread) [custom_components.govee.light] Setting up Govee lights
2021-08-07 17:37:48 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:37:48 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:37:49 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 59.40423512458801 seconds
2021-08-07 17:37:49 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] learned device 5C:XX:XX:XX:XX uses range 0-100 for getting brightness state.
2021-08-07 17:37:49 INFO (MainThread) [govee_api_laggat.govee_api_laggat] brightness range for 5C:XX:XX:XX:XX is assumed. If the brightness slider doesn't match the actual brightness pull the brightness up to max once.
2021-08-07 17:37:49 INFO (MainThread) [custom_components.govee.learning_storage] Stored learning information to /config/govee_learning.yaml.
2021-08-07 17:37:49 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': -4}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=-11, color=(75, 231, 255), color_temp=0, timestamp=1628357869.273145, source=<GoveeSource.API: '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-08-07 17:37:49 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.305 seconds

Then i turned on via govee app - it was set at the last 1% setting
2021-08-07 17:41:09 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:41:09 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:41:09 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.94795203208923 seconds
2021-08-07 17:41:09 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': -4}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=-11, color=(75, 231, 255), color_temp=0, timestamp=1628358069.076029, source=<GoveeSource.API: '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-08-07 17:41:09 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.075 seconds

Then when I set it to 100% via govee app:
2021-08-07 17:50:19 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 17:50:19 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 17:50:19 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 97 in -0.04894614219665527 seconds
2021-08-07 17:50:19 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=254, color=(75, 231, 255), color_temp=0, timestamp=1628358619.074632, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1628358099.969028, lock_get_until=1628358100.969034, learned_set_brightness_max=None, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-08-07 17:50:19 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.074 seconds

georgejung avatar Aug 07 '21 18:08 georgejung

This time I set the light in govee app to 100%, then turned it off. Then stopped HA container, deleted learning and restarted. Then I turned the light on via the govee app (which was set at 100%), then slid down to 7% and then down to 1% all in the govee app. You can see when I go to 7% my brightness level is at 2 / 5 in the log. 7% brightness should be more like 30-40? And then when I slide to 1% it goes back into the negative numbers.

As I mentioned at first, when I try to set the brightness via a script or something to turn it on, if i set brightess to 1 it won't seem to turn on. setting brightness at 2 turns on, but the brightness is 7% according to the govee app, and much brighter than what i would expect 2 to be.

Let me know if you want me to run any more tests. Happy to do so when I have time here and there.

2021-08-07 18:05:58 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] govee_api_laggat v0.2.1
2021-08-07 18:05:58 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_devices
2021-08-07 18:05:58 DEBUG (MainThread) [govee_api_laggat.api] get_devices

2021-08-07 18:06:00 WARNING (MainThread) [custom_components.govee] API is back online.
2021-08-07 18:06:00 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.7860209941864 seconds
2021-08-07 18:06:00 WARNING (MainThread) [custom_components.govee.learning_storage] There is no /config/govee_learning.yaml file containing learned information about your devices. This is normal for first start of Govee integration.
2021-08-07 18:06:00 DEBUG (MainThread) [custom_components.govee.light] Setting up Govee lights
2021-08-07 18:06:00 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 18:06:00 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 18:06:00 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.96375894546509 seconds
2021-08-07 18:06:00 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] learned device 5C:XX:XX:XX:XX uses range 0-100 for getting brightness state.
2021-08-07 18:06:00 INFO (MainThread) [govee_api_laggat.govee_api_laggat] brightness range for 5C:XX:XX:XX:XX is assumed. If the brightness slider doesn't match the actual brightness pull the brightness up to max once.
2021-08-07 18:06:00 INFO (MainThread) [custom_components.govee.learning_storage] Stored learning information to /config/govee_learning.yaml.
2021-08-07 18:06:00 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=254, color=(75, 231, 255), color_temp=0, timestamp=1628359560.780563, source=<GoveeSource.API: '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-08-07 18:06:00 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.067 seconds

Then i turned on via govee:
2021-08-07 18:06:40 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 18:06:40 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 18:06:40 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 96 in 20.230370044708252 seconds
2021-08-07 18:06:40 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': 100}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=254, color=(75, 231, 255), color_temp=0, timestamp=1628359600.185427, source=<GoveeSource.API: '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-08-07 18:06:40 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.184 seconds

Then i manually slid down to 7%:
2021-08-07 18:07:00 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 18:07:00 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 18:07:00 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 95 in 0.11114692687988281 seconds
2021-08-07 18:07:00 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': 2}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=5, color=(75, 231, 255), color_temp=0, timestamp=1628359620.304723, source=<GoveeSource.API: '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-08-07 18:07:00 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.277 seconds

Then down to 1%
2021-08-07 18:07:20 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 18:07:20 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-08-07 18:07:20 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 49.866074085235596 seconds
2021-08-07 18:07:20 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': '5C:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': -4}, {'color': {'r': 75, 'b': 255, 'g': 231}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='5C:XX:XX:XX:XX', model='H6110', device_name='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=True, brightness=-11, color=(75, 231, 255), color_temp=0, timestamp=1628359640.173321, source=<GoveeSource.API: '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-08-07 18:07:20 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.172 seconds
2021-08-07 18:07:30 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-08-07 18:07:30 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states

georgejung avatar Aug 07 '21 18:08 georgejung

I asked govee about recent changes, as I never have seen negative brightness values before. Once they have some Informations I'll keep you updated. Meanwhile I set this to 'question'.

Some more details here: https://community.home-assistant.io/t/govee-integration/228516/557?u=laggat

LaggAt avatar Aug 08 '21 18:08 LaggAt

Hi there. Unfortunately I didn't succeed with my exam. But i have had a bit more time to look into Postman, and this before the next kick at the can in November - learning another language is hard!

I am not sure when, but it seems that my HA logs are now seeing 1% when it is set to 1%. Ill test more tomorrow when child is not sleeping.

What I have been doing since is using HA to turn it on, then using google assistant relay to set the brightness to 1%. It was working fine for the most part, with a delay of 2 - 3 minutes needed between the commands to ensure no issues.

More to come!

georgejung avatar Oct 02 '21 01:10 georgejung

The good news is that it seems to be working now!

In my automation file if I set brightness to 2 then it will actually set it to 1.

2021-10-04 10:05:34 DEBUG (MainThread) [custom_components.govee.light] async_turn_on for Govee light XX:XX:XX:XX:XX:XX:XX, kwargs: {'brightness': 2, 'hs_color': (0.0, 100.0)}
2021-10-04 10:05:34 DEBUG (MainThread) [govee_api_laggat.api] control XX:XX:XX:XX:XX:XX:XX: {'name': 'color', 'value': {'r': 255, 'g': 0, 'b': 0}}
2021-10-04 10:05:34 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 96 in 25.291038990020752 seconds
2021-10-04 10:05:34 DEBUG (MainThread) [govee_api_laggat.api] control XX:XX:XX:XX:XX:XX:XX: {'name': 'brightness', 'value': 1}
2021-10-04 10:05:34 DEBUG (MainThread) [govee_api_laggat.api] control XX:XX:XX:XX:XX:XX:XX is locked for 0.9995460510253906 seconds. Command waiting: {'name': 'brightness', 'value': 1}
2021-10-04 10:05:36 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 95 in 23.875428915023804 seconds
2021-10-04 10:05:40 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-10-04 10:05:40 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-10-04 10:05:40 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 97 in 29.25691294670105 seconds
2021-10-04 10:05:40 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': 'XX:XX:XX:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'on'}, {'brightness': 1}, {'color': {'r': 255, 'b': 0, 'g': 0}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='XX:XX:XX:XX:XX:XX:XX', model='H6110', device_name='kid', 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=True, brightness=2, color=(255, 0, 0), color_temp=0, timestamp=1633356340.13951, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1633356337.157074, lock_get_until=1633356338.157081, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-10-04 10:05:40 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.139 seconds (success: True)
- alias: LED bed Red
  initial_state: true
  trigger:
  - platform: time
    at: '20:02:00'
  condition: []
  action:
  - service: light.turn_on
    target:
      entity_id: light.led
    data:
      rgb_color: [255, 0, 0]
      brightness: 2

georgejung avatar Oct 04 '21 14:10 georgejung

I did have a problem last night with it not turning on though. At 20:02:00 it trigger my automation above, but it didn't seem to come on or change the color.

Usually its been working fine, just last night. More of an FYI :) Cheers

2021-10-03 20:01:50 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-10-03 20:01:50 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-10-03 20:01:50 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 98 in 19.86974596977234 seconds
2021-10-03 20:01:50 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': 'XX:XX:XX:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 143, 'b': 107, 'g': 255}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='XX:XX:XX:XX:XX:XX:XX', model='H6110', device_name='kid', 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=254, color=(143, 255, 107), color_temp=0, timestamp=1633305710.159079, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1633300431.629348, lock_get_until=1633300432.62936, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-10-03 20:01:50 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.158 seconds (success: True)
2021-10-03 20:02:00 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-10-03 20:02:00 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-10-03 20:02:00 DEBUG (MainThread) [custom_components.govee.light] async_turn_on for Govee light XX:XX:XX:XX:XX:XX:XX, kwargs: {'hs_color': (0.0, 100.0)}
2021-10-03 20:02:00 DEBUG (MainThread) [govee_api_laggat.api] control XX:XX:XX:XX:XX:XX:XX: {'name': 'color', 'value': {'r': 255, 'g': 0, 'b': 0}}
2021-10-03 20:02:00 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 97 in 9.767009973526001 seconds
2021-10-03 20:02:00 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': 'XX:XX:XX:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 143, 'b': 107, 'g': 255}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='XX:XX:XX:XX:XX:XX:XX', model='H6110', device_name='kid', 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=254, color=(143, 255, 107), color_temp=0, timestamp=1633305720.26175, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1633300431.629348, lock_get_until=1633300432.62936, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-10-03 20:02:00 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.251 seconds (success: True)
2021-10-03 20:02:00 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 96 in 9.316811800003052 seconds
2021-10-03 20:02:10 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-10-03 20:02:10 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-10-03 20:02:10 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 95 in -0.13824820518493652 seconds
2021-10-03 20:02:10 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': 'XX:XX:XX:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 143, 'b': 107, 'g': 255}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='XX:XX:XX:XX:XX:XX:XX', model='H6110', device_name='kid', 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=254, color=(143, 255, 107), color_temp=0, timestamp=1633305730.16689, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1633305721.711704, lock_get_until=1633305722.711712, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-10-03 20:02:10 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.166 seconds (success: True)
2021-10-03 20:02:20 DEBUG (MainThread) [custom_components.govee.light] _async_update
2021-10-03 20:02:20 DEBUG (MainThread) [govee_api_laggat.govee_api_laggat] get_states
2021-10-03 20:02:20 DEBUG (MainThread) [govee_api_laggat.api] Rate limit total: 100, remaining: 99 in 59.887852907180786 seconds
2021-10-03 20:02:20 DEBUG (MainThread) [govee_api_laggat.api] state returned from API: {'data': {'device': 'XX:XX:XX:XX:XX:XX:XX', 'model': 'H6110', 'properties': [{'online': True}, {'powerState': 'off'}, {'brightness': 100}, {'color': {'r': 143, 'b': 107, 'g': 255}}]}, 'message': 'Success', 'code': 200}, resulting state object: GoveeDevice(device='XX:XX:XX:XX:XX:XX:XX', model='H6110', device_name='kid', 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=254, color=(143, 255, 107), color_temp=0, timestamp=1633305740.13232, source=<GoveeSource.API: 'api'>, error=None, lock_set_until=1633305721.711704, lock_get_until=1633305722.711712, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)
2021-10-03 20:02:20 DEBUG (MainThread) [custom_components.govee.light] Finished fetching govee data in 0.132 seconds (success: True)

georgejung avatar Oct 04 '21 14:10 georgejung