XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

Mijia LED Bulb cannot change brightness or color (instantly reverts back to original value)

Open sulliwane opened this issue 1 year ago • 5 comments

Hello All,

I purchased this Mijia compatible LED Bulb: IMG_20231025_203635 IMG_20231025_203642

Control it through Xiaomi_gateway_3 (and Xiaomi Multimode 2): IMG_20231025_204818

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: Screenshot from 2023-10-25 21-34-55

Screenshot from 2023-10-25 21-33-54

Any help would me much appreciated!! Thanks in advance :)

sulliwane avatar Oct 25 '23 19:10 sulliwane

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.

dixon777 avatar Oct 29 '23 09:10 dixon777

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 ^^

sulliwane avatar Oct 30 '23 13:10 sulliwane

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.

dixon777 avatar Oct 31 '23 01:10 dixon777

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 avatar Nov 01 '23 15:11 sulliwane

@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.

dixon777 avatar Nov 02 '23 03:11 dixon777

https://github.com/AlexxIT/XiaomiGateway3/releases/tag/v4.0.0

AlexxIT avatar Mar 31 '24 17:03 AlexxIT