Release Kodi/XBMC Callback Daemon
#16
No problem, I had been meaning to do it for a while. It helps me get timely updates without having to keep coming back here!!

Thanks for the tips too, though Arch uses Systemd by default, so no init.d. I'll probably make a systemd module though, they're not too complex. I would probably encourage users to keep their json file in their home directory, though I imagine I'll end up checking several places. Do you have any strong feelings about config file location?

As for how it's getting built... I don't know much about Go! (reassuring, eh). It seems to work for now, but I'll see about figuring out where to slot godep in.
Reply
#17
I've released v1.0.0, which includes some bug fixes, but more importantly, and dramatically - it changes the name to kodi-callback-daemon.

I didn't enjoy having to make the decision, but I figured it would be best to get it done earlier rather than later.

@richardkemp, I'm afraid you're going to want to pull the xbmc-callback-package build from AUR and replace it.
Reply
#18
(2014-09-06, 16:45)richardkemp Wrote: Short version, it's now working - thanks for your help!


I noticed a few things - when I disabled and re-enabled the remote control checkboxes in xbmc settings it gave an error saying unable to start or something similar. I wondered if there was some sort of issue with the port being busy so checked and found multiple copies of the daemon running - I assume this is because I had added it to xbmc's autoexec.py so it started every time xbmc started, but was never closed again. After closing them all and running the new version, I see debug notifications in the terminal and my scripts are executed. Thank you again!

My suggestion for this setup is to use upstart (For debain based). Upstart will start it at boot and manage it. IIRC you can configure upstart to start and stop the daemon based on the status of another program. Although I dont remember exactly how to do this.
Reply
#19
I got as far as getting this to respond to callbacks but I am not getting this error.

Code:
WARN[0009] Failure executing command                     command=&{/data/scripts/tvoff.py [/data/scripts/tvoff.py] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [0xc20803c060 0xc20803c070 0xc20803c088] [0xc20803c060 0xc20803c070 0xc20803c088] [] [] <nil>} error=fork/exec /data/scripts/tvoff.py: exec format error

The script works fine if run from the shell and KODI can run them as well from my keymap. I understand there is an error in the format, I just dont know what it is.

Code:
{
  "kodi": {
    "address": "127.0.0.1",
    "port": 9090
  },
  "debug": true,
  "callbacks": {
    "GUI.OnScreensaverActivated": [
      {
        "backend": "shell",
        "background": false,
        "command": "/data/scripts/tvoff.py"
      }
    ],
    "GUI.OnScreensaverDeactivated": [
      {
        "backend": "shell",
        "background": false,
        "command": "/data/scripts/tvon.py"
      }
    ]
  }
]


EDIT: I had to use the arguments option for the location. And this would not execute the script at all by itself. All fixed and working!

Thanks so much for this program. You should try to get the KODI devs to build this into kodi.
Reply
#20
(2015-02-19, 22:04)jknight2014 Wrote: EDIT: I had to use the arguments option for the location. And this would not execute the script at all by itself. All fixed and working!

Thanks so much for this program. You should try to get the KODI devs to build this into kodi.

You're welcome! Sounds like I may have a little bug here, can you post the working config section?
Reply
#21
pdffs greate tool, works like a charm!
This is my config hoping that it will help someone to get started with the tool faster than i did Wink

