This is not the vlc component integration to play audio on the home assistant machine, but to trigger home assistant to play audio on a remote vlc player (home theater pc suuuround sound) to play siren or warning when an alarm is triggered.
I dont see anyone using the vlc_telnet platform for media player component so wanted to share for anyone else.
Before i found vlc_telnet i found THIS post with a custom component to control VLC via http. After hours of noobishly trying to get play_media service to work with a recent version of hass i almost gave up so I started browsing the gibhub built in components for ideas why the custom one wasn’t working and then I saw it, “vlc_telnet”.
there is actually a component page that shows how to use it that unfortunately failed to show up on my many google searches for home assistant vlc remote. This page has one fatal flaw. a typo for the platform name.
on the page it calls the platform “vlc-telnet” when in fact it should be “vlc_telnet”
First step is to configure VLC management interface to allow telnet. link on the component page for how to do so. basically enable it and add a passowrd.
Second, the sound files can be hosted anywhere. I choose to keep them on hass in the www folder but can also be local to the vlc player.
Add sound and config then reboot, you should see a new entity under media_player.
To test it you can use the services in dev tab.
service: media_player.play_media
entity: media_player.HTPCvlc
# here is JSON for service call:
{
"entity_id": "media_player.HTPCvlc",
"media_content_id": "http://HASSIO:8123/local/barkbark.mp3",
"media_content_type": "music"
}
special note: the vlc_telnet component only allows content_type music
Cool thanks! After I posted I did see the edit page link. I made the edit but didnt know what to do next, so i dont think my edit actually made it. Thanks for the pointers!
Regarding the special note about the vlc_telnet component only allowing media_content_type music - while that is true for the actual keyword, I discovered you that you can still send a url containing video for the media_content_id and the remote vlc displays it anyway. That allows me to pop-up a full screen live security camera feed on demand over the top of my dashboard (as well as play audio announcements). Not only that, but the latency for live cams is much less than HA’s HLS live stream method because it cuts out the ‘middleman’ (since vlc can display rtsp streams directly). The only downside I have come across is that the vlc_telnet component doesn’t reconnect if the dashboard running vlc is rebooted or goes to sleep - you have to restart HA side also Other than that - loving this component!
Yes I use the Google translate text-to-speech with vlc_telnet as a media player no problems - bearing in mind the normal requirement of any media player that the url given to the media player has to be reachable from the device/laptop running vlc, usually by setting base_url like in my example below. I also set the scan_interval to 3600 (1 hour) since it don’t really need HA polling vlc for status all the time:
I have vlc running continuously (and restarting automatically after reboot) by creating a file under /home/pi/.config/autostart/vlc.desktop with the following contents:
[Desktop Entry]
Type=Application
Name=VLC
Exec=cvlc --fullscreen -I telnet --telnet-password test
This also assumes you are booting the Pi to desktop rather than command line interface - sounds like you might be doing the latter, in which case the autostart method won’t work for you. I have never experienced the 1 second cutoff you describe, so no idea about that one!
Nice! I dont use TTS but it seem worked when i goofed around with it. I also been MIA for quite some time.
I have same problem if VLC is restarted (closed and reopen, or pc reboots) HA does not automatically connect and stops working. I dont recall the error but i would have to restart hass for it to reconnect to VLC.
I am switching VLC player from my main windows workstation to headless dedicated linux or pi. First getting windows 10 to autostart vlc is tricky, and i cant figure out a way to keep it running in the background. I was hoped getting away from windows would help but it sounds like it’s on the component side since your pi does the same. Im planning to dig into this annoyance very soon.
i also hate to lose surround sound on my main windows workstation so im researching a feature in Pulse Audio that can be like a virtual sound card, so multiple devices can use the speaker. Supposedly exists a windows/linux/mac pulse audio client that installs “virtual sound card” which pipes audio over network to pulse audio daemon, the system speakers are physically connected to. Like a virtual audio switch.
EDIT : oops i mis read your question about automation. im using nodred. sorry!
hope it help someone else then
not much in HASS side of things.
took me a while to figure out that:
HASS has to be restarted for it to connect to the VLC. so if you close VLC by mistake, then re-open it and then restart hass. If you dont then hass doesnt connect thats my biggest gripe.
the tricky part is setting up VLC properly so HASS can talk to it. il try to get you some relevant config tbh i kind of hacked my way through vlc, turning this on off blah blah. my vlc also keeps a console log open that i can only minimize.
vlc > tools > prefs >
interface > control interface > Main interface.
make TELNET is checked. (idk i have lua check too)
interface > control interface > Main interface > LUA.
in telnet section,
set host = PC IP (not Hass!)
set password (password in configuration.yaml)
set port (port in configuration.yaml. i recall having to do this, maybe i had port conflict)
Hah well, turns out I had it working correctly… but probably helps to have the VLC player audio on something other than 0%. Thanks for the quick rply @mattch
I am noticing a problem though, on initial trigger, the sound fades in from 0% to 100%. Example: “Front door” you can barely hear the word front, but door is at 100% volume. If you trigger again within about 5ish seconds it is full volume. Unsure if this is a linux mint issue or a VLC issue.
Did some quick research, look like it’s a VLC problem that it has a default behavior to “fade in”.
Think I figured a way around it, send a message with one space in it, VLC doesn’t make it audible, have a 1 second delay, and that kind of primes VLC and then i send the message I want to be sent and it’s played at full volume.
I dont think that android version of VLC Player has that option. you’ll probably be better off using windows or linux version of vlc. Just random thought if you have an old raspberry pi (w some flavor of linux) hanging out, install vlc on it with audio out to your audio device. hth
I want to be able to get ha to launch vlc on my android tablet wall panel, and then display an rtsp stream coming from one of my security cameras. Is this what you’ve done? Can you give me some pointers?
@Wingnut, that’s right, the telnet setup instructions above are only for VLC on Linux or Windows. I doubt you can use the vlc_telnet integration with Android tablets. You could try the Android TV integration instead: Android TV. That integration supports Android adb commands:
I verified this on a Fire TV Cube - just an idea since you are asking for pointers. I don’t have an Android tablet, and the instructions for putting those tablets into developer mode look tricky, so this may not pan out for you. By the way, here is how to stop VLC playing camera stream afterwards:
Thanks for your help.
Thought I’d give it a go but failed pretty quickly.
Re the Fire HD8 tablet - it is already in developer mode as I used Fire Toolbox on it. However I can only see an option to enable ADB over USB (which is how the Toolbox communicates).
I tried loading the Android TV Integration, at the Set Up stage it asked for Host, which I assume is the IP of the Fire tablet (Port I left at 5555). Anyway, it came back with Failed to connect!
Hi all, I’m facing a challenge with the VLC telnet integration.
TLDR; With HA+VLC integration running on a multi-homed (dual NIC) box, it seems the integration provides the wrong IP address for media on HA (for example TTS mp3 files)
Is there any way to tell the integration to bind to a specific NIC? I know it can be done on the VLC player but that part is working fine.
Background: My HA instance is running inside a Hyper-V VM on top of a windows host. Both the host and the VM have a an address on a 10.0.0.0/8 network. To facilitate comms between the host and other VM’s running in parallel with the HA, an extra internal 172.16/16 network has been set up, i.e. both the host and the VM are multihomed.
I installed VLC player on the host, having an audio-out, enabled and tested telnet, working fine during test
I configured the VLC integration to point to the host’s internal 172 address and it finds it just fine. However when I try to queue up any media to play, the VLC integration on HA tells the player the wrong (external 10.) IP address as part of the URL to open. VLC player in turn throws the error to confirm it:
[000002705a9015f0] main input error:
VLC is unable to open the MRL 'http://10.2.1.2:8123/api/tts_proxy/40f57afbcd33b67fd8254f666ed6af0d63b6d4f0_en_-_google_translate.mp3'.
Besides obviously using another non-dual homed player instead of the host box, any good ideas how to work around this?