XiaomiGateway3
XiaomiGateway3 copied to clipboard
Mijia LED Bulb cannot change brightness or color (instantly reverts back to original value)
Hello All,
I purchased this Mijia compatible LED Bulb:
Control it through Xiaomi_gateway_3 (and Xiaomi Multimode 2):
But as you can see on this video, when trying to change the brightness it always auto reverts back to brightness level set in the Mijia App:
https://github.com/AlexxIT/XiaomiGateway3/assets/1733686/380cd659-b8f2-420f-b77b-e7ab7061d9dc
I found this error in the logs, not sure it's related to my above problem but still posting:
Any help would me much appreciated!! Thanks in advance :)
When this entity "night_light_time" is created, the attribute self._attr_native_value is initialized to empty string . Before self._attr_native_value is updated with the value obtained from the device, the function self.state is called and self._attr_native_value does not match the attribute self._attr_pattern. Therefore, the error shown in your last screenshot appears. Such error seems to prevent us from changing other entities.
#1142 should fix this issue by initializing self._attr_native_value to None so that it ignore pattern check when self.state is called until self._attr_native_value is updated with the device value.
Hey @dixon777 thanks a lot for your answer! I'd love to see #1142 merged and give it a shot to see if it solves my issue. Can also consider installing your custom git pull branch...but not sure if it's easy to do directly in HACS or if I need to go through the ssh terminal. Let me know how I can help. I have 3 or 4 such bulbs, and they are currently unusable ^^
I doubt it can be installed directly from HACS since it has not been merged. I would suggest either the changes through other means, such as git command(haven't tried but think it should work), or directly editing the related updated files if the former method doesn't work out.
Thanks for your answer @dixon777 .
Do you have an idea regarding when we can expect your pull request to be merged?
Also, do you see any value in my trying your patch to make sure it solves the above problem?
Depending on that, I'll decide whether I locally try the fix, or wait for official version to be released :) (As I expect it's not that straightforward)
@sulliwane
Do you have an idea regarding when we can expect your pull request to be merged?
According to my experience, when PR involved modification more than just adding or fixing device converters, it took quite a long time until the PR gets reviewed. It's been almost 2 months and yet there hasn't been any comment on #1142. I can't be sure when it will be merged and would recommend you to try to fix it yourself locally.
https://github.com/AlexxIT/XiaomiGateway3/releases/tag/v4.0.0