Code:
{
  "kodi": {
    "address": "127.0.0.1",
    "port": 9090
  },
  "debug": true,
  "callbacks": {
    "GUI.OnScreensaverActivated": [
      {
        "backend": "shell",
        "background": false,
        "command": "/usr/bin/python",
        "arguments":[ "/home/nes/JaneScripts/tvoff.py"]
      }
    ],
    "GUI.OnScreensaverDeactivated": [
      {
        "backend": "shell",
        "command": "/usr/bin/python",
        "arguments": ["/home/nes/JaneScripts/tvon.py"]
      }
    ],
    "Player.OnPlay": [
      {
        "types": ["movie"],
        "backend": "shell",
        "command": "/usr/bin/python",
        "arguments": ["/home/nes/JaneScripts/lightoff.py"]
      }
    ],
    "Player.OnPause": [
      {
        "types": ["movie"],
        "backend": "shell",
        "command": "/usr/bin/python",
        "arguments": ["/home/nes/JaneScripts/lightoff.py"]
      }
    ],
    "Player.OnStop": [
      {
        "types": ["movie"],
        "backend": "shell",
        "command": "/usr/bin/python",
        "arguments": ["/home/nes/JaneScripts/lightoff.py"]
      }
    ]
  }
}
Reply
#22
Hi, this project looks interesting although I'm not sure exactly of what it does and how I could use it. If you don't mind reading some text, I have an issue with client/server setup of Hyperion that I have reported there https://github.com/poljvd/script.service.../issues/10 and I'm not sure if your project could help me in some way like logging activity etc Thanks for your attention. Smile
Reply
#23
(2015-02-20, 16:41)Nesurion Wrote: pdffs greate tool, works like a charm!
This is my config hoping that it will help someone to get started with the tool faster than i did Wink
Sorry for the delay getting back to you, I seem to have missed some notifications from the forum. I'd say the problem you had with your Python scripts was either because they weren't executable (chmod +x /path/to/script.py), or were missing the 'shebang' for the interpreter (first line should be something like '#!/usr/bin/env python').

(2015-02-25, 12:38)curunoir Wrote: Hi, this project looks interesting although I'm not sure exactly of what it does and how I could use it. If you don't mind reading some text, I have an issue with client/server setup of Hyperion that I have reported there https://github.com/poljvd/script.service.../issues/10 and I'm not sure if your project could help me in some way like logging activity etc Thanks for your attention. Smile
This project is about performing actions when XBMC events occur, probably wouldn't have helped you with your issue. Looks like you worked out that the issue you were having was with the built-in capture method. On x86 I've had decent results capturing with boblight-X11, but that may not perform particularly well on lower power devices, might be worth checking out though. I would like at some stage to fix the Hyperion X11 grabber to use xrender so performance doesn't suck and we can take advantage of some of the extra features only available on the RPi grabber, but I have other projects that take precedence.
Reply
#24
Not sure if this is still being developed but if it is then this project should probably be renamed to meet the official trademark policy?

http://kodi.wiki/view/Official:Trademark_Policy

You should not use "Kodi" or "XBMC" in the name of unoffical products, see this section:

http://kodi.wiki/view/Official:Trademark...d_Software

Related Software

XBMC Foundation products are designed to be extended, and we recognize that community members writing add-ons and supplemental software need some way to identify the XBMC Foundation product to which their add-on/software pertain. Our main concern about add-ons and related software is that consumers not be confused as to whether they are official (meaning approved by XBMC Foundation) or not. To address that concern, we request that add-ons and supplemental software names not include, in whole or in part, the words "XBMC Foundation" or "Kodi" in a way that suggests a connection between XBMC Foundation and the add-on or software (e.g., "Frobnicator for Kodi," would be acceptable, but "Kodi Frobnicator" would not).
Reply
#25
(2015-06-16, 17:06)RockerC Wrote: Not sure if this is still being developed but if it is then this project should probably be renamed to meet the official trademark policy?
This is why you can't have nice things in a world where lawyers are involved. Is anyone likely to be confused that this is an official product? Nah. I'm not advertising it anywhere, I've not posted it anywhere except here and Github, which I did so that others might be able to solve the same problem I was having with XBMC. If the lawyers want to send me a C&D I'll just delete it - for now it's doing what I intended it to, and for now I have more important things to do than go through renaming it everywhere to comply with a silly policy.
Reply
#26
Do not worry if there was a problem an official would have contacted you Smile

This is just RockerC that needs more posts and love to post links and cross-links all over this forum.
Reply
#27
None is suing or forcing anyone. and no offense or threatening meant.

