Skip to content
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

[BUG]: day/night confusion #948

Closed
rossisbudda opened this issue Sep 7, 2024 · 16 comments
Closed

[BUG]: day/night confusion #948

rossisbudda opened this issue Sep 7, 2024 · 16 comments

Comments

@rossisbudda
Copy link

rossisbudda commented Sep 7, 2024

Setup:

  • TerrariumPI version: 4.10.2
  • Install: manual
  • Raspberry PI: 3B+
  • OS: raspbian 12 bookworm

Describe the bug
Day switched to night at midnight, even though day was scheduled to switch to night after 18 hours 09:30:-06:30
To Reproduce / Installation steps
I think that setting a day set to >12 hours that spans midnight will yield unexpected relay times. In the screen grabs you can see that 09:30 to 06:30 is in fact 18 hours, yet at midnight a state alteration occurs although not prescribed.

Expected behavior
I would expect the lighting toggle to flip at the prescribed absolute time rather than using midnight as marker. There is no mention of midnight in my config.

image
I struggle to see why this relay toggled at midnight rather than 3.30am as requested.

Logfiles
terrariumpi.log

@rossisbudda rossisbudda changed the title [BUG]: day/night confusiojn [BUG]: day/night confusion Sep 7, 2024
@theyosh
Copy link
Owner

theyosh commented Sep 8, 2024

Sorry, but the issue has no information. Could you please put your question in the issue?

@rossisbudda
Copy link
Author

rossisbudda commented Sep 8, 2024 via email

@rossisbudda
Copy link
Author

rossisbudda commented Sep 8, 2024

I include the day/night period settings screen also.
Screenshot 2024-09-08 at 09 53 10
Screenshot 2024-09-08 at 09 53 10

@rossisbudda
Copy link
Author

sorry about the messy ticket, all the original post has been cleaned up now 🧽

@theyosh
Copy link
Owner

theyosh commented Sep 9, 2024

I am not sure if I understand your question.

But I guess you have this problem due you 30 minute restart action. That is probably causing some confusion in the timer calculation. So I advise to stop that.
This is not a smart way to detect broken Meross connection.

So disable the restarting of TerrariumPI and see if the lights behave correctly. If that is the case, the restarts are causing some strange side effects.

In order to detect a broken Meross connection, you can make a custom script which reads out a temperature sensor, and when it gets to cold, it will restart TerrariumPI. This is a smarter way of detecting a broken Meross connection.

@theyosh
Copy link
Owner

theyosh commented Sep 9, 2024

On the other hand, this is a nice test case. I think I fixed this issue in code. Do a git pull and restart TerrariumPI.

Keep the restarting crontab in place, and lets see what happens tonight. It should stay on after a restart just after 00:00.

Still, just restarting every 30 seconds is not the handiest way..

@theyosh
Copy link
Owner

theyosh commented Sep 12, 2024

Did you had time to test the latest code with your timer setting? I think the issue should be fixed. A specially with you 30 min crontab restart.

@rossisbudda
Copy link
Author

rossisbudda commented Sep 12, 2024 via email

@theyosh
Copy link
Owner

theyosh commented Sep 12, 2024

If you reinstall it, make some backups: https://theyosh.github.io/TerrariumPI/faq/which-files-to-backup/
And restore it like this: https://theyosh.github.io/TerrariumPI/faq/restoring-backup-files/

That should save some time setting it all up.

@rossisbudda
Copy link
Author

rossisbudda commented Sep 12, 2024 via email

@theyosh
Copy link
Owner

theyosh commented Sep 12, 2024

And you do not have to reset your SD card. Just move the existing TerrariumPI folder to a temporary name, and just start the TerrariumPI installation with the git pull.

You do not have to complete reinstall the OS. Just re-install TerrariumPI only. Saves a lot of time.

Will keep this issue open. No problem

@rossisbudda
Copy link
Author

rossisbudda commented Sep 13, 2024

I have done a manual backup, gitpull, reinstall (4.11.1), restored data and removed my bi hourly crontab. Will report back if the midnight glitch happens or not!

@theyosh
Copy link
Owner

theyosh commented Sep 13, 2024

Ok, but without the crontab, the bug will not happen. But that is OK. As long it is stable for you. That is the most important.

The bug will only happen when you restart TerrariumPI after 00:00 and before 03:00 hours. (in your case, and your timezone)

@rossisbudda
Copy link
Author

I will be watching, then try a manual restart after midnight to see if it can reproduce. You're the best!

@rossisbudda
Copy link
Author

rossisbudda commented Sep 15, 2024 via email

@theyosh
Copy link
Owner

theyosh commented Sep 15, 2024

Thanks for testing. And good to hear the bug is fixed!

@theyosh theyosh closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants