Yeelight odd behaviour in Home Assistant

Hello everyone,

Not sure it’s right place to post or even if the yeelight team will be ok with it but I havn’t found an answer elsewhere so far.
My goal is to stop using the official app and control everything locally (which is, I assume, what the Lan Mode is for so it shouldn’t be a non regular usage)

I’m experiencing something really strange with a yeelight color bulb (newest ones).
I have set up two bulbs through yeelight app, they appear in the yeelight app and mi home. Then I integrated them in Home Assistant.
I removed them from both apps (I prefer them to be HA only). One of them works perfectly (let’s call it A) through HA only.
The other one (B) disconnects from my router within 2 minutes after removal from the app and of course, becomes un reachable from HA.

I’ve tried:

  • setting them up with static ip > A still works as it did, same behaviour for B, only get recognized in HA and connected when added in the yeelight/mi home app
  • removing the mi-home app and using only yeelight > no changes
  • resetting B multiples times
  • getting B it very close from my router
  • a different component structure in the conf.yaml just in case but both worked the same. (I suspect HA is not the problem though, since it disconnects from the router.

my config setup if it helps:

Résumé
discovery:
  ignore:
    - yeelight

light: 
  - platforme: yeelight
    devices:
      192.168.1.55:
        name: B
        transition: 1000
      192.168.1.56:
        name: A
        transition: 1000

And yes, I’ve enabled the Lan mode.

Any idea on why it works in one case and not the other? They are exacly the same bulb…

Thanks in advance.

when u remove B does it switch to provisioning mode (reset itself and create hotspot called yeelink-light-colorX_miapXXXX)?

@rezmus apologies for not replying earlier, I was expecting email notif but didn’t get it.
Good catch, yes it does reset itself. And I can add it back without resetting it.
I don’t want to try with the other in case it doesn’t work anymore x)

But you seem to have an idea on why it behaves that way?
In any case thanks for taking the time to answer!

this is normal behaviour of any xiaomi cloud device, when you delete it from mi home cloud sends miio.restore cmd to device which (if properly handled by firmware) should make it reset itself and switch to provisioning mode (same as manual reset).

ok but why it works for one and not the other? Bug on A?
What I prevent internet acces, it wouldn’t send the command and reset then no?

not sure tbh. these devices were not designed to work lan only. even if you remove it from your account, if it’s not reset and still connected to your router it does talk to the cloud (unless you firewall it somehow).

Yes that was my goal. I’m gonna firwall everything but my computers/phones.
I know some people are doing it but so I’m not sure what’s blocking me.

Thanks for your answers!