Author Topic: External interface to xScheduler?  (Read 3519 times)

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
External interface to xScheduler?
« on: December 11, 2017, 12:45:11 PM »
I'm still using LOR to schedule and run my shows this year.  I would like to move to xScheduler next year, but I use MIIP to allow my users to vote on the songs they want to hear next.  I have over 35 songs in my show and this allows some great interactivity.

I've tried working with the author of MIIP to modify his client to work with xScheduler, but to no avail.  I have a pretty good understanding of how it works and I'd like to modify it to interact with xScheduler so that the two would work together.  Unfortunately, I don't know what integration points are available in xScheduler.

MIIP works by changing the playlist right before the song ends.  The playlist only contains one song.  LOR's scheduler has a file system watcher on the playlist file and if it changes, it closes down the current show gracefully (waits till song is over) reloads the playlist for the next song and then plays that song.

Is there anyway to modify the playlist for xScheduler like this?

Thanks!
Paul

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: External interface to xScheduler?
« Reply #1 on: December 11, 2017, 12:51:41 PM »
The scheduler has a comprehensive api https://github.com/smeighan/xLights/blob/master/xSchedule/API%20Documentation.txt

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #2 on: December 12, 2017, 05:09:12 AM »
Excellent - thanks!
Paul

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #3 on: October 04, 2018, 06:15:47 AM »
Just getting back to this now. 

I looked at the API and I'm trying to figure out how to make the scheduler work with MIIP.  I know in one of your videos you were looking at a voting feature, but I'm not sure what happened to that.

The main reason for wanting to integrate with MIIP is because it has a great interface with lots of customization possibilities and I've ben using it for years so my viewers are aware of and use to the app.  Additionally, you have mentioned in several videos that the Web interface isn't hardened for exposure on the public internet.

The hard part about integrating them is that it doesn't appear that the API allows you to modify an existing playlist.  MIIP works by reordering the steps in a playlist when it works with LOR.  I don't see a way to do that in the API you have published.

I did have a thought and wanted to get your opinion on it.

If a playlist were to be created with all of the songs the user wanted to play as individual steps, MIIP could potentially call "Jump to specified step in current playlist at the end of current step <step name>" each time there was a re-order in the song list.  The downside is that this will potentially occur for every song in the schedule while it is scheduled.

One of he things that MIIP also does is it reorders the playlist so that if no one is voting, it plays the song that has been played the least first, so this would essentially mean that once one vote comes in, MIIP would be calling the above API for each song/step play.

Perhaps another way of doing this would be to have a separate playlist for each song and calling "Play specified playlist <playlist name>" for the MIIP specified song.  This would again mean that MIIP was running the show and using xScheduler like a slave to run the show.

Can "Play specified playlist <playlist name>" be used even when there is nothing scheduled to run?

Thoughts on either of these ideas, or info on your voting work?

Thanks!
Paul

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: External interface to xScheduler?
« Reply #4 on: October 04, 2018, 07:31:09 AM »
I don't know about Keith but I tend to get frustrated when a user only wants to interact with us when it comes close to crunch time and the developers are now starting to want time for our own shows.  Right now is when we want to quit thinking about enhancement, tackle any bug fixes, and work on our own shows.  Come back first quarter and be a regular participant.

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #5 on: October 04, 2018, 08:47:26 AM »
Sorry you're frustrated or if I have frustrated you.  I'm not looking for any enhancement.  Just an update and opinion on my approach.  I would expect this to have no impact on any of the code as it stands today or tomorrow.

If you have some time and can review what I'm asking about, great and thank you. 

Thanks!
Paul

Offline jnealand

  • Hero Member
  • *****
  • Posts: 1421
    • View Profile
Re: External interface to xScheduler?
« Reply #6 on: October 04, 2018, 08:59:55 AM »
Jim Nealand
Kennesaw, GA

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: External interface to xScheduler?
« Reply #7 on: October 04, 2018, 12:24:46 PM »
Bob told me 2 years ago he wanted to support xlights and then did nothing. I offered to help him get it working even adding APIs ... nothing.

I have even written a daemon which would do a lot of the control but I just don’t have the time or interest in building the website so again nothing.

I could reverse engineer his website but if he makes a change it all breaks and I am just not that interested in helping someone who won’t help himself 

My other option was someone to build an equivalent service and try to get it working but 3 people started and 3 people couldn’t stick it out to completion ... so again nothing.

Almost everything you could possibly need exists in the api already and what doesn’t I am happy to discuss adding. I know it exists because I have a proof of concept working.


Sent from my iPhone using Tapatalk

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #8 on: October 04, 2018, 01:13:04 PM »
You might want to read this. 
http://falconchristmas.com/forum/index.php/topic,7604.0.html

I saw it, but I'm not using FPP.

Thank you though!
Paul

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #9 on: October 04, 2018, 01:14:52 PM »
Almost everything you could possibly need exists in the api already and what doesn’t I am happy to discuss adding. I know it exists because I have a proof of concept working.

I'll start on my ideas and post here as I go along. 
Thanks for the update!
Paul

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #10 on: October 07, 2018, 03:46:08 PM »
I'm probably doing something wrong, but just trying this from a web browser (or code) doesn't work:

http://192.168.1.39/xScheduleCommand?Command-Stop

{"result":"failed","command":"","reference":"","message":"Unknown command."}

Advice?

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: External interface to xScheduler?
« Reply #11 on: October 07, 2018, 03:53:09 PM »
I agree with xschedule that is not a command it supports.


Sent from my iPhone using Tapatalk

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #12 on: October 07, 2018, 05:43:49 PM »
I must be reading something incorrectly then?

http://<host:port>/xScheduleCommand?Command-<command>&Parameters=<parameters>

   This API is used to trigger an action by the scheduler. Some are simple actions, but some are complex compound actions.
...
      Stop   
         Stops the currently playing playlist/schedule. If you have multiple active schedules then then next highest priority schedule will run.
=====
Wouldn't this result in    

http://host/xScheduleCommand?Command-Stop      

What am I doing incorrectly here?  I can't seem to see it.

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: External interface to xScheduler?
« Reply #13 on: October 07, 2018, 07:11:07 PM »
Ok so yes there was a type in the document now fixed. The - should be =


Sent from my iPhone using Tapatalk

Offline PKingRoch

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: External interface to xScheduler?
« Reply #14 on: October 08, 2018, 06:02:27 AM »
Thanks!  That was my problem!!!
Paul