Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API/Command to play most recent entry of list #293

Closed
TASSDevon opened this issue Jun 4, 2019 · 12 comments · Fixed by #294
Closed

API/Command to play most recent entry of list #293

TASSDevon opened this issue Jun 4, 2019 · 12 comments · Fixed by #294
Labels
enhancement New feature or request
Milestone

Comments

@TASSDevon
Copy link

I’d like it to play the latest News entry in the News category/directory list with a command, so I can instruct Home Assistant through its Kodi module to do this.

@dagwieers dagwieers added enhancement New feature or request question Further information is requested labels Jun 4, 2019
@dagwieers dagwieers added this to the Future milestone Jun 4, 2019
@mediaminister
Copy link
Collaborator

mediaminister commented Jun 4, 2019

I made a pull request that implements a function that plays the latest episode of a tv show.
You can call this function through the Kodi JSON-RPC API

For instance with curl:

curl -X POST -H "content-type:application/json" http://localhost:8080/jsonrpc -d '{"jsonrpc": "2.0", "method": "Player.Open", "params":{"item": {"file" : "plugin://plugin.video.vrt.nu/?action=playlatestepisode&tvshow=het-journaal" }}, "id" : "1"}'

You can call this method with every tv show on VRT NU.
You can find tv show names in the VRT NU urls.
For instance:

The tv show name is the part right after /a-z/, in this case de-columbus

I'm not familiar with Home Assistant but this should work with media_player.kodi_call_method

I would appreciate it if you let me know how you finally implemented this in Home Assistant.

@mediaminister mediaminister reopened this Jun 4, 2019
@dagwieers dagwieers removed the question Further information is requested label Jun 7, 2019
@TASSDevon
Copy link
Author

Works, thanks!

Here's the HA setup:

Screenshot 2019-06-08 at 15 06 02

@dagwieers
Copy link
Collaborator

Thanks for reporting back !

And thanks to @mediaminister for implementing it straight away ! :-)

@dagwieers
Copy link
Collaborator

dagwieers commented Jun 8, 2019

I renamed the Autostart wiki section to Automation and added the information from @mediaminister to that wiki page: https://github.com/pietje666/plugin.video.vrt.nu/wiki/Automation

Improvements and feedback welcome.

@dagwieers
Copy link
Collaborator

@mediaminister Should we add a VRTNWS Live TV channel playing the latest episode in a loop ? That would be quite like the VRTNWS radio channel which is a continuous loop as well, or it is actually more like the VRTNWS radio stream channel which always starts from the beginning, but always the latest episode.

I think we should add it.

@mediaminister
Copy link
Collaborator

mediaminister commented Jun 9, 2019

I don't see the added value of a "Het Journaal" loop, there are plenty of possibilities in the menus to watch the last episode of "Het Journaal".

But VRTNWS occasionally offers live events, breaking news, press conference reports or "Facebook Live" sessions on https://www.vrt.be/vrtnws/nl/
I think we should use a VRTNWS Live TV menu item in the first place for these events. Maybe you can open a new issue to further investigate and discuss this functionality.

@michaelarnauts
Copy link
Contributor

I agree, I don't see the added value of a looped VRT NWS playlist.

@dagwieers
Copy link
Collaborator

It's the same value as the VRTNWS radio stream, with the added value that you also get any news flashes or news updates automatically. This is something that is often done on trade rooms to get the latest information when events unroll. So I don't think it is useful for the normal viewer that watches the latest episode only once, but rather for kiosks, trade floors, or places people queue

@DCL777
Copy link

DCL777 commented Sep 29, 2019

Hallo,
I try to use this option but it's not working.
Home Assistant changed the kodi call method to: kodi.call_method see screenshot:

image

but this is not working at my setup. So, i tried the basic command:
curl -X POST -H "content-type:application/json" http://localhost:8080/jsonrpc -d '{"jsonrpc": "2.0", "method": "Player.Open", "params":{"item": {"file" : "plugin://plugin.video.vrt.nu/?action=playlatestepisode&tvshow=het-journaal" }}, "id" : "1"}'

But it's also not working. Kodi tried something (it's showing the same; some progress sign 3 or 4-times), but it's not playing.

Is something else changed? Can someone confirm that it still should work like that?

Thanks
Dries

@DCL777
Copy link

DCL777 commented Sep 29, 2019

This automation action reacts the same as the 2 methods above:
image

@mediaminister
Copy link
Collaborator

This API was changed in version 2.0:

curl -X POST -H "content-type:application/json" http://localhost:8080/jsonrpc -d '{"jsonrpc": "2.0", "method": "Player.Open", "params":{"item": {"file" : "plugin://plugin.video.vrt.nu/play/latest/het-journaal" }}, "id" : "1"}'

More info in the wiki: https://github.com/pietje666/plugin.video.vrt.nu/wiki/Automation#playing-the-latest-episode-of-a-tv-show

@DCL777
Copy link

DCL777 commented Sep 29, 2019

Yes, this is working.
Thanks a lot,
Dries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants