# Power failure and all the lights are on when the power goes on

**URL:** <https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [May 22, 2021, 4:49am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655 "2021-05-22T04:49:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 22, 2021, 4:49am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/1 "2021-05-22T04:49:04Z")

</div>

When there are often power failures. My all lamps turn on when the power comes up again. Homey comes up a short while later. How can make one flow if case happend and daytime all light off?

---

<div class="post-metadata">

**Author:** ![Undertaker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/undertaker/32/53278_2.png) [@Undertaker](https://community.homey.app/u/Undertaker)\
**Post date:** [May 22, 2021, 5:55am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/2 "2021-05-22T05:55:51Z")

</div>

Include all lamps in a group.

[https://homey.app/f/R3YEiC](https://homey.app/f/R3YEiC)

The time delay because Homey started all apps.

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [May 22, 2021, 6:01am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/3 "2021-05-22T06:01:56Z")

</div>

I would do it like this way:

When…  
— Homey has started  
Then…  
— Start Flow No. 1 with delay of 120 s (more or less)  
— Start Flow No. 2 with delay of 125 s  
— Start Flow…

Flow No. 1  
When…  
— This Flow is started  
And…  
— The time is between 08:00 - 19:00 o’clock  
(Or between Sunrise and Sunset)  
— Light 1 is on  
Then…  
— Turn Light 1 off

And so on, and so on…

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 22, 2021, 9:24am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/4 "2021-05-22T09:24:39Z")

</div>

I got this flow for it.  
You have to enable “power user” at experimental settings.  
I just start my Away scene, if I’m away or sleeping.  
Just in case, I fire that flow again after 15mins.  
I also send a push and a email message, so I can check things myself if I don’t trust it 😅  
_One disadvantage_: It does this also when a normal restart is done, or after a restart from an update procedure 😉  
**EDIT** Thinking of it, I now have a confirmation push added 😉 Didn’t think of that before 😉

 ![homeyopnieuwgestart](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/7/a7024c3c358605a7082a693b0da49a94aeff4952.png)

 ![homeyuitvalofherstart](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/e/0ecb8d582b00eeb9c93e1ebcb6e10915aa6175f1.png)

Start Away scene if I’m away or sleeping:

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 22, 2021, 8:34pm UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/5 "2021-05-22T20:34:38Z")

</div>

Thanks all, I will try it…

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 23, 2021, 4:33am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/6 "2021-05-23T04:33:12Z")

</div>

what do you think of such a simple?

[https://homey.app/f/FgnwnC](https://homey.app/f/FgnwnC)

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [May 23, 2021, 7:55am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/7 "2021-05-23T07:55:23Z")

</div>

Its not only the lamps that “fail”, the status of your variables and virtual devices are also reset after a power failure.

So homey will still behave “weird”

For example I have a variable “its dark”. After power failure it always returns as true.  
Which result in weird behaviour after a power failure during daytime.

So also check if if you need to “repair” variables and virtual devices

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 23, 2021, 10:50am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/8 "2021-05-23T10:50:50Z")

</div>

yes thats true

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 23, 2021, 11:30am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/9 "2021-05-23T11:30:55Z")

</div>

and like this.?  
[https://homey.app/en-us/flow/5MW\_oC/](https://homey.app/en-us/flow/5MW_oC/)

[https://homey.app/en-us/flow/osj-oC/](https://homey.app/en-us/flow/osj-oC/)

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [May 23, 2021, 12:15pm UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/10 "2021-05-23T12:15:59Z")

</div>

To which post, to which information are you referring?

There will not be an ultimate solution. Finally, it’s up to you how you want to realize it.  
If you want to turn off all lamps at once no matter if you are at home or not.  
If you want to create separate flows for each lamp, where each flow checks if the lamp is on.

There are also lamps or switches which returns to their previous state after a power failure for example. So for everyone it will be a little bit different, also because of the used devices.

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 23, 2021, 7:47pm UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/11 "2021-05-23T19:47:32Z")

</div>

I just want to turn off all lights if power come back and time is betwen sunrise and sunset, no matter if I at home or not.

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [May 24, 2021, 4:44am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/12 "2021-05-24T04:44:15Z")

</div>

Yes, I have understood that. But how you want to realize your requirement, i.e. which flows you want to use for it, is up to you to decide.  
As you can see at the 3 examples of @Undertaker, @Peter_Kawa and me, there are different ways to realize your requirements. Probably all 3 solutions work and probably there will be more ways to solve your requirements.  
So if the flows you posted are ok for you, then use them. I think they will work also. I personally would separate the lights, but this is my personal opinion.

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [May 24, 2021, 10:56am UTC](https://community.homey.app/t/power-failure-and-all-the-lights-are-on-when-the-power-goes-on/47655/13 "2021-05-24T10:56:55Z")

</div>

[quote=“fantross, post:12, topic:47655”]

Hi I tested 3 examples and choice 1 best for me, I many times tested because I have 2 virtual device there was issue, (koogeek switch) that is only works HomeKit and have automataion VD and HomeKit. And now works all lights off when homey restarted… thanks guys
