Media Playing State for Tasker

by Christina N

Version 2 (September 23, 2024)

Download (12 downloads)

This is a media playing state for Tasker, but can be done with any true/false check that Automate can do that Tasker doesn't have available as a profile context (Tasker can check media playing within a task, and set a global variable, but the problem is triggering the task when needed, so that media playing itself can be used as a trigger, and with an exit task when the media playing stops).

Write true/false to a text file for Tasker to read into a global variable when the text file is modified. Use the global variable as a variable value state context in a profile.

On the Tasker side, in addition to the profile you want the state context in, you need two profiles:

1) File modified event -> read file to global variable

2) monitor start -> send two intents with the flow URI in the Data field

com.llamalab.automate.intent.action.STOP_FLOW

com.llamalab.automate.intent.action.START_FLOW

(The stop flow URI must end in "flows/X" and not include "/statements/y" or else it will not work)


Here is the taskernet share for a simple example using this (do not disturb when media is playing):

https://taskernet.com/shares/?user=AS35m8mkTVJpNLOy42%2F809L2nYdzZbUTIfROVoyV0fdHLpAbGmqgu2WaxPSpxnbmueqX&id=Project%3AMedia+Playing+State+Using+Automate+Flow

And here is the reddit post:
https://www.reddit.com/r/tasker/comments/1fn7iho/project_shareguide_how_to_create_additional/