• 1
  • 19
  • 20
  • 21
  • 22(current)
  • 23
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
(2015-12-03, 11:34)JANGER Wrote: Great news! Thank you.

I use your scripts to send http messages which control the lights in my cinema. Depending on the content and event type, I change color brightness or the speed of dimming. (When the movie starts all lights are dimming smoothly for few seconds)

One more dream:
I would like to play THX trailer video prior to each movie starts.
I hate Cinema Experience (it does not work with all skins, and not start automatically).
I hate CinemaVision even more, it has too many feature.
We need just the one: play selected video prior to the movie start event.

Have you any idea?

Psst... if you need help setting up CinemaVision, all you have to do is ask! Wink It will literally take one minute to set up what you want to do in CinemaVision.
Image
Create a Movie Theater Experience at Home
Trivia Slides, Video Bumpers, Ratings Bumpers, Audio Format Bumpers and more...

CinemaVision | CinemaVision Launcher | CinemaVision Service | CinemaVision Content
Reply
Ok :-) Help me (I've written my request in your thread)
... and I will stop say "hate" your add-on.
I appreciate CinemaVision.
But it is so huge to use in small Raspberry Pi (Zero)

(2015-12-05, 01:14)CinemaVision-Scott Wrote: Psst... if you need help setting up CinemaVision, all you have to do is ask! Wink It will literally take one minute to set up what you want to do in CinemaVision.
Reply
Hey guys, im using this addon in a very simple way and its been working wonderfully... however I've run into a small snag.

On boot & on stop of video i run this script (play.sh):
Code:
#!/bin/bash
kodi-send -a "PlayMedia(my_mp3_file.mp3)";

The idea is the mp3 provides a little ambient background music while navigating through the menus or when its just sitting idle. (the actual script is a little more involved in randomly picking an mp3 from a local directory)

when the mp3 is done a "stop" is detected and the script runs again and keeps playing (i think this is where my problem is coming from)... after a while i get the following error:
Code:
OSError: [Errno 12] Cannot allocate memory
and thats the end, my loop stops running because there is no longer an "end/stop" to trigger the script being run again.

the odd part is i can play a normal movie/tv show... its just my script that fails out until i reboot. Ive googled around and my error points to swap file issues? but im not able to figure out how that applies?

Any pointers? thanks?
Reply
(2015-12-09, 06:53)apeg Wrote: Hey guys, im using this addon in a very simple way and its been working wonderfully... however I've run into a small snag.

On boot & on stop of video i run this script (play.sh):
Code:
#!/bin/bash
kodi-send -a "PlayMedia(my_mp3_file.mp3)";

The idea is the mp3 provides a little ambient background music while navigating through the menus or when its just sitting idle. (the actual script is a little more involved in randomly picking an mp3 from a local directory)

when the mp3 is done a "stop" is detected and the script runs again and keeps playing (i think this is where my problem is coming from)... after a while i get the following error:
Code:
OSError: [Errno 12] Cannot allocate memory
and thats the end, my loop stops running because there is no longer an "end/stop" to trigger the script being run again.

the odd part is i can play a normal movie/tv show... its just my script that fails out until i reboot. Ive googled around and my error points to swap file issues? but im not able to figure out how that applies?

Any pointers? thanks?

If you are using my fork (https://github.com/KenV99/service.xbmc.callbacks2), instead of a script, try using the PlayMedia builtin directly from the addon.
If you have the same error, then I would post the problem in the general forum or development forum since it seems to be a memory allocation issue from using kodi-send. The knowledgeable parties would be more likely to see the issue there.
Reply
Hey KenV99, you are spot on... the lack of fork-ing was the problem

i wrapped my script with ()& and problem solved, i think the issue was caused by a few bad mp3's that would back things up.

I would use your addon but my one line example of a script is very simplified. i have it going through folders and randomly picking from genres based on time of year... Christmas, Halloween...

Its working really well now! just have to figure out a graceful idle & resume and it will be perfect!

Thanks,
Reply
Hello all,

I've added monitors for the kodi log and for the opening and closing of specific Kodi windows.

The details are in the updated wiki found here.

Let me know if there are issues.
Reply
Is it possible to use this to prompt for deletion when finishing watching recorded tv?

I have taken a look using the latest addon from KenV99's github and the 'Playback Stopped' doesn't seem to have any selectable arguments that can be sent.
If I could get the media type (recorded tv) and the file path, I figured it should then be easy enough to make a prompt to carry out deletion.

Ideally I'd like to get the playback percentage too (so I only prompt if say >90% duration watched) but I'm guessing I probably can't get that easily..
Reply
(2015-12-30, 22:06)Swifty Wrote: Is it possible to use this to prompt for deletion when finishing watching recorded tv?

I have taken a look using the latest addon from KenV99's github and the 'Playback Stopped' doesn't seem to have any selectable arguments that can be sent.
If I could get the media type (recorded tv) and the file path, I figured it should then be easy enough to make a prompt to carry out deletion.

Ideally I'd like to get the playback percentage too (so I only prompt if say >90% duration watched) but I'm guessing I probably can't get that easily..

I can make both of those available in the next version.
I am in the middle of a major rewrite, so it may be a week or so.

The next version is a major overhaul using a threaded PubSub design pattern that will make it easier to add things.
In addition the way arguments is going to be handled will be with a simple script language using variable substitutions.
In the settings you will be given a list of available variables for a given event and the user will input a string to be used when executing the event.
For example for this - %fn = fileName, %pp = percentPlayed.

The user can then customize the order and other arguments that can be passed along with 'static' elements.
Such as:

foo %pp bar:"%fn"

will send:

foo 26 bar:"G:\Movies\Star Wars IV\Star War IV - A New Hope"

%% will be used to send a literal % sign.

To be clear - any non-variable elements like foo and bar will just be copied over.

These will be 'appended' to the actual command that the script is using.
Because of the way arguments are handled for scripts, they will be passed as individual elements after the actual script file.
For python and built-ins, they will be comma-separated.
For http they will be url-encoded.
I hope this will provide more flexibility for users.
Reply
Wow, sounds absolutely perfect Smile

Thanks for your efforts with this, I'll be subscribing as it will greatly improve the WAF if I can get this working.
Reply
I was in the process of reporting a problem when I realized for about the 10th time I had downloaded Pilluli's Version instead of your fork. I was reading about your updates though and just wanted to say thanks for your time and hard work. Your plugin really pulls the automation part of my home theater together. (Plus I dont get yelled at for leaving the TV on.)

Sometime soon I want to fork your fork and include a send hex option for those of us controlling serial devices. Although calling my python script works excellent.
Check out all my How-To's at http://KnightCinema.com
Maine, USA.
Using XBMC since Dharma 2010
Reply
(2016-01-06, 06:28)jknight2014 Wrote: I was in the process of reporting a problem when I realized for about the 10th time I had downloaded Pilluli's Version instead of your fork. I was reading about your updates though and just wanted to say thanks for your time and hard work. Your plugin really pulls the automation part of my home theater together. (Plus I dont get yelled at for leaving the TV on.)

Sometime soon I want to fork your fork and include a send hex option for those of us controlling serial devices. Although calling my python script works excellent.

Thanks for the feedback.
I am going to start a new thread when this version is complete and once tested a bit more, I will submit it to the official repo. There is a kodi bug that the 'masters' need to fix in the settings api before I can submit because of some issues with localized strings.

I'll post here with a link to the new thread.

Once this version is complete, I plan to work out a 'plugin' architecture that might allow you to easily add your serial/hex code for others to use.

I'm still at least a week away, so please be patient...
Reply
(2015-12-30, 22:06)Swifty Wrote: Is it possible to use this to prompt for deletion when finishing watching recorded tv?

I have taken a look using the latest addon from KenV99's github and the 'Playback Stopped' doesn't seem to have any selectable arguments that can be sent.
If I could get the media type (recorded tv) and the file path, I figured it should then be easy enough to make a prompt to carry out deletion.

Ideally I'd like to get the playback percentage too (so I only prompt if say >90% duration watched) but I'm guessing I probably can't get that easily..

I'm doing pretty much what you are asking here using Ken's addon. Look back through this thread and you will see various references to it.
Sounds like from his reply he is going to make that native to his addon in the next version. That would be great for everyone, but mine is working just fine. I really appreciate Ken's help and support of this great addon!
Reply
Hi,

I have a working beta of the new version up at: https://github.com/KenV99/service.kodi.callbacks
Please check it out.
It is NOT compatible with old settings and it will register as a completely different addon, so please copy over settings from xbmc.callbacks2 and then disable it.

It seems straightforward (to me). The tasks are separated from the events so that they can be reused for events if needed.

I am working on documentation. For now, post back with problems or questions. Once I hear that it seems to be working, I'll create a new thread.

I'm particularly interested if scripts are working on non-Windows systems, so if anyone has success with that, please also let me know.

EDIT:
Don't forget to enclose any variables that may have spaces in quotes where appropriate or you may have trouble parsing...
Reply
(2016-01-09, 18:56)ReplayHarry Wrote:
(2015-12-30, 22:06)Swifty Wrote: Is it possible to use this to prompt for deletion when finishing watching recorded tv?

I have taken a look using the latest addon from KenV99's github and the 'Playback Stopped' doesn't seem to have any selectable arguments that can be sent.
If I could get the media type (recorded tv) and the file path, I figured it should then be easy enough to make a prompt to carry out deletion.

Ideally I'd like to get the playback percentage too (so I only prompt if say >90% duration watched) but I'm guessing I probably can't get that easily..

I'm doing pretty much what you are asking here using Ken's addon. Look back through this thread and you will see various references to it.
Sounds like from his reply he is going to make that native to his addon in the next version. That would be great for everyone, but mine is working just fine. I really appreciate Ken's help and support of this great addon!

Thanks, what code are you using to perform the deletion? - I've been searching to see if there is any way to kick off the deletion of recordings via Kodi but can't find anything.

Are you having to translate the pvr://recordings... path to something the OS can understand and then perform a normal file deletion via the OS?

-Edit:

I've just grabbed the latest version and the triggers seem to be working fine Smile
However I can't get my script to do the deletion.. I stumbled on xbmcvfs and figured I might be able to give that the pvr:// path and perform the delete but it fails with; XFILE::CFileFactory::CreateLoader - unsupported protocol("pvr)

Any ideas how I can perform the delete?
Reply
Documentation for the new version is up at: Add-on:Kodi_Callbacks (wiki)
Reply
  • 1
  • 19
  • 20
  • 21
  • 22(current)
  • 23

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4