project-management-only/home-tv-station#6: Write Play History into Timeseries database



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 03-Aug-24 16:03



Description

Although #4 introduced now_playing.txt, I can well believe that I might occasionally forget to check until after something's finished playing (and so the file's rotated).

I'd like to add the option to write a point into InfluxDB whenever we play something, that way there'll be a history which can be looked at



Toggle State Changes

Activity


assigned to @btasker

The image is now able to write playback history into InfluxDB whenever an episode starts (and ends).

This is off by default, but can be configured by setting the relevant environment variables, for example

-e INFLUXDB_URL="http://192.168.1.5:8086" \
-e INFLUXDB_BUCKET="mytv" \
-e INFLUXDB_TOKEN="aaaaffff=="

The writes use the v2 API by default.

It will still work for people who are still rocking 1.x - to authenticate with the compatability API (assuming auth is enabled) simply set the token using the format username:password.

The default measurement is tv_station however you can override this using env var INFLUXDB_MEASUREMENT.

verified

mentioned in commit github-mirror/Home-TV-Station@5de723d7a06842dad3d3d96fd933f99945afb23f

Commit: github-mirror/Home-TV-Station@5de723d7a06842dad3d3d96fd933f99945afb23f 
Author: B Tasker                            
                            
Date: 2024-08-03T17:22:54.000+01:00 

Message +17 -0 (17 lines changed)
verified

mentioned in commit github-mirror/Home-TV-Station@c2a1dc71263f86060aa2111702e6ee4037ff00aa

Commit: github-mirror/Home-TV-Station@c2a1dc71263f86060aa2111702e6ee4037ff00aa 
Author: B Tasker                            
                            
Date: 2024-08-03T17:18:06.000+01:00 

Message

feat: write history of play start/stop to InfluxDB (project-management-only/home-tv-station#6)

+37 -0 (37 lines changed)