Kaleidescape Owners' Forum   Kaleidescape, Inc. Kaleidescape, Inc.

Go Back   Kaleidescape Owners' Forum > Hardware & Setup Threads > Remotes, Automation, and Control Systems

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old Jul 11th, 2018
AlienWarlock AlienWarlock is offline
Member
 
Join Date: Jan 2018
Posts: 46
Default OpenHAB for Kaleidescape

Here is a small write up on getting OpenHAB talking to your Kaleidescape. OpenHAB is an open source home automation system that is capable of interfacing all manner of technologies and systems into one integrated interface. I have configured my OpenHAB instance to interface with my Kaleidescape to retrieve and react to information about what is playing as well as send commands to the system. Utilizing various rules, OpenHAB has the ability to react to Kaleidescape's updates. While it would be nice to have a full OpenHAB binding for K instead of just this rule set, I find that this works fine for my needs. The 'tcp' binding must be loaded for this to work.


I have the following items of information populated when a movie is playing:

Title name
Play status
Chapter
Aspect ratio
Movie location
Media type
Title length
Title location

The following files (see attached zip) are used for OpenHAB to interface with K:

items/kaleidescape.items - set ip address of K server on first line
rules/kaleidescape.rules- set kZoneId to CPDID or serial number of kaleidescape zone to control
transform/k_*.map - lookup tables of various K status codes
transform/k_get_hour_minute.js - js to transform # of minutes integer to friendly display string
sitemaps/k_items.txt - items to add to sitemap for Kaleidescape


Rules specified in kaleidescape.rules:

rule "Handle Kaleidescape Event rule" - main rule to process status update messages from Kaleidescape
rule "Send K ENABLE_EVENTS rule" - call this rule once to enable event updates from Kaleidescape
rule "Send K DISABLE_EVENTS rule" - call this rule once to disable event updates from Kaleidescape
rule "K credits rolling" - this rule fires when credits roll and the movie was over 75 minutes long
rule "K movie night script" - called by switch 'K_movie_night' to start the script called 'Movie Night'
rule "K movie covers" - call this rule to make K go to movie covers screen, I use this from another rule that fires when I turn on my projector
rule "K screen saver off" - call this rule to turn off the K screen saver
rule "Handle K User Event" - handle K script action 'Send command to control system', the string is what was specified in the script create ui

Enjoy!
Attached Files
File Type: zip K_hab.zip (4.5 KB, 5 views)
Reply With Quote
  #2  
Old Jul 12th, 2018
Croptop Croptop is offline
Senior Member
 
Join Date: May 2007
Posts: 370
Default

Thanks for posting this. I keep looking at OpenHAB but never seem to take the leap. This might be the push I needed.
Reply With Quote
  #3  
Old Jul 29th, 2018
Croptop Croptop is offline
Senior Member
 
Join Date: May 2007
Posts: 370
Default

Finally took the plunge and got OpenHAB installed on a RPi2 that I had kicking around. Just starting to work my way through the configuration and setup so expect lots of dumb questions over the next little bit.

First one: What are you using as your OpenHAB server? I'm feeling like a RPi2 -- whilst suitable for experimenting -- is just a little bit too fragile for long term use. Any suggestions?
Reply With Quote
  #4  
Old Jul 29th, 2018
AlienWarlock AlienWarlock is offline
Member
 
Join Date: Jan 2018
Posts: 46
Default

I started out my OpenHAB journey with a RPi2. I am currently running a RPi3 as my main rig. I haven't had any issues with reliability. While it does take several minutes for OpenHAB to start up fully, it is remarkably fast after that. Just make sure and use a good quality SD card.
Reply With Quote
  #5  
Old Jul 29th, 2018
Croptop Croptop is offline
Senior Member
 
Join Date: May 2007
Posts: 370
Default

Thanks for the reply. As you hint at, it's the long term viability of the uSD card that I'm concerned about. I'll probably be keeping my eye out for a suitable replacement for long term but in my current phase of learning, the RPi2 will suffice.

I've managed to get all of my devices added to OpenHAB and have even successfully implemented rules to turn the lights on and off when playing, pausing and stopping in Plex.

I've attempted to integrate your sample files into my setup following your instructions above however I must have missed some key settings thing because I'm getting the following in my OpenHAB logs:

Quote:
2018-07-29 19:43:26.779 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'MAP' is unavailable

2018-07-29 19:43:26.794 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'MAP' is unavailable

