Recently got a Sonos soundbar with no support for bluetooth or audio input other than HDMI. Wanted to be able to play music from my turntable to the soundbar, so I had to figure out an alternative way to do this.
Then I just needed to send this audio stream to Sonos. Thought that would be challenging, but it wasn’t at all. Figured out it’s possible to use the “Media player: Play media” action in HomeAssistant to play the turntable audio stream with the Sonos speaker as a target. Wanted to join in another speaker and set the default volume, so I made a script for that. See below:
So by starting the script above, it would use the audio stream as a source for the Sonos group. Perfect! But if I were to play music from Spotify or another source on the speakers, it would “break” the audio stream source. And I don’t want to manually start the script each time I play something on the turntable.
The tonearm moves automatically to the starting position when physically pressing “play” on the turntable. So this movement indicates it’s starting. But how to catch this as a sensor value? Maybe a door/window sensor? As a quick proof of concept I attached a door/window sensor from Aqara with some rubber bands and made an automation with this as a trigger. When the sensor value is “open”, it runs the script above.
Really good idea! Just one tip (in case you haven’t already thought about it), make sure to weigh the stylus again after attaching the sensor since it should mess up with the balance.
Thanks for sharing.
I just setup my own DarkIce/IceCast on a DietPi.
The url for streaming is working in a webbrowser, but I cannot add it to HA.
Have you added tunein to the Sonos app? I am trying it set it up without, i wonder if it is possible.
i get errors.
```[140135803137024] Error during service call to script.play_turntable_on_sonos_roam: Error calling SonosMediaPlayerEntity._play_media on media_player.sonos_roam: UPnP Error 714 received: Illegal MIME-Type from 192.168.200.XXX``
Just released turntable-mqtt-bridge — a lightweight bridge that automatically detects when your vinyl record player is spinning and switches your Sonos speaker to the turntable stream.
Built on a Raspberry Pi Zero with Darkice + Icecast for the audio stream, a Python script for RMS-based audio detection, MQTT for signaling, and a Home Assistant automation to handle the Sonos switching.
No physical sensor needed — it listens to the actual audio stream and reacts in seconds.