# Create an action one hour before sunset

**URL:** https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594
**Category:** Questions & Help
**Created:** [September 12, 2018, 7:09pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594 "2018-09-12T19:09:00Z")
**Posts on this page:** 16
**Page:** 2

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 28, 2020, 12:54pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/21 "2020-01-28T12:54:01Z")

</div>

problem is in AND condition  
Wnen PIR detect alarm (motion)

then switch LIGHT ON.,. thats all…  
if i do TEST (when doesnt work) i got RED CROS in both SUN condition… ☹

---

<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: [January 28, 2020, 1:09pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/22 "2020-01-28T13:09:30Z")

</div>

Okay, I get it.  
The solar events “It is …” is a **point** in time!

You have to use the solar event “It is between”.

Sorry, German only:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/e/9e580162ad56775552b507970b2f392e35d120ef.jpeg)

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 28, 2020, 1:24pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/23 "2020-01-28T13:24:44Z")

</div>

i test between as firts…, but same bad result ☹

---

<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: [January 28, 2020, 1:41pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/24 "2020-01-28T13:41:24Z")

</div>

You have to use “It is between”.  
When do you want the lights on?  
Between sunset and sunrise (at night)?  
Or between sunrise and sunset (during the day)?

If the light should turn on at night, then the flow cannot work at the moment because the AND condition “It is between sunset and sunrise” is not given.

So again my request to show the complete flow.

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 28, 2020, 1:44pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/25 "2020-01-28T13:44:16Z")

</div>

![Screenshot_20200128-144338_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/6/e62b9a8d2f274768d8e2be16a6b84b0e929d67f2.jpeg) ![Screenshot_20200128-133806_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/b/bbfc93c45ff9470acf3535cd81d54309e5b2fab2.jpeg) ![Screenshot_20200128-144328_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/4/64b6515b6bcc4250160a22250755acc1667013cb.jpeg)

---

<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: [January 28, 2020, 1:51pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/26 "2020-01-28T13:51:22Z")

</div>

You are still using the wrong AND conditions.  
With these conditions the flow is only triggered:

- when the motion sensor is activated **and it’s exactly 60 minutes before sunrise**  
or rather
- when the motion sensor is activated **and it is exactly 60 minutes before sunset**

Nothing in between!

Edit: You have to choose a **time period** , not a time point!

---

<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: [January 28, 2020, 1:56pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/27 "2020-01-28T13:56:00Z")

</div>

By the way, the timer will not work this way either.

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 28, 2020, 2:04pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/28 "2020-01-28T14:04:47Z")

</div>

so what are the right conditions? pls

---

<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: [January 28, 2020, 2:05pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/29 "2020-01-28T14:05:44Z")

</div>

When do you want the lights on?  
Between sunset and sunrise (at night)?  
Or between sunrise and sunset (during the day)?

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 28, 2020, 2:24pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/30 "2020-01-28T14:24:00Z")

</div>

night (hour before and hour after)

---

<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: [January 28, 2020, 2:35pm UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/31 "2020-01-28T14:35:45Z")

</div>

![02F5C468-E93E-4B13-A837-4C1B86847BD1_1_201_a](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/1/3152df8ec632588e9ebc05d5e510a72a8bd302d3.jpeg)

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 29, 2020, 8:47am UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/32 "2020-01-29T08:47:03Z")

</div>

i think that i test this settings (and no work), but i test today repeatly. Thx

---

<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: [January 29, 2020, 9:14am UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/33 "2020-01-29T09:14:47Z")

</div>

What’s not working?

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 30, 2020, 5:42am UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/34 "2020-01-30T05:42:46Z")

</div>

Still same. No work

 ![Screenshot_20200129-190702_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/7/4705d9011b9719a98379c358aeb28f2f08273bb1.jpeg)

---

<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: [January 30, 2020, 6:56am UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/35 "2020-01-30T06:56:14Z")

</div>

Okay, I’m getting the same error message.

The App Sun Events app seems to refer to the same day with sunset and sunrise, so not at day change. So you have to think the other way around.

It is **NOT** between  
Sunrise +60  
and  
Sunset -60

Please do not forget to activate the “Invert” button (see screenshot)!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/b/7b7d5363e4d07a1a64dc99eb2d524a5fee406fe4.jpeg)

This eliminates the time between sunrise and sunset.  
I tried it myself this morning and it worked. But you’d better try it again tonight after sunset.  
I hope it works now!

---

<div class="post-metadata">

### Author: ![Magic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magic/32/12395_2.png) [@Magic](https://community.homey.app/u/Magic)
#### Post date: [January 30, 2020, 6:58am UTC](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594/36 "2020-01-30T06:58:30Z")

</div>

ok, interesting idea 😃 i test it today. Thx

[Previous page](https://community.homey.app/t/create-an-action-one-hour-before-sunset/1594.md?page=1)
