# What to do in case of a power failure and all the lights are on when the power goes on

**URL:** <https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626>\
**Category:** Questions & Help\
**Created:** [September 13, 2018, 1:48pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626 "2018-09-13T13:48:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hansie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hansie/32/803_2.png) [@Hansie](https://community.homey.app/u/Hansie)\
**Post date:** [September 13, 2018, 1:48pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/1 "2018-09-13T13:48:27Z")

</div>

Where I live (Spain) there are often (short) power failures. My Ikea lamps turn on when the power comes up again. Homey comes up a short while later (it was shut down because of the same power failure). How can I put them in the state when the failure had occured?

---

<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:** [September 13, 2018, 6:23pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/2 "2018-09-13T18:23:59Z")

</div>

Check out the candy app.  
It can detect when homey restarts, you can use that to trigger a flow to set a scene.

---

<div class="post-metadata">

**Author:** ![0burner0](https://avatars.discourse-cdn.com/v4/letter/0/90ced4/32.png) [@0burner0](https://community.homey.app/u/0burner0)\
**Post date:** [September 13, 2018, 9:49pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/3 "2018-09-13T21:49:45Z")

</div>

To save the state is hard en takes a lot of flows.

Like Fkey says use the candy app combined whit is some one home en if time is between.

---

<div class="post-metadata">

**Author:** ![Robin\_van\_Kekem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_van_kekem/32/8187_2.png) [@Robin\_van\_Kekem](https://community.homey.app/u/Robin_van_Kekem)\
**Post date:** [September 14, 2018, 9:45am UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/4 "2018-09-14T09:45:33Z")

</div>

I don’t know how long the power outages are but you’d might want to have a look at an UPS and/or battery to keep Homey running.  
Homey might crash if it looses power unexpectedly.  
Altough this might go seriously wrong sometime…

---

<div class="post-metadata">

**Author:** ![Hansie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hansie/32/803_2.png) [@Hansie](https://community.homey.app/u/Hansie)\
**Post date:** [September 14, 2018, 1:33pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/5 "2018-09-14T13:33:48Z")

</div>

I installed the Candy app, but I can’t get the API Token. When I click to get it, it opens a browser window for Login Homey. This says that Browsers are not supported. Any Idea?

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [September 14, 2018, 1:45pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/6 "2018-09-14T13:45:10Z")

</div>

Deny the warning, ur token is in the page after u logged in

---

<div class="post-metadata">

**Author:** ![Hansie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hansie/32/803_2.png) [@Hansie](https://community.homey.app/u/Hansie)\
**Post date:** [September 14, 2018, 2:44pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/7 "2018-09-14T14:44:31Z")

</div>

I did what you suggested, so I logged in. But then? I have no idea where to look for the token.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [September 14, 2018, 3:06pm UTC](https://community.homey.app/t/what-to-do-in-case-of-a-power-failure-and-all-the-lights-are-on-when-the-power-goes-on/1626/8 "2018-09-14T15:06:31Z")

</div>

You can find that on the old Forum 😉

> **[Api for Candy](https://forum.athom.com/discussion/comment/69478/#Comment_69478)**
>
> Trying to get my API voor the candy app. Must be doing something wrong. It keeps saying unauthorized.
