VLC player

I would like to be able to remote start/stop VLC Player from HomeAssistant interface. Most advises on the web tell how to start/pause or start something and play it to till end. I find out the commands to START and STOP the VLC Player, may be they could be useful for somebody else too:

switch 1: platform: command_switch switches: VLC: oncmd: "cvlc 1.mp3 vlc://quit &" offcmd: "pkill vlc"
Of course you have to replace the item to play, in this example it is 1.mp3 and the switch number according to your configuration.

1 Like

Thanks, I already try this but it does not work for me: the interface shows only the blue circle and do nothing. VLC works fine, it is installed on the same Pi.

how did you add vlc to ha ?

With the command line method Mihai use or with the official component?

I am trying to use the official component.
With command line from terminal it works with and without interface from the normal user:

vlc http://188.26.103.151:8090/
cvlc http://188.26.103.151:8090/

But from the homeassistant user it doesn’t start the interface and with cvlc it seems to work but no audio.

How to stop the playback? Trying out
media_stop
turn_off
With no success. Everytime see the following in the logs. So which ones are implemented?!

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1054, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 364, in async_service_handler
    yield from getattr(player, method['method'])(**params)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 596, in media_stop
    raise NotImplementedError()
NotImplementedError

Supported functionality is listed here https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/media_player/vlc.py#L25

1 Like

Thank you for such a short but most fulfilling answer