core
core copied to clipboard
Failed to turn on/off Magic Home Ceiling Light CCT model 0x09 through HA
The problem
I bought a CCT bulb and this is my first time to config a Magic House device in HA. I followed the tips to connect it to my router and HA discovered it autometically. It works fine with the Magic Home App, but I failed to change the power status or brightness in HA. When I click the switch button on the dashboard it slides to the other side, with nothing happen to the bulb, holding on for a while and slides back again. This corresponds to the log. However, when I turn it on/off in Magic Home App, the on/off status changes exactly on the HA dashboard(but cannot see the change of brightness and color temp).
Then, if I stop playing with the adjustment of the bulb for a few minutes, the entity status in HA turns to unavailable. Any time I play with it again or just come back to the Magic App, the status turns back to available. I am pretty sure that the device had never lost the WiFi connection when I looked into my router logs.
I have also found that another entity within this bulb, which is 'remote access' and is alive when the entity light goes away, could be turned on/off successfully without such time limit(I can see the changes in Magic App). In addition, I can link it to Alexa without any trouble and I have control over it through Alexa properly even when it's grey(unavailable) on HA. After Alexa change the status of light, the bulb go back on dashboard available as well. I can use it with Alexa, But I want more feasibility by using HA.
I feel so confused. The model of this device is 0x09, among the supported list in documentation. So I thought it should work just fine with HA but I am doubting if I have got anything wrong.
What version of Home Assistant Core has the issue?
core-2022.7.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
flux_led
Link to integration documentation on our website
https://www.home-assistant.io/integrations/flux_led
Diagnostics information
config_entry-flux_led-1ae4218444ae964bdd55b089edb05c58.json.txt
Example YAML snippet
I haven't add anything to *.yaml yet.
Anything in the logs that might be useful for us?
This is how it looks like when I try to turn it off over HA:
2022-07-28 01:52:39 INFO (MainThread) [homeassistant.components.flux_led.coordinator] Fetching 192.168.50.26 data recovered
2022-07-28 01:52:39 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 01:52:42 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x06 0x00 0x04 0x71 0x24 0x0F 0xA4 0x1A (15)
2022-07-28 01:52:42 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:42 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:42 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x07 0x00 0x04 0x81 0x8A 0x8B 0x96 0xFF (15)
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (1/6)
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x08 0x00 0x04 0x71 0x24 0x0F 0xA4 0x1C (15)
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:43 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x09 0x00 0x04 0x81 0x8A 0x8B 0x96 0x01 (15)
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (2/6)
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0A 0x00 0x04 0x71 0x24 0x0F 0xA4 0x1E (15)
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:44 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0B 0x00 0x04 0x81 0x8A 0x8B 0x96 0x03 (15)
2022-07-28 01:52:45 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:45 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (3/6)
2022-07-28 01:52:45 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0C 0x00 0x04 0x71 0x24 0x0F 0xA4 0x20 (15)
2022-07-28 01:52:45 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0D 0x00 0x04 0x81 0x8A 0x8B 0x96 0x05 (15)
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (4/6)
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0E 0x00 0x04 0x71 0x24 0x0F 0xA4 0x22 (15)
2022-07-28 01:52:46 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:47 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:47 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x0F 0x00 0x04 0x81 0x8A 0x8B 0x96 0x07 (15)
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (5/6)
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x10 0x00 0x04 0x71 0x24 0x0F 0xA4 0x24 (15)
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Waiting for power state response
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Bulb failed to respond, sending state query
2022-07-28 01:52:48 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x11 0x00 0x04 0x81 0x8A 0x8B 0x96 0x09 (15)
2022-07-28 01:52:49 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 01:52:49 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: State query did not return expected power state of False
2022-07-28 01:52:49 DEBUG (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to set power state to False (6/6)
2022-07-28 01:52:49 ERROR (MainThread) [flux_led.aiodevice] 192.168.50.26: Failed to change power state to False after 6 attempts; Try rebooting the device
2022-07-28 01:52:51 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
This might be what happened after it turns to be unavailable:
2022-07-28 02:02:36 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 02:02:46 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 02:02:56 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 02:03:06 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: True)
2022-07-28 02:03:16 ERROR (MainThread) [homeassistant.components.flux_led.coordinator] Error fetching 192.168.50.26 data: 192.168.50.26: Bulb stopped responding
2022-07-28 02:03:16 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.001 seconds (success: False)
2022-07-28 02:03:16 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577): Connection lost: None
2022-07-28 02:03:26 DEBUG (MainThread) [homeassistant.components.flux_led.coordinator] Finished fetching 192.168.50.26 data in 0.000 seconds (success: False)
Additional information
No response
flux_led documentation flux_led source (message by IssueLinks)
Hey there @icemanch, @bdraco, mind taking a look at this issue as it has been labeled with an integration (flux_led) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
Can you provide a link to purchase this device? I've never actually seen this model so support for it was a bit of a guess based on previous data contributed from users.
Usually it's the mask of 0x0F or 0xF0 they needs to change when on/off doesn't work. Should hopefully be pretty easy to fix it I can get one of the devices in hand
@BlueCitizens
Can you provide a link to purchase this device? I've never actually seen this model so support for it was a bit of a guess based on previous data contributed from users.
Sorry for getting back to you late. I bought this from a seller on a Chinese site, so I have been looking for the same model on other sites these days.
Unfortunately, the only thing I make sure with the seller is that the manufacturer is zengge. He is even the only seller I have seen on that Chinese site. I have been so sweaty that I was not even closer to find it apart from that seller.
It actually looks like below:

