67 lines
8.0 KiB
JSON
67 lines
8.0 KiB
JSON
[
|
|
{
|
|
"id": "Tautulli Kill Stream - Paused Sessions After X Minutes",
|
|
"result": {
|
|
"structured": "TRIGGER: Every minute (time pattern on minutes). CONDITIONS: None. ACTIONS: Retrieve the list of sessions from tautulli stream count sensor [sensor.tautulli_stream_count]. For each session: If the session state is 'paused' AND the paused duration in seconds is greater than (pause_limit_minutes * 60) AND the session ID is not 'unknown', then call the service tautulli active streams service [tautulli_active_streams.kill_session_stream] with the session ID and a termination message.",
|
|
"natural_language": {
|
|
"trigger": "The automation runs every minute.",
|
|
"conditions": "There are no conditions.",
|
|
"action": "It checks all active Plex sessions reported by the tautulli stream count sensor [sensor.tautulli_stream_count]. For each session, if it is in a paused state, has been paused for longer than the configured number of minutes (default 10), and has a valid session ID, it terminates that session using the tautulli active streams service [tautulli_active_streams.kill_session_stream] with a message stating the reason."
|
|
},
|
|
"human_like": "Automatically ends any Plex stream that has been paused for too long, helping to free up resources.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "Tautulli Kill Streams - Limit All Users to One Session ( With User Exclusions)",
|
|
"result": {
|
|
"structured": "TRIGGER: When tautulli stream count sensor [sensor.tautulli_stream_count] state changes. CONDITIONS: The sensor's 'sessions' attribute exists, contains more than one session, and at least one non-excluded user (excluding 'admin' and 'plex_admin') has more than one active session after filtering out sessions with missing or empty 'user' or 'session_id' fields. ACTIONS: Create a persistent notification with title 'Duplicate Plex Sessions Detected' and a message listing the duplicate sessions. Then, call the tautulli active streams service [tautulli_active_streams.kill_session_stream] to terminate the newest duplicate session (based on 'start_time_raw'), with the termination message 'Admin Notified! Multiple sessions detected. Session Terminated.'.",
|
|
"natural_language": {
|
|
"trigger": "The automation triggers whenever the tautulli stream count sensor [sensor.tautulli_stream_count] updates its state.",
|
|
"conditions": "The automation checks if the sensor's data contains a list of active sessions. It proceeds only if there are more than one session, and if, after ignoring sessions with missing user names or session IDs, any user (who is not on the excluded list of 'admin' or 'plex_admin') appears to have more than one active session.",
|
|
"action": "First, it creates a detailed notification showing all the duplicate sessions that were found. Then, it identifies the most recently started duplicate session and uses the tautulli active streams service [tautulli_active_streams.kill_session_stream] to terminate that specific stream, sending a predefined termination message."
|
|
},
|
|
"human_like": "This automation enforces a 'one stream per user' rule for Plex by detecting when a non-excluded user has multiple active streams and automatically terminating the newest one, while sending a notification.",
|
|
"complexity": "high"
|
|
}
|
|
},
|
|
{
|
|
"id": "Tautulli Kill Duplicate Plex Streams (Username)",
|
|
"result": {
|
|
"structured": "TRIGGER: When tautulli stream count sensor [sensor.tautulli_stream_count] changes state. CONDITIONS: The sensor's 'sessions' attribute contains more than one session AND there exists at least one username that appears more than once across all sessions (case-insensitive comparison). ACTIONS: Create a persistent notification listing the duplicate session details (username, session ID, title, start time) AND kill the newest duplicate stream (the one with the highest 'start_time_raw' value) via the tautulli_active_streams service.",
|
|
"natural_language": {
|
|
"trigger": "Whenever the tautulli stream count sensor [sensor.tautulli_stream_count] updates its state.",
|
|
"conditions": "The automation checks if the sensor reports more than one active streaming session, and then looks through those sessions to find any usernames that appear more than once, ignoring case and empty usernames. It only proceeds if at least one duplicate username is found.",
|
|
"action": "First, it creates a detailed notification showing information for all the duplicate sessions it found. Then, it identifies the duplicate session that started most recently (has the highest 'start_time_raw' value) and uses the tautulli service to terminate that specific stream."
|
|
},
|
|
"human_like": "Automatically stops the newest duplicate Plex stream when the same user is watching from multiple devices at the same time, and sends a notification about it.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "Tautulli Kill Streams - Limit Fixed User - Kill All",
|
|
"result": {
|
|
"structured": "TRIGGER: When tautulli stream count sensor [sensor.tautulli_stream_count] changes state. CONDITIONS: The attribute 'sessions' of tautulli stream count sensor [sensor.tautulli_stream_count] contains at least one session where the username is defined and matches 'CHANGE_ME' (case-insensitive and trimmed). ACTIONS: Call service tautulli_active_streams.kill_user_stream with data: user = 'CHANGE_ME', message = 'Stream has been stopped by Admin. Contact for Support'.",
|
|
"natural_language": {
|
|
"trigger": "Whenever the tautulli stream count sensor [sensor.tautulli_stream_count] changes its state.",
|
|
"conditions": "The automation checks if the current streaming sessions list from the sensor contains any session belonging to a user named 'CHANGE_ME'.",
|
|
"action": "It calls a service to kill all active streams for the user 'CHANGE_ME', displaying a message that the stream was stopped by an administrator."
|
|
},
|
|
"human_like": "This automation stops all Plex streams for a specific user whenever the stream count changes, ensuring they cannot exceed their limit.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "Tautulli Kill Streams - Limit Fixed User - One Stream Only",
|
|
"result": {
|
|
"structured": "TRIGGER: When tautulli stream count sensor [sensor.tautulli_stream_count] changes state. CONDITIONS: A template condition evaluates to true. The condition checks if the 'sessions' attribute of tautulli stream count sensor [sensor.tautulli_stream_count] contains at least two sessions where the username is 'CHANGE_ME'. ACTIONS: First, create a persistent notification with a title and a message. The message lists details of all sessions for the user 'CHANGE_ME' if duplicates are found. Second, call the service tautulli_active_streams.kill_session_stream with a data payload. The session_id is determined by selecting the newest session (based on start_time_raw) from the matched sessions for user 'CHANGE_ME'. The service call includes a termination message.",
|
|
"natural_language": {
|
|
"trigger": "The automation triggers whenever the tautulli stream count sensor [sensor.tautulli_stream_count] updates its state.",
|
|
"conditions": "The automation only proceeds if a specific condition is met. It checks the data within the sensor's 'sessions' attribute. It looks for sessions where the username is exactly 'CHANGE_ME'. If it finds two or more such active sessions, the condition passes.",
|
|
"action": "When triggered and the condition is met, the automation performs two actions. First, it creates a persistent notification to alert that duplicate sessions were found for the user 'CHANGE_ME', including details like session IDs and titles. Second, it calls a service to terminate the newest active session for that user, sending an admin notice that the one-session limit was exceeded."
|
|
},
|
|
"human_like": "This automation enforces a one-stream limit for a specific Plex user by monitoring Tautulli and automatically terminating their newest session if more than one is detected.",
|
|
"complexity": "medium"
|
|
}
|
|
}
|
|
] |