Recommend you read http://kodi.tv/introducing-kodi-14/ and http://kodi.tv/introducing-the-kodi-logo/ which explain their interest in trademark protection.

After reading those you might be more willing change you mind.
Reply
#28
That's fine RockerC, but I don't believe I'm diluting the brand with this little addon. I may get around to renaming one day, but right now I have no plans to do so, and I don't believe the language in those terms is targeted at this sort of thing - try thoroughly reading and understanding their reasoning, then think about whether it should apply. And before you give this sort of advice, maybe try creating something then see how much spare time you have - the effort for this sort of thing doesn't come free. I've made (very minor, admittedly) contributions to the Kodi project too, btw. And the library I wrote to support this little application (which also starts with 'kodi', because it's a library, and it would make no sense to call it something else) has been used in other projects that I have no control over - changing the name of that would break them all. Now, if you could leave this thread for people who might be seeking help, I'd appreciate it.
Reply
#29
Added LIFX support in the latest version, now you can bring the house lights down when you start playing media Cool
Reply
#30
Hello,

I'm trying to use this great tool on an installation of Plex Home Theater (forked from Kodi).
I've tried multiple versions of this tool, but I can't seem to get the daemon to fire any actions (other than startup).
I'm using the pre-compiled binary for 1.1.4_linux_amd64. I'm running a very minimal Arch installation.

Here is the output when i start it and then manually activate and then deactivate the screensaver from Plex Home Theater. I have debugging turned on:

Code:
INFO[0000] Connected to Kodi                            
DEBU[0000] Sending Kodi Request (response desired)       request={0xc20802a7f0 JSONRPC.Version <nil> 2.0}
DEBU[0000] Received response from Kodi                   response.Result=map[version:map[major:6 minor:0 patch:3]]
INFO[0000] Connected to Hyperion                        
DEBU[0000] Sending to Hyperion                           request=map[command:clear priority:800]
DEBU[0000] Received from Hyperion                        response=&{true <nil>}
DEBU[0000] Executing shell command                       command=&{/home/siam/hyperion-x11-start [/home/siam/hyperion-x11-start START] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
DEBU[0002] Received notification from Kodi               notification.Method=GUI.OnScreensaverActivated notification.Params=map[sender:xbmc data:<nil>]
DEBU[0012] Received notification from Kodi               notification.Method=GUI.OnScreensaverDeactivated notification.Params=map[data:false sender:xbmc]

Here is my config file:
Code:
{
  "kodi": {
    "address": "127.0.0.1",
    "port": 9090
  },

  "hyperion": {
    "address": "127.0.0.1",
    "port": 19444
  },

  "debug": true,

  "callbacks": {

    "Startup": [
      {
        "backend": "hyperion",
        "command": "clear",
        "priority": 800
      },

      {
        "backend": "shell",
    "background": true,
        "command": "/home/siam/hyperion-x11-start.sh",
    "arguments" : ["ON"]
      }
    ],

    "GUI.OnScreensaverActivated": [
      {
        "backend": "hyperion",
        "command": "clear",
        "priority": 800
      },

      {
        "backend": "shell",
        "background": true,
        "command": "/home/siam/hyperion-x11-start.sh",
        "arguments" : ["OFF"]
      }

    ],

    "GUI.OnScreensaverDeactivated": [
      {
        "backend": "hyperion",
        "command": "clear",
        "priority": 800
      },

      {
        "backend": "shell",
        "background": true,
        "command": "/home/siam/hyperion-x11-start.sh",
        "arguments" : ["ON"]
      }


    ]

  }
}

I am expecting it to execute the callback commands.
Is there anything I'm doing wrong?

Happy to say I've found the issue. Had to add "background": true to the shell backends. Updated the script for posterity.
I love this tool so thank you very much pdffs. Please keep developing!
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi/XBMC Callback Daemon1