The link to where I bought this is attached below and it's entirely in Chinese. The link to purchase this device I'm not sure if it's still worth fixing since I guess few people have this specific model of device. I'm not so eager to see it working, so please take your time and let me know if you would like to follow up on this issue or there is something I can do to make it better.
By the way I remembered seeing in some issues that sharing devices over magic home app might help with debug. So if you need it I am willing to share the device with you. I am currently not with this device until I finished my trip and get back to my apartment after 2022/9/16.
I think it's a good idea for me to look for some useful information on the package or the bulb itself. I can even tear it down if necessary so that it might help me to find which model it actually belongs. It's just that I have to be back to my place before these could be done.
I can usually figure them out if you share the device.
My magic home account is [email protected]
Thanks a lot I will let you know as soon as I get things ready. Currently the device is not online. I unplugged it before I left.
@bdraco Hi, I have added your account to my magic home shared list, my account is [email protected]. I think the device is available for you now.
Thanks. I think it's the one labeled Bedroom Lamp (I have about 150 test devices in there)
I'm traveling today, but I'll do some testing with it when I get home later this week so you may see it turn on/off a few times.
Turn on
{
"dataCommandItems": [
{
"hexData": "71230fa3",
}
]
}
Turn off
{
"dataCommandItems": [
{
"hexData": "71240fa4",
}
]
}
Adjust temp
{
"dataCommandItems": [
{
"hexData": "35b14b040000000338",
}
]
}
Adjust temp
{
"dataCommandItems": [
{
"hexData": "35b123040000000310",
}
]
}
Warm 2%
{
"dataCommandItems": [
{
"hexData": "35b1000200000003eb",
}
]
}
Warm 2%
{
"dataCommandItems": [
{
"hexData": "35b1000200000003eb",
}
]
}
Warm 98%
{
"dataCommandItems": [
{
"hexData": "35b10062000000034b",
}
]
}
Cool 2%
{
"dataCommandItems": [
{
"hexData": "35b16402000000034f",
}
]
}
Cool 85%
{
"dataCommandItems": [
{
"hexData": "35b1645500000003a2",
}
]
}
Adjust temp to half and half -> 100% bright 35b13264000000037f
Adjust temp to half and half -> 50% bright 35b13232000000034d
Adjust temp to half and half -> 25% bright 35b132190000000334
Adjust temp to half and half -> 0% bright 35b13200000000031b
Adjust temp to full warm -> 100% bright 35b10064000000034d
Adjust temp to full cool -> 100% bright 35b1646400000003b1
So I think we have the protocol correct
we send 2022-07-28 01:52:42 DEBUG (MainThread) [flux_led.aioprotocol] ('192.168.50.26', 5577) => 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x06 0x00 0x04 0x71 0x24 0x0F 0xA4 0x1A (15)
which is the wrapped version of 0x71 0x24 0x0F 0xA4
Which is the same turn off command
{
"dataCommandItems": [
{
"hexData": "71240fa4",
}
]
}
I think the firmware is just older and doesn't know how to deal with the 0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x06 0x00 0x04 ... 0x1A byte wrapper
So the state query command seems to be the same but the bulb doesn't respond in your log.
0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x07 0x00 0x04 0x81 0x8A 0x8B 0x96 0xFF
0xB0 0xB1 0xB2 0xB3 0x00 0x01 0x01 0x07 0x00 0x04 0x81 0x8A 0x8B 0x96 0xFF
So it looks like what we are sending is actually correct and the problem is something more subtle.
I stumbled my way though the Taobao site and managed to order one to the US. I'll try it when it hopefully shows up in a month or two.
Sorry for getting back late to your investigation. I tried these hex bytes through tcp socket and it responds exactly as you said, those wrapped bytes don't work while the original ones work well. I am not quite experienced in handling protocol issues, so I'm afraid that few things I can do to help further.
Since you mentioned the possibility of firmware issues, my device version is 09.v1.16.7458-A. It looks like there is no firmware updating function, so everything is factory version.
I didn't expected that you actually ordered one, I was thinking of getting one for you. Anyway thank you for the efforts that make it perfect. Just let me know when you need help.
Thanks. I'll provide additional updates once the device arrives and I can test live.
Finally got cleared by customs and is now en-route. I'm hoping it shows up before the holiday.
Showed up. Saw the problem right away.
Fixed in https://github.com/home-assistant/core/pull/82347
Finally got time trying it out and find it works well as expected. Anyway, thanks for all the efforts you have made, and enjoy your holiday!
Great. Thanks for confirming