Kodi Community Forum

Full Version: Hyperion/Kodi-Callbacks event advice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I'm new - I was unsure where to place this question, but this place seemed appropriate. Mods please relocate as required.

I have a very recent Kodi/Openelec running on a Raspberry Pi 2. I have built a Hyperion-controlled WS2801 LED ambilight. All working well together.
Fantastic system, and thank you so much to all who have worked on this!

I want to disable (turn off) the ambilight (i.e, Hyperion) when the following events happen

1) Tv is turned off with remote's ON/OFF
2) Kodi becomes inactive when a different device is selected.

I got kodi-callbacks working and tested on/off scripts with callback/events OK.
It's the tying of the on/off scripts to the CORRECT events that I'm confused about.

I know that 2) is in principle possible, because I got a rudimentary version working by tying to the onPlayBackPaused/onPlayBackResumed events.
That works insofar as when I press pause/play on the remote, the ambilight turns on/off AND when I switch to a different device it turns off, and turns back on when I switch back to Kodi. Obviously switching devices is also triggering the same events as pause/resume on the remote. However, I do NOT WANT it to switch off/on when I press pause/play on the remote. It's only in the event where the device is changed that I need to turn on/off the ambilight.

Can someone please tell me the correct events to use? That is, not the onPlayBackPaused (which is sent by BOTH the device change AND the remote pause button) - but instead the event which is sent by ONLY the device change. Is there one?

Now, obviously Kodi itself knows this because it is pausing/resuming a movie when those device changes happen. There MUST be some notification to Kodi on device change that is presumably not the same as a remote control's PAUSE.

Thanks for any help.

Also, I have a couple of bugs to report on Kodi-callbacks and would appreciate some guidance as to where to report them.
This would be better off in the add-on development section - moving.
Please see this thread for more information on http://kodi.wiki/view/Add-on:Kodi_Callbacks
Slightly old thread, but I wrote this stand-alone daemon to control my Hyperion setup. It's a little more complicated to set up (edit a config file) because it doesn't have a GUI, but if you enable debug mode you can see what events get sent by Kodi.