Lets Talk XBMC

Alright, so I’m wanting to setup the wonderful rule for having the lights Dim when the state of the player is set as Play. Here is the kicker, I want to do it without having to touch the OpenHAB remote. I know that right now the binding refreshes every 60 seconds. I’d like to see if I could possibly increase this, yes I know more resources and what have you but I have plenty. I’d like for it to check the player.state and if it says play I want the rule to trigger, Is this possible to have occur? If not I believe this is something else that I am able to configure using the Cinema Experience plug-in with Kodi, though it doesn’t seem to have anyone really talking about using it so I"ll givet ath a try but I wanted to see if it was even possible to monitor this and trigger based off what it sees.

Yep I’m doing it - create an item to hold the state then a rule to detect the change. I have had a bit of trouble with the light persistance but have had some great help with it

Can I seen your rule that you created? I’d like to try and get this to work asap! Thanks!

Alright so I ended up using a plug in within Kodi to accomplish this. I guess there is a trade off for some people but for me this works fine at least so far. I have not tested on pause or play yet however Cinema Vision plug in for Kodi allows you to create what they call action files and do things you need. I just created a simple text file with the http line telling OpenHAB to set the dimmers to a certain percentage. I have it just like a theater. Trivia starts dim it to about 70. Trailers start dim to 40 percent movies starts turn off. Movie over bring the lights back up. As far as in your case of wanting to know previous light state you could possibly do it as the actions allows you to run python scripts. However just thought I’d toss this solution out there cause for me it works perfect. I kind of wished the lights dimmed a little slower instead of immediately from 70 to 40 and 40 to off not sure how that would be possible.

hi My rule is in the linked article from my first post

Hi Robert,

I’d never heard of the Cinema Experience add-on - it looks pretty useful!

I have tried something similar with kodi for controlling my squeezebox players - when the kodi screensaver kicked in, start playing music, and when the screensaver stops, pause the music (also helped because both the squeezelite and kodi services were both on the same machine, squeezelite would hold the audio port open and block kodi from playing sound… anyways…)

I had problems with reliably getting the screensaver to detect in openHAB so I reverted to using the Kodi add-on “Callbacks” https://github.com/KenV99/service.xbmc.callbacks2/wiki

There’s a option to fire a http request when various events occur on kodi (screensaver/startup/shutdown/play/pause). The advantage of this is that it is triggered from kodi, rather than polled from openHAB (at least I think that is how the openHAB xbmc add-on works…).

Perhaps it might be useful for you for automation outside of the cinema experience plugin?


Dan, thanks for that! I am going to check that one out for sure. Also make sure you use CinemaVision and not the Cinema Experience, that one hasn’t been updated in a while. The CinemaVision plug in is a lot more configurable and useful. Plus with constant updates as its being updated its been proving to be great.

You are absolutely right there Robert - somewhere between reading your post and typing the search of “Cinema Vision” into google I forgot what half the words… I blame google’s auto-correct/auto-suggestions.
Thanks for the correction!

1 Like

Just so its clear: The xbmc/kodi binding does not depend on polling. Usually, it connects to kodi via websockets and updates in realtime. Example: This video, where i stop and start the video using my media centers remote. The openHAB app is open to show the state updating in realtime.
Source: I am the original author if the binding and although further development is done by someone else today, i still use the binding everyday for exactly what was asked in the original question, without any kodi addons.


I was able to use this plug in to do it as well. Like I mentioned I wanted to try without the remote using the plugin. The plugin is great and I still have it reporting what’s playing and the like to my OpenHAB remote which I may use for other things but right now I like the control I get using the Kodi CinemaVision plugin for different light states at different points