# \[APP\]\[Pro\] Sun Events - Triggers you at certain positions of the sun

**URL:** <https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043>\
**Category:** Apps\
**Tags:** homey-pro\
**Created:** [October 23, 2022, 2:24pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043 "2022-10-23T14:24:16Z")\
**Posts on this page:** 20\
**Page:** 15

<div class="post-metadata">

**Author:** ![MarcelT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcelt/32/10042_2.png) [@MarcelT](https://community.homey.app/u/MarcelT)\
**Post date:** [April 22, 2025, 6:54am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/283 "2025-04-22T06:54:23Z")

</div>

Orr install the latest test version.

---

<div class="post-metadata">

**Author:** ![Skalmenar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skalmenar/32/130236_2.png) [@Skalmenar](https://community.homey.app/u/Skalmenar)\
**Post date:** [April 22, 2025, 2:12pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/284 "2025-04-22T14:12:56Z")

</div>

Hello, I already have the latest version 2.4.3.  
In the list all the events appear on the same date but it is updated every day.

Can’t you create flow with an event that starts today and ends tomorrow?

How do you control a light that turns on at sunset and turns off the day after sunrise?

Thank you

---

<div class="post-metadata">

**Author:** ![Henrik\_Johnsson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henrik_johnsson/32/13707_2.png) [@Henrik\_Johnsson](https://community.homey.app/u/Henrik_Johnsson)\
**Post date:** [April 22, 2025, 3:19pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/285 "2025-04-22T15:19:53Z")

</div>

> [@Skalmenar](#):
>
> Can’t you create flow with an event that starts today and ends tomorrow?

Events are instantaneous, and unless you use delays, so are flows more or less.  
Use two flows, one that runs at sunset and one that runs at sunrise.

---

<div class="post-metadata">

**Author:** ![Jeroen\_W](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_w/32/9803_2.png) [@Jeroen\_W](https://community.homey.app/u/Jeroen_W)\
**Post date:** [May 17, 2025, 11:23am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/286 "2025-05-17T11:23:04Z")

</div>

Is it possible to add a tag that sets the highest altitude point from the sun what it would be that day? With that tag i can calculate what the maximum lux would be from that day.

---

<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 17, 2025, 5:27pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/287 "2025-05-17T17:27:07Z")

</div>

You can create it, albeit the highest value from yesterday.  
If that’s precise enough:

I created a numeric var called [highest\_altitude\_yesterday] to store the value

 ![1000049040](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/b/8b357a2f75eadf70e1b81889bc2ced7402b75575.jpeg)

 ![1000049042](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/f/0f3674f94e0df68791902f073bbdfd1c2d51eac5.jpeg)

---

<div class="post-metadata">

**Author:** ![Jeroen\_W](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_w/32/9803_2.png) [@Jeroen\_W](https://community.homey.app/u/Jeroen_W)\
**Post date:** [May 17, 2025, 6:11pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/288 "2025-05-17T18:11:42Z")

</div>

Thanks that’s also something i can work with. I’ve been chatting the whole day with ChatGPT first it came up to import the SunCalc module into Homeyscript, but this wasn’t posible. The alternative is the code below. That is something i can work with.

Now i have the highest position from the sun at that day and with that i can calculate the highest lux from that day.

```auto
{{ round(110000 * sin(result* PI / 180)) }}

```

Somewhere between 100.000 and 120.000 should the highest possible lux outside. I took 110.000. Maybe someone can use this for them selfs 🙂

```auto
// Setting the latitude for your location
const latitude = latitude ;

// Determine current date and day number
const today = new Date();
const startOfYear = new Date(today.getFullYear(), 0, 0);
const diff = today - startOfYear;
const oneDay = 1000 * 60 * 60 * 24;
const dayOfYear = Math.floor(diff / oneDay);

// Calculate declination
const declination = 23.44 * Math.sin((2 * Math.PI / 365) * (dayOfYear - 81));

// Calculate maximum sun altitude
const maxSunAltitude = 90 - Math.abs(latitude - declination);

// Round result to two decimal places
const roundedAltitude = Math.round(maxSunAltitude * 100) / 100;

// Return only the numeric result
return roundedAltitude;

```

---

<div class="post-metadata">

**Author:** ![Jumpingtrees](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jumpingtrees/32/79538_2.png) [@Jumpingtrees](https://community.homey.app/u/Jumpingtrees)\
**Post date:** [June 7, 2025, 9:39am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/289 "2025-06-07T09:39:44Z")

</div>

Hello,

first of all, thanks for this great app. There seem to be some improvements and new features in the test version. I try to stick to stable versions wherever possible. Is there a timeline when the 2.x version of the app will be released as a stable version? I am still using the latest stable version 1.4.8.

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 5, 2025, 11:37am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/290 "2025-09-05T11:37:32Z")

</div>

I’ll test out the latest test version. As I was running the old stable version.  
As far as I can see from the thread, it might be stable enough.

You refer to the latest test version for a lot of solutions. Which is for good reason.

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 8, 2025, 5:04pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/291 "2025-09-08T17:04:32Z")

</div>

I can confirm that the latest test version works like a charm, on my Homey Pro (Early 2016).  
I had to adjust one script, as the circadian level is now in decimals/factor.

---

<div class="post-metadata">

**Author:** ![NeosS](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/neoss/32/138605_2.png) [@NeosS](https://community.homey.app/u/NeosS)\
**Post date:** [October 20, 2025, 11:42am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/292 "2025-10-20T11:42:24Z")

</div>

Any ide? i uninstall, reboot , install the latest verion Test, but not appear values any idea:

 ![Captura de pantalla 2025-10-20 a las 13.25.41](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/d/ed426441014787e358b51c3182b85a8a15d5253f.png)

---

<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:** [October 20, 2025, 2:19pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/293 "2025-10-20T14:19:49Z")

</div>

That’s normal for all (app) tags @ Pro 2023 and newer models.  
To discover the value, add the tag to a notification card and test run it.

---

<div class="post-metadata">

**Author:** ![Jumpingtrees](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jumpingtrees/32/79538_2.png) [@Jumpingtrees](https://community.homey.app/u/Jumpingtrees)\
**Post date:** [October 31, 2025, 4:44pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/294 "2025-10-31T16:44:10Z")

</div>

Hello,

it seems that the app is not properly evaluating the condition “It is between event and event”. As you can see after sunset, but before midnight the card evaluates to “false”. I would expect to return “true” like in the condition from the app Timey.

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

---

<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:** [October 31, 2025, 6:32pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/295 "2025-10-31T18:32:31Z")

</div>

Homey can have issues with time conditions which reach past midnight  
To rule that out, I invert the condition plus the events;  
With your SE card, it would change into:  
`and it's not between sunrise ends and sunset starts`

This returns true before midnight.

---

<div class="post-metadata">

**Author:** ![Jumpingtrees](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jumpingtrees/32/79538_2.png) [@Jumpingtrees](https://community.homey.app/u/Jumpingtrees)\
**Post date:** [November 2, 2025, 10:50am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/296 "2025-11-02T10:50:57Z")

</div>

Thank you for the hint that will fix my isse. 👍

Nevertheless, I would consider this a bug that should be fixed by Athom or the app developer. As you can see with the “Date & Time” standard flow conditions and the Timey app it’s possible. There should be a development guide that defines how a condition which reaches past midnight should behave. Otherwise it’s inconsistent to the user.

---

<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:** [November 2, 2025, 2:19pm UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/297 "2025-11-02T14:19:28Z")

</div>

(still running some tests)

---

<div class="post-metadata">

**Author:** ![Icube0815](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/icube0815/32/121095_2.png) [@Icube0815](https://community.homey.app/u/Icube0815)\
**Post date:** [November 16, 2025, 9:57am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/298 "2025-11-16T09:57:51Z")

</div>

Hi,

first of all thanks for this great app. But since the latest test versions 2.46 / 2.47 it’s not working anymore. All my flows using Sun Events trigger are not running any more. Could you please have a look and fix it.

Thanks.

Peter

---

<div class="post-metadata">

**Author:** ![MarcelT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcelt/32/10042_2.png) [@MarcelT](https://community.homey.app/u/MarcelT)\
**Post date:** [November 16, 2025, 10:17am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/299 "2025-11-16T10:17:54Z")

</div>

Yes, I will look into it. The strange thing is that I only updated the localisation. Could you maybe reboot homey? As I have no problem at my Homey. Please check if this is loaded correctly:

The times with in the several events:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/9/19a9c0d6a7c2ea4caf584733878586b9317726e2.png)

---

<div class="post-metadata">

**Author:** ![owuerker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/owuerker/32/39707_2.png) [@owuerker](https://community.homey.app/u/owuerker)\
**Post date:** [November 16, 2025, 11:24am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/300 "2025-11-16T11:24:32Z")

</div>

I have the same effect since the current update. The flows are not working anymore.  
Homey is rebooted. No times in the events

 ![Bildschirmfoto 2025-11-16 um 12.23.07](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/7/d7f403157dd010b1f3296dac9ff9f87694748e68.png)

---

<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:** [November 16, 2025, 11:37am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/301 "2025-11-16T11:37:49Z")

</div>

No problems with the event times:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/3/83264a5f0b4940a59945034069c671b39c2c7372.png)

(When… Flow Card)

Using also the new test version 2.4.7.

@owuerker, are you sure that you’re using the latest test version 2.4.7? If that were the case, then the events Moonrise and Moonset would already have to be translated into German, as they are for me.

---

<div class="post-metadata">

**Author:** ![owuerker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/owuerker/32/39707_2.png) [@owuerker](https://community.homey.app/u/owuerker)\
**Post date:** [November 16, 2025, 11:47am UTC](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043/302 "2025-11-16T11:47:42Z")

</div>

Yes I am using the latest version

 ![IMG_0502](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/2/f2c4641a0da5099476c126af0abef8cfc74676f2.jpeg)

Correction;-)  
I had the regular Version 2.4.7. Using test version 2.4.7 I have the time for the events, too

Will check if the events are now triggered.

[Previous page](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043.md?page=14)

[Next page](https://community.homey.app/t/app-pro-sun-events-triggers-you-at-certain-positions-of-the-sun/71043.md?page=16)
