Visual indication of recording
Added by Paul Walsh almost 8 years ago
Complete newbie here, so apologies if this has been raised/suggested elsewhere.
Having had two PVRs die on me I decided to build my own using a Raspberry Pi 3 + LibreElec (I initially tried OpenElec but it would lock up if I tried to stop a recording) + TVHeadend + 2x PCTV292e USB tuners. I've managed to fit all the components (including 4-port powered USB hub and a 1Tb USB drive) into the case from the first PVR that died.
What I'd like to have is a red LED light up when a recording is taking place, so the idea would be to use the GPIO pins. This could be done in one of two ways:
- Have code added to TVHeadend (or Kodi/LibreElec) to turn the LED on/off, or
- Use something like SEC (https://simple-evcorr.github.io/) to monitor a log file and watch for messages indicating start/stop of recording
The second option should be easier to implement and wouldn't require any Pi-specific code change to TVH
Possible enhancements:
Rather than just use a red LED, an RGB LED could be used, and different colours used to denote recording in progress/success/failure
Have separate LEDs for each tuner (this would depend on whether log messages indicate which tuner is in use)?
Please note I'm thinking off the top of my head here - I need to check what's logged (and where). If I manage to get something set up I'll post the results
Paul
Replies (1)
RE: Visual indication of recording - Added by Kev S almost 8 years ago
You could use the HTTP API - http://127.0.0.1:9981/api/status/subscriptions gives you a JSON dump with all the active subscriptions and count those where profile != HTTP or HTTPS
Or alternativly http://127.0.0.1:9981/api/dvr/entry/grid_upcoming shows all upcoming recordings and thoses with "sched_status":"recording" are the recordings ones.
Trivial to parse in PHP, JSON, or Node.