# Turn lights on when i get home

**URL:** <https://community.homey.app/t/turn-lights-on-when-i-get-home/11321>\
**Category:** Questions & Help\
**Created:** [April 2, 2019, 6:52pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321 "2019-04-02T18:52:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 6:52pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/1 "2019-04-02T18:52:46Z")

</div>

Hi. I cant find a solution. I want homey to turn on some of my lights if me or my girlfriend comes home but only if No one is home. And its after sunset.

Ive tried  
when: some one came Home.

And  
Its after sunset  
Nobody is home

Then  
Turn the lights on.

I guess its beacuse when someone comes home the status change to home and when the card nobody is home activate it wont work just beacuse someone is home.

I would like the card nobody is home to be placed under when but thats not an option

---

<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:** [April 2, 2019, 6:58pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/2 "2019-04-02T18:58:13Z")

</div>

> [@Andreas\_Kjork](#):
>
> I would like the card nobody is home to be placed under when

So u would like this as a trigger card?  
When would it trigger then?

And when u use WHEN someone came home AND nobody is home that would be confusing aye?  
Can u try without the “And nobody is home” card and see if that works?

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 7:12pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/3 "2019-04-02T19:12:26Z")

</div>

Okay. I can see that problem. But How should i do it.

Turn the lights on if its after sunset and Im the First one home. I Dont want the lights to turn on if someone is home.

In case i comes home at night and my girlfriend is asleep. I do not want the lights to turn on. But if shes not home then i want them to turn on

---

<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:** [April 2, 2019, 7:16pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/4 "2019-04-02T19:16:39Z")

</div>

Ur cards are in [the Smart presence app!](https://apps.athom.com/app/nl.terryhendrix.smartpresence)

![chrome_2019-04-02_21-16-00](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/bda36c922668158d5b329a947c36f660a0d76171.png)

---

<div class="post-metadata">

**Author:** ![Thijs\_Debets](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thijs_debets/32/4261_2.png) [@Thijs\_Debets](https://community.homey.app/u/Thijs_Debets)\
**Post date:** [April 2, 2019, 7:19pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/5 "2019-04-02T19:19:09Z")

</div>

I would create variable ’ someonehome’.

when: some one came Home.

And  
Its after sunset  
Someonehome == off

Then  
Turn the lights on.  
Set variable Someonehome = on

make sure to create flow to set Someonehome to Off when everybody left

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 7:29pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/6 "2019-04-02T19:29:00Z")

</div>

Im a noob and cant make it work. I have port forwarding on my router. I have the option to create DHCP but the gap betwen the ip Numbers must be at least 20

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/c/cf0f240f81faf0b70e946b2e46de2d3aa16b6788.png)

I have a tplink router

---

<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:** [April 2, 2019, 7:30pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/7 "2019-04-02T19:30:33Z")

</div>

U must be looking for DHCP reservations me guess.  
Like [here.](https://www.tp-link.com/us/support/faq/182/)

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 7:34pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/8 "2019-04-02T19:34:07Z")

</div>

Ive created static ip for my phones should that ip be between that 20 i have to choose.

For exempel. My iPhone is xxx.xxx.xx107  
Should i set the DHCP reservation to xxx.xxx.xx.100 - xxx.xxx.xx.120?

---

<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:** [April 2, 2019, 7:36pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/9 "2019-04-02T19:36:31Z")

</div>

No, just 107.  
So reservation for phone would be xxx.xxx.xx.107  
Added link in my above post.

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 7:57pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/10 "2019-04-02T19:57:15Z")

</div>

Thats not possible it have to be 20 between.

I can make a reservation for my phone so that get the same ip all the time. Is that enough? Its calles adressreservation on my router

---

<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:** [April 2, 2019, 7:57pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/11 "2019-04-02T19:57:57Z")

</div>

That will be correct!

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 2, 2019, 8:07pm UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/12 "2019-04-02T20:07:37Z")

</div>

Alright. I Will try that. Now my phone has the same ip all the time. With some of my Otter devices. Thanks.

Do you now How long i Will have to be disconected for it to activate? And i just downloaded it to my homey. Is there anything else i have to do?

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 3, 2019, 5:29am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/13 "2019-04-03T05:29:04Z")

</div>

It did not work. I Will try ifttt now.

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 3, 2019, 5:29am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/14 "2019-04-03T05:29:42Z")

</div>

How do you make that kind of variable?

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [April 3, 2019, 5:39am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/15 "2019-04-03T05:39:59Z")

</div>

So. I might figured it out.  
I Will use ifttt to mark me or my girlfriend home or away when connecting or disconecting from our router.

When

Someone came home.

And  
Its aftersunset  
A specific user is not home. (Me)  
Or  
Its after sunset  
A specific user is not home (girlfriend)

Then  
Turn lights on

So if someone of us comes home late and one of us isnt home, the light Will turn on?

---

<div class="post-metadata">

**Author:** ![Thijs\_Debets](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thijs_debets/32/4261_2.png) [@Thijs\_Debets](https://community.homey.app/u/Thijs_Debets)\
**Post date:** [April 3, 2019, 6:38am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/16 "2019-04-03T06:38:49Z")

</div>

![Screenshot_20190403-083539_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/f/f67ebc1418ca112a3b43cc2ebda67145efb03a44.jpeg)

 ![Screenshot_20190403-083609_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/d/de56429fe0070c6e9fd692a0b3603fdcadbedd67.jpeg)

 ![Screenshot_20190403-083745_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/b9554dec3a84781bf694183b077231bb948650a5.jpeg)

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [April 3, 2019, 6:53am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/17 "2019-04-03T06:53:26Z")

</div>

Which doesn’t work in 2.0 right?

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [April 3, 2019, 6:54am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/18 "2019-04-03T06:54:14Z")

</div>

Can’t you use the “asleep” function? Or a certain time frame only?

Vkr  
Victor

---

<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:** [April 3, 2019, 7:02am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/19 "2019-04-03T07:02:36Z")

</div>

I have learned that splitting up flows makes life much simpler.  
Yes you do get a lot of flows, but you can also re-use them.  
My action flows trigger (WHEN) with a card ‘when this flow is started”  
My trigger flows end (THEN) with a start this flow

1 create an action flow that sets your lights to the desired state  
2 create trigger flow that triggers when nobody is home (and triggers the flow above  
3 create a flow that diables the action flow when its ligt  
4 and another that enables the flow when its dark  
(This is were you can easily combine flow, one “its dark” flow enables a whole set of flows)  
5 and another that disables the action flow when somebody is home  
6 and one to enable…  
Yes, lots of flows, but less entanglements and easy to debug (use the papaertrails app)

---

<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:** [April 3, 2019, 11:53am UTC](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321/20 "2019-04-03T11:53:18Z")

</div>

Is working here.

[Next page](https://community.homey.app/t/turn-lights-on-when-i-get-home/11321.md?page=2)
