-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I am not sure if there is an official way most people do this, but I think the best bet would be to use data directly from plex - https://python-plexapi.readthedocs.io/en/latest/modules/server.html#plexapi.server.PlexServer.sessions to loop through every so often and get a list of current sessions (currently playing media). Once that goes empty start a timer for shutdown. If a session starts again end the shutdown, you could even look at to see if something is "paused" and have a different shutdown time for paused vs nothing playing if you really wanted.