%sunrise% value

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ichsan
New user
Posts: 4
Joined: 02 Sep 2018, 10:20

%sunrise% value

#1 Post by ichsan » 02 Sep 2018, 10:48

Hi, I want to use espeasy to control outdoor lights. I have set coordinates and timezone but the result of% sunrise% is incorrect while% sunset% is correct.

I use nodemcu v0.9 with ESP_Easy_mega-20180826_dev_ESP8266_4096.bin

Location coordinates -7.76,110.36 timezone offset 420 minutes

18680012: ACT : Time 15:35
18680023: ACT : Sunrise 1:55 <= should be 5.38 on September 2, 2018
18680034: ACT : Sunset 17:37 <= this is correct

nb. sorry for my bad english.

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: %sunrise% value

#2 Post by TD-er » 02 Sep 2018, 21:25

Hmm, You're on the southern hemisphere, so there may be something wrong in the used formula I guess.
I will look into it.
I added an issue for it: https://github.com/letscontrolit/ESPEasy/issues/1698

ichsan
New user
Posts: 4
Joined: 02 Sep 2018, 10:20

Re: %sunrise% value

#3 Post by ichsan » 04 Sep 2018, 01:23

Hi TD-er. The step I've been try is: 1. using previous (20180622) and latest firmware (20180903) -> problem still same. 2. Entering northern hemisphere coordinate 13.75,110.51, it's seem sunrise value incorrect too. 3. Erase flash using Expresif flash tool and flash with blank file, and reflash with latest firmware, problem still same.
I will try using another nodemcu and will report here.

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: %sunrise% value

#4 Post by TD-er » 04 Sep 2018, 10:13

I reproduced your issue, so I guess using another node will not make a difference.
There must be some bug in the algorithm used, but as I wrote last night on the issue, I simply don't see the bug.

ichsan
New user
Posts: 4
Joined: 02 Sep 2018, 10:20

Re: %sunrise% value

#5 Post by ichsan » 11 Sep 2018, 15:30

It looks like if we set longitude > 89 then the result of the calculation of the sunrise will be wrong. I have try to isolate the bug, but still not found.

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: %sunrise% value

#6 Post by TD-er » 11 Sep 2018, 21:48

ichsan wrote: 11 Sep 2018, 15:30 It looks like if we set longitude > 89 then the result of the calculation of the sunrise will be wrong. I have try to isolate the bug, but still not found.
Is it an option to not use the longitude for sunrise/sunset calculations and just compute the GMT location?
Then use the longitude to compute the offset in time? (15 degree per hour)

ichsan
New user
Posts: 4
Joined: 02 Sep 2018, 10:20

Re: %sunrise% value

#7 Post by ichsan » 12 Sep 2018, 01:34

Thank you TD-er, I use -7.8,0 (lat,long) and substract the result with 442 minute and get 1 minute offset from the correct sunrise and sunset ..

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: %sunrise% value

#8 Post by TD-er » 12 Sep 2018, 21:05

ichsan wrote: 12 Sep 2018, 01:34 Thank you TD-er, I use -7.8,0 (lat,long) and substract the result with 442 minute and get 1 minute offset from the correct sunrise and sunset ..
OK, great, it was just a thought, but apparently it works.
I will program something like that to fix the bug.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 16 guests