mmakaay / esphome-xiaomi_bslamp2

ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.
Other
218 stars 51 forks source link

Retaining state after turning power off and on #117

Open cracrama opened 1 year ago

cracrama commented 1 year ago

Hi From some time I'm experiencing weird behaviour and I can't pinpoint what is causing it. After some ESP/ HA? update device not longer remember it's state after turning power on. (complete power off and on)

Steps to reproduce the behaviour: Set brightness/ color, later disconnect device from power - later connect again Once device is on, and connected again, it returns to it's default state 100% brightness white mode, instead to it's previous state.

I'm using default config and applying

preferences:
  flash_write_interval: 1min

has no effect on lamp behaviour after power on.

Expected behavior Retaining state after on off power cycle.

Please advise Kind regards.

mmakaay commented 1 year ago

Sorry the late answer. I thought I had typed something about this, but apparently not. I have noticed the same behavior, so I think all lamps will show this behavior at this point. It is likely that things changed in ESPHome. Possibly this might be fixed by implementing #48 , but I will have to experiment on that.

cracrama commented 1 year ago

Many thanks for response. Will wait for new firmware then. Best regards.

cracrama commented 7 months ago

Hi Sorry I'm a bit newbie - Can you please explain how to impalement this below solution form issue no 48?

auto call = the_light.make_call(); call.from_light_color_values(id(global_var)); call.perform();

Please advise Best regards