rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.94k stars 562 forks source link

Maintain the last state of the bulb #122

Open SmartM-ui opened 4 years ago

SmartM-ui commented 4 years ago

Hello, I have always had the problem that when the electricity goes out, on its return, all the bulbs turn on and stay on.

Would it be possible to plan to keep the last state when the electricity returns?

I know some bulbs have this feauteres, but on mine this setting is not present.

@rospogrigio @postlund @ultratoto14 I trust you! :-)

postlund commented 4 years ago

Hmrmhm, that's a tricky one. On one hand I'm not sure this should really the the responsibility of this integration, but it's probably where it's easiest to implement. I will have to think about it a bit.

ultratoto14 commented 4 years ago

All my current bulbs restore their states (color, color_temp, brightness), i will check for the on/off status. But if it is the case, it may be very confusing as if we have a physical switch in conjunction to a restore state, we may think that the bulb is failing if always off and try to switch on/off multiple times with the physical switch. This is exactly the procedure to reset the bulb.

postlund commented 4 years ago

This would definitely have to be an opt-in feature if we were to add it.

SmartM-ui commented 4 years ago

@postlund @ultratoto14 Good Morning!

Hi Pierre, thanks for thinking about it! If integrated, LocalTuya would become smarter than the SmartLife App!

Hi ultrato14, my light bulbs are also able to maintain color, brightness and color temperature when the electricity returns. The problem is that if they are off, they turn on automatically when the electricity is restored. If you have a light bulb in a ceiling light, turn off the light bulb from Home Assistant, unplug it from the electrical socket and plug it back in, you will see that the light bulb comes on.

Thanks!