It is ok to link something, but could you take a moment to add just a few lines to explain what your WTH is?
The WTH is that it is quite hard to do something as simple as that. That was my first use-case with Home Assistant and not a good start.
I donât want/need to launch another add-on (like VLC) that would consume resources, potentially hang and in general be an overkill for this kind of task.
On a wider context: in my case HA automations are used in a house inhabited by elderly people. As you can imagine, they are not that digital and are not into apps/dashboards/notifications. The way to go to inform them about something is a plain USB speaker (I donât want to replace batteries and/or have potential wireless transmission problems), playing back local sound files (potentially using TTS in the future).
Local playback is difficult to accomplish using something that would be associated with the web browser that the user is accessing home assistant with. While, for example, solutions like Browser Mod exist today, they require interactions with the page before you can target them as media players, due to limitations of how browsers accept auto-play of media.
If all you want is announcements, your best bet is to find a speaker that is powered by a squeeze-lite compatible media player. Those can be added to home assistant and then you can play back whatever you want to those speakers.
As someone just starting in HA, I have to agree that this is a huge WTH. Iâm finding lots of threads on this subject that do not offer solutions.
I am familiar with VLC on computers, so I can try that; however, local-vlc seems like the best bet, but it hasnât been updated in 4 years. Does it still work?
Iâm not following you. That doesnât seem relevant since weâre having trouble with the software complexity required to use a speaker simply and directly connected to the computer running HA, not a web browser accessing it.
If Iâm missing something, can you explain more?
I donât know what a âsqueeze-lite compatible media playerâ isâdo you mean LMS?
Itâs also WTH to have to find a new speaker when I have perfectly good speakers lying aroundâboth for a 3.5-mm headphone jack and USB. My NUC has a jack and open USB ports.
You know what would be kickass? Like, absolutely kickass?
If MA could cast via Bluetooth. A Bluetooth player provider!
That would enable MA to become THE Music Player of choice.
Iâm thinking it oughta be possible with an ESPHome device plus a custom component for it. Then MA can just speak ESPHome API over TCP/IP to it. No complicated and flaky Linux Bluetooth stack shit.
I just want to plug a speaker into the headphone jack and play TTS messages with a nice selection of local (stored on the HA system) voice fonts. Local means local.
If you have a USB speaker, I managed to figure that out:
It didnât work as well for one plugged into the hostâs headphone jack.
The headphone jack allows easy connection to a whole-house music amp or similiar equipment. A USB speaker would need to be hacked to get line level audio out. Maybe a USB external sound card?
No, I mean a USB speaker plugged into a USB port of the host computer.
I donât need a speaker plugged into the host computer. I need local line leval audio out of a headphone jack (or similiar alternative) that can be fed into other equipment such as a whole-house audio amp.
I am simply trying to be helpful and supply what I had figured out.
Thatâs why I started with, âIf you have a USB speakerâŠâ and noted that it didnât work as well for the headphone jack. It did, however work once, so you just might want to consider it.
Yes thanks for confirming that option works and I know I can modify a USB speaker to provide a line out so it is still a viable alternative. I just wanted to put it out there that a native line out solution would still be nice.
Same need as well. Audible door chime every time a door contact sensor opens when home.
And I mentioned that the line out worked at least once for me after linking to instructions that said the same thing! It could be that the only problem is with switching outputs.
works for me. VLC uses soundcard for output, i use it for TTS and as an player. my HA is running on some HP desktop, made for office use i guess. in addon configuration under audio output i have option for - Built-in Audio Analog Stereo.
Update: there is now an app / container to turn any paired Bluetooth speaker into an MA player that supports announcements.
The future is NAO.
@Rudd-O Wouldnât that be too much latency? Sometimes I AirPlay from my computer to another computer, the latter uses Airfoil and Airfoil Satellite to act as a central distribution point using AirPlay again to send the audio, including back to the source computer, as well as playing it out via its S/PDIF line out to the central receivers in the server room.
When it makes it back to my computer, I use an alternative audio out so I can keep local keyboard volume control of all speakers everywhere, when this is Bluetooth, itâs the only set of speakers that goes out of sync always, and rather fast too despite being half a meter away. With a hardwired audio output, such as this extremely old X-Fi[1] card I have for example, it works just fine.
Which takes me back to @pspot2, I feel you pain, man; sending audio though add-ons only adds points of failure; the initial part of the audio would get chopped off while encoding or whatever is negotiated/handshaken, or the player failes to load fast enough missing the sound altogether, even in fast systems set to never sleep.
As for the protocols, UPnP/DNLA is probably the most common but AFAIK itâs not meant for live streaming but rather file streaming (things with a set duration) âŠand itâs unreliable AF.
Have you considered coax? (expand)
The lack of reliability or lack of standardization of distributed audio protocols is what led me to coaxial cable (RG6). Why? Because itâs everywhere already. If you had sat or cable TV before you cord cut or whatever, you can use that. If you live in the US, probably your home was pre-wired with it. For the actual signaling you use S/PDIF, converters are very cheap; not that long ago I learned that the RCA orange âdigital coaxâ connector is for real coax cable, only soft and thin.
You could send it over cat6, the twists guard against interference but the signal still fades, if you use coax, however, the signal loss bounces on the mesh surrounding it back into the copper guide, for distribution you can just use a simple cheap RF splitter (although I believe many are filtered) or join the copper guides (and grounds) together yourself twisting them with pliers or soldering them, maybe [if itâs out of sight] build a free DIY Faraday cage around the connection joins; off the top of my head with a little bit of carton from your Amazon deliveries, hot glue, a glue stick and kitchen aluminum foil for extra peace of mind, and youâll get perfect sync on every speaker. You could even sandwich the foil in the carton wall with a another piece of carton so it stands up against abuse a bit better and it would protect the flimsy foil from tearsâMan, I should be writing this down elsewhere, Iâm gonna DYI me a trophy
.
Itâs worth the try and the installation is likely minimal. If successful, which Iâm sure you will be, youâre ready to make your very own condoms using plastic shopping bags from the supermarket[2]
You could also use fiber, but even multi-mode telecom fiber is too high quality for whatâs used with S/PDIF, so good luck finding a splicer for this. You would also be limited to six channels, but for distributed audio, typically you only need two. Another solution that works over coax is SDI, that lets you send full [clean] HDMI over coax with near zero latency. And since most of the amps people have available arenât discrete analogue channel input-based but rather HDMI-based on A/V receivers anyway⊠You can get clean HDMI from standard HDMI with a cheap in-line filter, BTW.
In my set up, HA happens to be where the servers are in the server roomâshocking, I knowâwhich is also where the central AirPlay distributor is (AKA an old headless Mac mini), where the A/V receivers are, and where the audio interfaces converting signals are. If I could just have a simple line out it would simplify things immensely but alas you have to jump through hoops to do basic things, Assistant and Music Assistant are useless without a reliable audio output.
Suggestion (not an answer/i.e. what I do)
I worked around the Text-to-Speech notifications writing shell scripts to send the message to the excellent TTS engine on old macOS using the say utility over SSH, e.g; ssh machost say -v samantha -r 220 "Temperature in the server room has risen over 29°. The AC controls appear to be unresponsive or have been forcibly overriden." â in macOS X, thatâs Siriâs original voice, -r is the speed in words per minute?âŠI think, sumân like that. In macOS â„11 the command has changed significantly.
Chimes, tones, etc can be played using the afplay utility, you donât send audio but only the instruction, so it works every time. You still need preferably an Intel Mac[3] though which sucks. Though theyâre probably cheap on eBay.
If Iâm not mistaken[4], the option -i of the ssh command lets you specify key locations.
SoâŠyeah WTF! WTH! Iâm with you.
Technically, a "Sound Blaster X-Fi 5.1" without extra names like several that followed. I really mean OLD. â©ïž
Just kidding. Please-please-please-please donât attempt this. Best case scenario youâre going to get a pretty nasty burn down there, or dumped, or somethingâI donât know!
âŠI mean
. â©ïžWhich wonât be receiving many updates if you let it online and therefore it will continue working without surprises. Beware with Apple Silicon Macs, those arenât yours everâyou need something dependable under your control for your home. â©ïž
I since then moved to do the same thing but through Indigo Proâs (installed on the same Mac) RESTful interface. â©ïž
Yes BT has latency. That kind of sucks. But a device is coming that will solve your problems, and only one day more for the announcement.