I have a few of those bulbs which I put in the rooms main lightsource.
I tried to setup a schedule with the one I have in the bathroom, but this only works when
the bulb is NOT disconnected from power during scheduled start time.
So I have an idea:
Since they are connected to the server anyway, you could implement this:
- A bulb is disconnected from power.
- The power is switched on by wall-switch.
- The bulb switches to the last power-state
- As soon as the bulb is connected to Wifi, it checks what time is it and
which state it should have at that time (for example: in between 22h-5h 3% orange (nightmode))
- Wall switch off - power off, but
- Wall switch on - remembers last state (3%) and checks again time on the server site
Is this possible?
Because it would be practical.
I guess not, Schedule timers are triggered from the cloud server, if your device is power off (disconnected with the cloud), the schedule command could not be sent successfully.
What is the purpose of your schedule? What do you want to achieve with it? Maybe you can solve the problem in an other way?
I think you want to do the following:
You want your light be dimmed in the night, brighter at daytime and you want to turn it on and off with the switch?
Do you have any other home automation parts from xiaomi or only yeelight bulbs?
With other automation parts, I would use a IR human body sensor, so the switch can be turned on all the time.
Without those hardware I think it is not as easy to build…
It is a bulb in my bathroom.
A wall switch is still the best option to switch a bulb on or off, so I am not changing that.
At night it would be nice if the bulb is way lower as during the day. And since it connects to the server anyway, it could check what state it should have right now while connecting.
I know there will be a delay, but still more handy than using Siri all the time to dim the light up/down (I am running Homebridge, so yes, Siri works for that).
I have other automation stuff, but I want my bulbs disconnected from power when I am not using them. Yeelight bulbs use quite a lot power while off and electricity is expensive in my country. Believe me - it sums up. I have 4 colors bulbs, 10 whites and 2 strips. Leaving them on power all time (even when off) would cost about 130 Euro per year. That is a lot of money for just have them keep connected to a server.
I am planning to build this myself. My Raspberry could check if a light connects to my network (MAC-ID scanning) and then immediately changes it’s value to the one it should have right now.
This is exactly what im trying to do too. I was wondering if you ever got around to writing a script that you could share?
Guys you are ovethinking this. These bulbs have some way they should be used and you want to invent completely different and way too complex logic… Just accept that the bulbs should be ON all the time. I don’t understand why would you want to switch them off??? Just forget about your regular switches and buy an Aqara switch to turn the bulb on/off.
I have movement sensor in my bathroom and toilet and also wireless switch and this works perfectly. If keeping them on all the time is too much money (and I think you have not calculated that amount correctly) then you should just use standard bulbs! why - they turn on the switch! And just get a dimmer. You don’t need smart bulbs. Are you turning off your TV as well? Ofcourse not. It is in standby all the time. So these bulbs are also in standby.
Just imagine - one classic bulb consumes 100W. So, I have 7 bulbs, 1 strip, 2 ceilings, and 1 switch. If each consumes 1.5W, that is like 11x1.5W that is 16.5W. Waaaaay less than one classic bulb! Not to mention your water heater, oven or refrigerator! Those are BIG spenders. You don’t turn off your refrigerator, do you?
so trying to impose your way too complex schemes on everyone is just plain silly.
I just posted a question with the same issue before finding this post and a few others like it. It is not complex or overthinking it to want to simply turn the darn thing on and off with an existing switch, and have it connect and pick up on the schedule to see what state it should be in. That would be simpler than adding wireless switches, and it’s not “inventing a new way” to use lights - they have worked that way for over a century! What’s so complex about the server checking the schedule and telling the bulb what state to be in when it first connects? This is a major oversight that is keeping quite a few people from using it the way they would like. Don’t tell us we’re wrong - FIX IT!