2018-07-29 19:43:26.810 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'MAP' is unavailable

2018-07-29 19:43:26.822 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'MAP' is unavailable

2018-07-29 19:43:26.838 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'JS' is unavailable

2018-07-29 19:43:26.850 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'JS' is unavailable
I copied the .map and .js files from your zipfile into my OpenHAB-conf/services directory. I have the TCP/UDP bindings installed and the IP address of my K Server entered in the "kaleidescape.items" file.

Any tips on where to start looking in order to figure out where I've messed up?

Last edited by Croptop; Jul 29th, 2018 at 05:31 PM. Reason: Figured out how to trigger K_init and K_disable in my theatre rules.
Reply With Quote
  #6  
Old Jul 29th, 2018
o0OBillO0o o0OBillO0o is offline
Senior Member
 
Join Date: Feb 2018
Posts: 189
Default

This is very cool. Why are you doing this versus using, for example, a EA-1 from Control4 and a iPad?
Reply With Quote
  #7  
Old Jul 29th, 2018
AlienWarlock AlienWarlock is offline
Member
 
Join Date: Jan 2018
Posts: 46
Default

I guess for myself, OpenHAB was easier to get into having an IT background.

I think you need to install the MAP transform service to get the JS transformation errors to go away (see attached screen shot). Also if you haven't looked in the rules file yet, you will need to edit the kZoneId variable to be the CPDID (found in the 'Control' tab of the K component settings web interface) or the serial number of the zone that you want to control.
Attached Images
File Type: png transform.png (121.2 KB, 4 views)
Reply With Quote
  #8  
Old Jul 29th, 2018
o0OBillO0o o0OBillO0o is offline
Senior Member
 
Join Date: Feb 2018
Posts: 189
Default

Quote:
Originally Posted by AlienWarlock View Post
I guess for myself, OpenHAB was easier to get into having an IT background.

I think you need to install the MAP transform service to get the JS transformation errors to go away (see attached screen shot). Also if you haven't looked in the rules file yet, you will need to edit the kZoneId variable to be the CPDID (found in the 'Control' tab of the K component settings web interface) or the serial number of the zone that you want to control.
Thanks for replying.

Since you have an IT background, how did/do you address those who think they can build their own Kaleidescape?

I'll give this a shot. My hopes and dreams is to write an Apple Homekit implementation using Hombridge - https://github.com/nfarina/homebridge
Reply With Quote
  #9  
Old Jul 29th, 2018
AlienWarlock AlienWarlock is offline
Member
 
Join Date: Jan 2018
Posts: 46
Default

Quote:
Originally Posted by o0OBillO0o View Post
how did/do you address those who think they can build their own Kaleidescape?
Ha, I gave up trying to convert people a long time ago But if I did try to address those who would DIY their own K clone, I'm sure I would encounter the "I can setup a Plex server, NAS, and a bunch of Intel NUC clients for way less" attitude.

Yes it may be 'way less', but what is your spare time worth? For me, I don't want to constantly mess around with all that goes with the DIY route. Kaleidescape 'just works' and provides the best possible home theater experience. 'Nuff said!
Reply With Quote
  #10  
Old Jul 30th, 2018
Croptop Croptop is offline
Senior Member
 
Join Date: May 2007
Posts: 370
Default

@AlienWarlock:
Thanks for the tip about installing the MAP transform service. I'm fairly certain that is the missing piece. I had already updated the .rules file and everything is working fine even with the MAP and JS warnings.

Now I just need to create a nice panel layout for my Android tablets and then it's on to the big project: writing a Kaleidescape binding.

@o0OBillO0o: For me, OpenHAB scratches my DIY itch. Plus it's about two orders of magnitude cheaper than Control4 (or AMX or Crestron). It's not as polished but it's also easier to roll up my sleeves and redo the programming on an OpenHAB system than it would be on Control4, AMX or Crestron (where I'd have to have a developer's account in order to have access to the software tools).

As for the Plex vs Kaleidescape argument, I actually have both and they co-exist very nicely. But my movies go on the Kaleidescape system and movie nights are always driven by K. Plex is just my DVR and music server.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:57 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright ?2006 - KscapeOwners.com.
THIS SITE IS NOT OWNED BY, OPERATED BY, OR AFFILIATED IN ANY WAY WITH KALEIDESCAPE INC.
"Kaleidescape" is a trademark of Kaleidescape, Inc.; it is registered in some jurisdictions.