Trying to create a stopwatch to track hours listened to vinyl records

I just replaced the stylus on my turntable. Recommendation is to replace the stylus every 500-1000 hours of listening; it occurred to me that I should be able to track cumulative listening time using Home Assistant.

Here’s a bit more about my setup, and my desired outcome – eager to hear if anyone has suggestions for how to accomplish this!

My turntable is connected to a Sonos Port, which is configured (via the Sonos app) to auto-play on my Sonos Arc soundbar. Whenever I drop the needle on a new album, the Port sends its audio feed to the Arc, and a few seconds later I hear the record on the surround setup in the family room.

Sonos is connected to my Home Assistant server. In the logbook, I don’t see any events from the Port that I’d expect to see (nothing related to a signal being detected on the line-in port, or that it’s started / stopped sending a signal to the Arc). The Arc does report in the logbook when it’s “playing”, but that can be true for audio from a TV signal, so it’s not granular enough to trigger when listening to vinyl but not TV.

What I want is a stopwatch that counts up when audio is coming from the turntable; it would let me track cumulative listening time on the turntable. Seems like this should be ~doable, but I haven’t figured out what information is obtainable from the Sonos API that would let me trigger a helper and increment the stopwatch or pause the stopwatch accordingly.

Anyone have thoughts about how I might achieve this? I might just put the turntable’s power supply on a smart plug, and use the smart plug’s on/off status as a proxy for when the turntable is on (and presumably sending audio). But if I can get a bit more precise w/info from Sonos, that seems like it’d be preferable.

Thanks in advance.

how do you “turn off” your system. do you only turn off the turntable and you leave the port on line in? or do you have some main “off” button? do you use home assistant to turn it off?

the reason i ask is because (i’m basing off sonos the sonos connect i have… i think the port works similarly but big caveat here…) if you have an “off” that causes the port to switch off of line-in. an you use the audio detect on line in to switch port back, then perhaps you can use the play state detecting the switch to and from line-in to do this.

if you need to leave port on line1 always, then i dunno… i don’t know of an event fired from port in that case and suspect your next best is indeed to use a power monitor, but you could potentially try listening to the event listener and see…

1 Like

The Port is always powered on and is a single-purpose device: when it hears data coming in via line-in, it sends it to the Arc.

My turntable has an external power supply; I push the power button to turn on the turntable, and once the needle touches the record, there’s an audio signal out of the pre-amp that causes the Port to send the audio signal to the Arc.

To “turn off” the system – for now, I just rely on the Port’s built-in settings, which when it stops receiving an audio signal, it stops sending to the Arc. The Arc registers this in the logbook as its play state = paused.

Your comment about using play state is interesting, but at least so far I don’t see any entities associated with the Port that surface that natively.

for me, my “off” for connect is playing a null mp3 file…

and the connect has a setting to switch to line in on audio detect… so I know when it has switched.

also how does your port vs your TV connect to your arc. I am not familiar with the arc, but I have a move… The attributes of the move tell me which source it’s playing from

TV → Arc is via HDMI; both the Port and Arc are connected via ethernet and send audio via SonosNet.

I’ll keep digging in, but I think the end result may just have to be a smart plug as the proxy for the turntable being on, and counting elapsed time while that plug is on.

i have a suspicion that is the best answer for now as well…

1 Like