From such time to such time

Maïté

New member
FRANCAIS ------------------------------------------------------------------------------


Bonjour,
Je cherche à effectuer un test de l'heure, comprise entre 7h00 pm et 9h00 am.

J'ai une tablette qui s'allume automatiquement par le système à 9h00 am et qui s’éteint, aussi par le système à 7h00 pm.
Il est arrivé deux erreurs
1) La tablette ne s'arrête pas à 7h00 pm, j'ai réglé le problème avec Macrodroid -> Si il est 7h05 alors j'arrête la tablette

2) La tablette se rallume pendant la nuit et là la seule solution que j'ai trouvé est,
si l'heure est comprise entre 7h00 pm et 9h00 am alors Macrodroid arrête la tablette.
Je ne trouve pas la formule du test, pouvez-vous m'aider, SVP ? Merci

(Je ne comprend pas pourquoi la tablette se rallume toute seule pendant la nuit.)

J'ai une macro qui démarre avec Macrodroid, Je pourrai tester l'heure à ce moment là et en déduire que c'est un démarrage intempestif, du genre:

Variable NUIT (booléen)
NUIT={hour}>7 or {hour}<9
Si NUIT alors arrêt

Ou plus direct
Si {hour}>7 or {hour}<9
alors Arrêt
FinSi

Merci de me spécifier l'écriture exacte, je n'ai pas très bien capté malgré le tuto en anglais.



ENGLISH --------------------------------------------------------------------------------------------



Hello,
I am looking to test the time between 7:00 pm and 9:00 am.

I have a tablet that is automatically turned on by the system at 9:00 am and turned off, also by the system at 7:00 pm.
It happened two errors
1) The tablet does not shut down at 7:00 am, I fixed the problem with Macrodroid -> If it is 7:05 am then I shut down the tablet

2) The tablet turns on again during the night and there the only solution I found is,
if the time is between 7:00 pm and 9:00 am then Macrodroid stops the tablet.
I can't find the trigger formula, can you help me please? Thanks

I don't understand why the tablet turns itself back on during the night.

I have a macro that starts with Macrodroid, I could test the time at that moment and deduce that it is a false start, like:

Variable NIGHT (boolean)
NIGHT={hour}>7 or {hour}<9
If NIGHT then stop

Or more directly
If {hour}>7 or {hour}<9
then Stop
EndIf

Thank you for specifying the exact writing, I did not understand very well despite the tutorial in English.
 
Last edited:

Snurre

Well-known member
Im not quite shure what you mean, is the tablet shut down/powered off? Or?
MD can't run when the system is not running
And why it turns on during the night might be something in your system not MD
 

Maïté

New member
Indeed the tablet turns on by itself at night, this is quite rare, while the system turns off the tablet at 7:00 pm.
I do not understand where the problem comes from, but of course it comes from the system not from Macrodroid.
I will test this formula in the startup macro.
 

Attachments

  • Screenshot_2023-04-12-12-3623-28-389.jpg
    Screenshot_2023-04-12-12-3623-28-389.jpg
    34.1 KB · Views: 13

Endercraft

Moderator (& bug finder :D)
Indeed the tablet turns on by itself at night, this is quite rare, while the system turns off the tablet at 7:00 pm.
I do not understand where the problem comes from, but of course it comes from the system not from Macrodroid.
I will test this formula in the startup macro.
Do you have auto shutdown/boot enabled in your settings ?
 

Dm114

Well-known member
Indeed the tablet turns on by itself at night, this is quite rare, while the system turns off the tablet at 7:00 pm.
I do not understand where the problem comes from, but of course it comes from the system not from Macrodroid.
I will test this formula in the startup macro.
In your screenshot, is "19:10 - 07:50" the name of a boolean variable? Anyway the syntax of the If statement is not correct: there is no comparison (no operator).

Your trigger is correct. Then test If current time ranges betwen 19:10 AND 07:50
 

Maïté

New member
In your screenshot, is "19:10 - 07:50" the name of a boolean variable? Anyway the syntax of the If statement is not correct: there is no comparison (no operator).
19:10-07:50 is not a variable. When I add a condition, I go to DATE/TIME, Time of day, Start time 19:10, End time 7:50.

Your trigger is correct. Then test If current time ranges betwen 19:10 AND 07:50

Thanks,
 

Attachments

  • Screenshot_2023-04-12-14-19-06-906.jpeg
    Screenshot_2023-04-12-14-19-06-906.jpeg
    458.3 KB · Views: 9

Dm114

Well-known member
19:10-07:50 is not a variable. When I add a condition, I go to DATE/TIME, Time of day, Start time 19:10, End time 7:50.

Thanks,
I'm ashamed: I never had the opportunity to use this constraint in an If statement so I even didn't know it exists. Thanks for that 😀
 

Dm114

Well-known member
Anyway, there's something strange in your macro. You end the IF loop with "Extinction..." action. As I run an old Android version I don't have this action but I guess it is made to shutdown your tablet. If so, your last actions outside de loop won't be executed (or partially as long as MD is still alive)
 

Endercraft

Moderator (& bug finder :D)
Anyway, there's something strange in your macro. You end the IF loop with "Extinction..." action. As I run an old Android version I don't have this action but I guess it is made to shutdown your tablet. If so, your last actions outside de loop won't be executed (or partially as long as MD is still alive)
I'm pretty sure the alternative option is instant shutdown so you are right.
 

Dm114

Well-known member
I'm pretty sure the alternative option is instant shutdown so you are right.
For short/quick actions sometimes MD has time to execute some of them because shutdown process take a few seconds or ms before killing MD and other apps.
 
Top