-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timer offset setting '-00:00' causes 12:00 hour offset #3923
Comments
Pls provide the information requested when you started this issue. At least the output of command |
Pls also show a situation where it fails. Background: a minus offset is always incremented by 720 minutes (12 hours). This is used to calculate the correct trigger time using the sunrise/sunset start times. |
Sorry but I am afraid I am not of the patient kind, rather choleric in technical things. Read my post. I wrote timer offset, that means offset (I tried out from sunset accidentally).
Yes, but '-00:00' sets offset to 720 and '00:00' to 0. And in your code is 720 the max. positive time. Don't you really see the problem? It's a simple input range error. Do not be afraid, it was a hard day and it's late and just fun! |
@gitMichael: "Pls don't wast my time with your bugs." Yikes! How to make friends and influence people ;-) |
@gitMichael |
I agree with @arendst and I don't think there is a way to create a real use case scenario for this to be considered a bug. |
And it still doesn't fail as far as I can see. Line 395 is not used by the webinterface. |
@gitMichael Line 395 isn't relevant to the bug you are experiencing. Perhaps if you want to debug read the code, make changes, and see if you can confirm it? ;) Unless of course, you're too busy to do that. |
Hi, I can confirm that if you set a timer for sunset and chose - 00:00 as offset it will trigger at sunset minus 12 hours. |
Using sunrise +00:00
Using sunrise -00:00
Settings.timer[i].data = 0xB87F8000 for + 00:00 Math says the difference of 0x2D0, or 720 and 720/60 = 12 hours This difference is already present in the t0 parameter passed by save settings so it must be on the javacript side and not in the handling code. To better understand how I got the output, see the Serial.print()'s I added
|
Thx for testing. I'll dive in to the java part. Can anyone verify that it works fine using the command line interface? |
Just did a test with an offset of -01:56 from sunset (=19:12) expected at 17:16 and that worked correctly:
|
Hi,
For an offset different than - 00:00 works perfect. The issue is only with
that parameters selection.
El dom., 30 de sept. de 2018 12:20, Theo Arends <notifications@github.com>
escribió:
… Just did a test with an offset of -01:56 from sunset (=19:12) expected at
17:16 and that worked correctly:
17:13:49 HTP: Configure Timer
17:14:31 HTP: Save configuration
17:14:31 MQT: Timers 1,0xD07F0344,0x18040406,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
17:14:31 HTP: Configuration
17:14:31 CFG: Saved to flash at F4, Count 386, Bytes 3584
timer1
17:14:43 CMD: timer1
17:14:43 SRC: Serial
17:14:43 RSL: Group 0, Index 1, Command TIMER, Data
17:14:43 MQT: stat/ring2/TIMER = {"Timer1":{"Arm":1,"Mode":2,"Time":"-01:56","Window":0,"Days":"1111111","Repeat":0,"Output":1,"Action":2}}
17:16:00 SRC: Timer
17:16:00 MQT: stat/ring2/POWER = {"POWER":"ON"}
17:16:00 MQT: stat/ring2/POWER = ON
17:16:01 CFG: Saved to flash at FB, Count 387, Bytes 3584
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3923 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ahw-hwtRZS0s3n-sOVg7hBXuk-3b8st9ks5ugOFDgaJpZM4W_NvP>
.
|
Right. So the solution is just to change the range check on line 197 from
to
|
Fix timer offset -00:00 causing 12:00 hour offset (#3923)
With that may be you get a 12:00 offset problem, I think. |
Neither is 00:00 or 00:02 or -00:05 and I don't see anyone disputing this. In embedded development one tends to use what is given to you to get the certain behaviour to work the way you want it. Time is not an exact science and embedded development certainly makes no exception to that. I can't help but wonder... 2 day old github account with a username starting with git ? Does the prefix mean anything to you? I think if you apply the same logic to the way a negative is used here it might just, by a small fractional possibility, make sense. Lastly, if you took some time to dig into the code you will note that line 395 in the web server code is not even executed when using a positive or negative time offset during configuration. Thanks for your bug report though ;) |
@gitMichael Tested your theory on a possible 12 hour offset. Sunrise for me tomorrow morning is 07:48, so I offset -11:45 which would cause a trigger at 20h03 for me in this case.
Worked as expected! |
Ok, final test for -00:00 I configured a separate NTP server to be at a time just before sunrise, 07:40 for sunrise 07:48 Output on serial from config:
And as expected, the timer ran at sunrise.
@arendst @ascillato2 I think we can close this one up. |
Please, try at sunset
El dom., 30 de sept. de 2018 16:10, andrethomas <notifications@github.com>
escribió:
… Ok, final test for -00:00
I configured a separate NTP server to be at a time just before sunrise,
07:40 for sunrise 07:48
[image: image]
<https://user-images.githubusercontent.com/470015/46261507-ca4e6600-c4f4-11e8-8ed7-7f27609b3020.png>
Output on serial from config:
07:42:22 HTP: Save configuration
07:42:22 MQT: Timers 1,0xB07F82D0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
07:42:22 HTP: Configuration
07:42:23 CFG: Saved to flash at 3F4, Count 8, Bytes 3584
And as expected, the timer ran at sunrise.
07:48:22 SRC: Timer
07:48:22 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
07:48:22 MQT: stat/sonoff/POWER = ON
07:48:22 CFG: Saved to flash at 3F5, Count 15, Bytes 3584
07:48:22 HTP: Configuration
07:51:39 HTP: Configure Timer
07:52:37 MQT: tele/sonoff/STATE = {"Time":"2018-09-30T07:52:37","Uptime":"0T00:05:16","V
@arendst <https://github.com/arendst> @ascillato2
<https://github.com/ascillato2> I think we can close this one up.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3923 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ahw-h47UFj3_5skdGu3dks8nIMUfoLPYks5ugRcLgaJpZM4W_NvP>
.
|
For posterity, I reset the NTP server back to 07h47 and performed a reboot on the sonoff - Observe output
|
@ascillato Ok, will try a sunset |
Sunset is 19h32, so configured this Output when setting is done
Now let me enable time travel on the NTP server to 19h31 and reboot the sonoff Output log:
@arendst @ascillato I must be really bored to be doing this ridiculous testing ;) |
Thank you very much for your patience. I can live with the -00:00 solution. |
Closing issue as now it is fixed. Thanks everyone for testing and searching to solve the problem. @gitMichael, thanks for the report, but please, next time try to be kind in order to let us focus only in the report and not in an incorrect way of talking to people. If you need something else, please find us in the Tasmota Discord Chat at: https://discord.gg/Ks2Kzd4 |
You can set timer offset to '-00:00' or '00:00' on webpage.
But one thing creates a 12:00 hours offset, the other the right 00:00 hours.
Reason: Pure sign interpretation in 'xdrv_09_timers.ino' line 395, I guess quickly looked...
The text was updated successfully, but these errors were encountered: