Does myServer know when an App is launched?

bowlingbeeg's Avatar
User User
  • Posts: 248
  • Thanks: 33

Re: Does myServer know when an App is launched?

2 years 1 month ago
#3070
You can have automations run every second if you want. I have my lumagen status run every 30 seconds. My automation fires when {{current_uptimesecs}} > {{my_lumagen_status_check_time}}. It then calls a macro which does the status call and does Math|Add~my_lumagen_status_check_time~ {{current_uptimesecs}}~30. That will cause the automation to fire 30 seconds from now.
The following user(s) said Thank You: andrew

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 341
  • Thanks: 28

Re: Does myServer know when an App is launched?

2 years 1 month ago
#3071
You can have automations run every second if you want. I have my lumagen status run every 30 seconds. My automation fires when {{current_uptimesecs}} > {{my_lumagen_status_check_time}}. It then calls a macro which does the status call and does Math|Add~my_lumagen_status_check_time~ {{current_uptimesecs}}~30. That will cause the automation to fire 30 seconds from now.
Ah that's clever - I was just looking at the scheduling options. I might get rid of my Linux cron job now to keep it all inside myServer. Thanks.

Andrew

Please Log in or Create an account to join the conversation.

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: Does myServer know when an App is launched?

2 years 3 weeks ago
#3128
The Android driver does know what app is running. It was just not being exposed as a server variable. With the current driver you will see two new variables {{av_<id>_active_app}} and {{av_<id>_active_launcher}}

You can trigger automations to run every second if needed. Here's every 30 seconds

WHEN: {{current_second}} changes value

Switch|{{current_second}}##0##DO SOMETHING##30##DOSOMETHING


Or using if statements

WHEN: {{current_second}} changes value

Macro|
If|IsEQ##{{current_second}}##0##DO SOMETHING!
If|IsEQ##{{current_second}}##30##DO SOMETHING!


 
The following user(s) said Thank You: andrew

Please Log in or Create an account to join the conversation.

Time to create page: 0.592 seconds