The link Russ provided above was an attempt to find the URI for the actual video on a YouTube page. If that can be worked out it will work too.
The root problem here is a lack of understanding that a regular old Youtube URI is not a URI to the actual media, be it audio or video. That could be made more clear in the docs.
I just reread the binding docs and I don’t see anything there that is contradictory.
It seems pretty clear to me actually.
It tells you how to discover the Chromecasts on your network or how to add one manually.
It tells you the three types of Thing the binding supports.
It tells you each of the Channels the the Things support and what they are for.
It even provides some text examples for how one could configure it manually instead of through the UI.
Maybe if you ask some more specific questions we can answer them. Or perhaps your understanding on how Things, Channels, Links and Items work together, which is a generic openHAB thing documented elsewhere and doesn’t belong in the readme for a specific add-on.
Maybe another go at an explanation might work.
- Install the binding
- Go to Things and press the + button
- Choose Chromecast and start a scan
- Accept all the Thing for the discovered Chromecasts.
That’s all the setup that is involved. And all of that is covered in the main OH docs and a full description does not belong in the add-ons readme.
- Create Items and link them to the Channels you care about. You are all about playing a video so you care about first five Channels in the list on the README.
- To play a video, sendCommand a URI to some media. But it has to be a URI to the actual media, not a web page showing some media. If you right click and choose “save link as” you need to get the raw video or audio file. Not an html file or php file or some other web page.
- To control the media currently playing use the control Channel to send STOP/PLAY/PAUSE type commands.
And I completely disagree with your assertion that the example is the wrong one. It may not be your primary reason to use the Chromecast add-on, but I can assure you it is the primary use case most of us have for using the Chromecast add-on. And the “play a video” use case is so simple as to be all but worthless as an example.
rule "Play a video"
Item PlayVideo received command
That’s assuming myvideo.mp4 was placed in
/etc/openhab/html (i.e. $OH_CONF/html) and served up by openHAB itself.
As with any issue like this, filing an issue is a first step. But ultimately it won’t go very far unless and until you submit a PR to fix it too. Obviously those who wrote the add-on docs feel they are already adequate. I think they are adequate, though could definitely see a bit added about how the URI needs to point at the actual media, not a web page, and perhaps a list of supported media file formats too). So just saying “I don’t understand” isn’t going to go very far. If we knew how to do better we would have done so already.