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.
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 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
This link seems to be broken now. I’m currently trying to work with VLC and hoping to find a list of supported functionality but running having limited success. Ooof, sorry, didn’t realize how long ago this post was posted.