- Posts: 248
- Thank you received: 33
Does myServer know when an App is launched?
- bowlingbeeg
- Offline
- User
-
Less
More
2 years 22 hours ago #3070
by bowlingbeeg
Replied by bowlingbeeg on topic Does myServer know when an App is launched?
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 to join the conversation.
- andrew
- Offline
- User
-
Less
More
- Posts: 339
- Thank you received: 28
2 years 15 hours ago #3071
by andrew
Andrew
Replied by andrew on topic Does myServer know when an App is launched?
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.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.
Andrew
Please Log in to join the conversation.
- davep
- Offline
- Admin
-
Less
More
- Posts: 367
- Thank you received: 96
1 year 11 months ago #3128
by davep
Replied by davep on topic Does myServer know when an App is launched?
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!
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 to join the conversation.
Time to create page: 0.168 seconds