Release - Execute user tasks for Kodi events (callbacks ver2)

  Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kulgan Offline
Junior Member
Posts: 9
Joined: Aug 2014
Reputation: 0
Post: #196
Hi,

I'm using osmc on PI3.
kodi 17.1
callbacks 1.0
I use 2 profiles "Enfants" and "Master User" at boot, kodi start on "Enfants".

What I'm trying to acheive is, when using Master user profile, "on screensaver activate" to have an automatic kodi restart (and so to be back in "Enfants" profiles)

Issue : is seems calback addon only load configuration of first profile, indeed If in both profile callback is reconfigured to restart onscreensaveractivated, "Master user" is properly restarted (but in that case "Enfants" is also restarted.)
if "Enfants" is configured to no action and Master to restart on screensaver : restart doesn't happen.
Note : if when log in master I enter callback addon configuration, after existing configuration, then restart happenned on screensaveractivate.

Thanks for your help.
(This post was last modified: 2017-05-05 07:27 by kulgan.)
find quote
stephr1 Offline
Junior Member
Posts: 23
Joined: Aug 2016
Reputation: 0
Post: #197
Bump...anyone?

(2017-04-23 17:40)stephr1 Wrote:  BUMP!! Anyone offer any help here? Thx....

(2017-04-20 16:37)stephr1 Wrote:  @KenV99

Thank you for your efforts!! I haven't started using it yet, but have a need for an event that isn't obviously available...

Running OSMC/RPI 3. Have a HDHomeRun dual tuner connected (thru the network) and would like to be able to turn on an LED (1 for each tuner channel) when a recording is happening, and off when it isn't (or recording is finished).

Does that exist in your addon (thought "onDailyAlarm" or "onIntervalAlarm" might be the answer, but not sure either would work the way I'd like it to), is there a combination of events I could use, or am I on my own here....

Thanks in advance....
find quote
KenV99 Offline
Fan
Posts: 506
Joined: Nov 2013
Reputation: 28
Post: #198
(2017-05-08 18:44)stephr1 Wrote:  Bump...anyone?

(2017-04-23 17:40)stephr1 Wrote:  BUMP!! Anyone offer any help here? Thx....

(2017-04-20 16:37)stephr1 Wrote:  @KenV99

Thank you for your efforts!! I haven't started using it yet, but have a need for an event that isn't obviously available...

Running OSMC/RPI 3. Have a HDHomeRun dual tuner connected (thru the network) and would like to be able to turn on an LED (1 for each tuner channel) when a recording is happening, and off when it isn't (or recording is finished).

Does that exist in your addon (thought "onDailyAlarm" or "onIntervalAlarm" might be the answer, but not sure either would work the way I'd like it to), is there a combination of events I could use, or am I on my own here....

Thanks in advance....

The events are listed in the Wiki:Add-on:Kodi_Callbacks (wiki)
There are no events for recording and I don't know how that could be done.
IF you know of another way of checking, you could write your own code to check if a recording is occurring and IF you know how to turn on the LED in code then send the codes to turn it on or off depending on coding state.
If the above is true, then you COULD use the onIntervalAlarm to call the above intermittently (like every second).
However, if you know how to code all of the above, consider writing your own addon to do it.
(This post was last modified: 2017-05-08 19:29 by KenV99.)
find quote
nickr Offline
Team-Kodi Member
Posts: 17,655
Joined: May 2009
Reputation: 356
Location: Christchurch NZ
Post: #199
@stephr1 this is really a backend job I think. Which backend are you using?

If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
find quote
jant90 Offline
Junior Member
Posts: 28
Joined: Apr 2011
Reputation: 0
Post: #200
Is it possible to execute 2 built-in Kodi functions with a minor sleep in between them under one task?

I've currently set it up my task as "Kodi Builtin Function: Action(xxxxxx)" and I want something like "Kodi Builtin Function: Action(xxxxxx); sleep250ms; Action(xxxxxx);", is something like that possible?
find quote
jant90 Offline
Junior Member
Posts: 28
Joined: Apr 2011
Reputation: 0
Post: #201
I think I solved it by creating an external script that utilizes the JSON RPC:

Code:
curl --silent --user user:pass --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","id":1,"method":"Input.ExecuteAction","params":{"action":"actionhere"}}' 'http://localhost:8080/jsonrpc'
sleep 0.25s
curl --silent --user user:pass --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","id":1,"method":"Input.ExecuteAction","params":{"action":"anotheraction"}}' 'http://localhost:8080/jsonrpc'

Possible actions can be found here: Action_IDs (wiki)
find quote
Post Reply