About Us
CinemaVision began in 2014 as a collaboration to create content for use with your home theater, offering movie trivia slides and video bumpers. It has since grown to be THE PREMIER WAY to create and customize your preshow experience. Download the CinemaVision add-on for Kodi today from the official Kodi repository, and easily create a sequence of trivia, videos, trailers, home automation triggers and more that will bring the experience of a movie theater straight to your screen!
Here is a more advanced way to dim the lights in your home theater room using OpenHAB and CinemaVision using the action files. With this setup you can control how quick or slow your lights will dim and to what percentage of brightness with a chosen value between 0 - 100. This requires edits to the items file and the rules file within OpenHAB.
The items file is a simple edit. Simply add the following line:
The rules file we will be adding a new rule to handle the JSON data we will send to it in the action file. Place this rule anywhere you would like within the file. I have placed instructions and explanations within the comments of the rule for those wanting to understand what's occurring.
**NOTE: I have found that if you are using the OpenHAB Designer in Ubuntu, the transform triggers will underline in red saying this is not correct. However this is not true and the rule will work just fine. It seems this occurs with the designer sometimes and its being looked at. Also if you do not want to flood your logfile you can remove the logInfo lines from the code. I placed these here during development to ensure everything was being passed along correctly and left in to help any troubleshoot any issues you may have.
The last bit we need to do is create our action files. For me I have 4 text files labeled where I have them triggering in my sequence. Example, I have a text file called theater_lights_triva.txt which triggers before my triva slides. I've found it easier using this naming convention for easy of updating. Here is how you would format your action file in order to properly send over the JSON information. Please note that JSON is CaSe SeNsItIvE.
_type = This value can be either dimDown or dimUp depending on if you want to dim your lights up or down within the sequence.
DimPercent = This is going to be the percentage of the dimmer we want to be at when the rule triggers
increments = This is the percentage value you would like to dim by
speed = This is how long to wait in milliseconds before dropping by the next increment.
** NOTE: If you have security enabled within OpenHAB you will need to add an additional line to your action file. The 2nd line in the action file will need to be the following:
HEADERS: {"Authorization": "Basic=XXXXX"} - You can generate the Basic=XXXX by using the Postman plugin for Chrome. Using Postman you can place in your user credentials and the header line will generate for you. You can than place this within the header line and you will than be able to send your JSON request lines with authorization turned on. Here is an example of how the action file can look
This information is also explained in the rule comments but here it is again in a more compressed form. Save the file and place in your actions folder on your Kodi system where you have the CinemaVision folders. Then within the Sequence editor add the action. In the example above I placed this right before the trivia slides start. Once you place the action in, point it to your newly created .txt file. Save your sequence and run it, your lights should now react within the sequence.
Feel free to ask any questions or if you find anything that needs tweaked let me know!
Share this post
Link to post
Share on other sites