After getting the basics up and running, I figured I’d post my “quick” boostrap summary:
Fair Warning: It assumes your running under linux, are familiar with basic command line tools and editing text files without a GUI.
Quick Terms:
- $OH - directory you install OpenHAB into
- Binding - effectively a ‘driver’ or connector between OH and some device(s)
- Items - discrete parts of each device (i.e temperature, dim level of a light, etc). Items have to be manually defined to connect a name with a binding.
- Transformations - Translators between OH values/terms and MiOS values/terms.
- Sitemap - a ‘template’ (sort of) that defines how your Items appear on a web page
Quick Start Steps:
[ol][li]If you haven’t already, insure your Vera has a fixed IP address and know it[/li]
[li]Install Java JDK (not just the runtime, but full SDK/JDK) 1.7 or higher[/li]
[li]Go to [url=http://www.openhab.org/downloads.html]http://www.openhab.org/downloads.html[/url] and download the Runtime core, Add Ons and Demo kit. For the moment, skip the designer[/li]
[li]Pick a clean directory for OpenHAB (OH) and unzip the core. We’ll call this $OH[/li]
[li]In a completely different directory (!), unzip the addons and demo zip files. Addons is optional bindings and demo is example items/sitemaps you may wish to look at, compare or use as reference.[/li]
[li]From your “completely different” directory, copy the files org.openhab..mios.jar into your $OH/addons[/li]
[li]Resist the urge to install other add-ons yet. You can do it later. Keep it Simple.[/li]
[li]Edit $OH/configurations/openhab.cfg. Go to the bottom of the file and append this line [tt]mios:house.host=192.168.1.99[/tt] Change the IP address (192.168.1.99 here) to that of your Vera. If you have multiple Veras, just set one up for now - you can add more here later. Save the file out.[/li]
[li]cd $OH[/li]
[li]chmod a+rx start.sh[/li]
[li]./start.sh[/li][/ol]
OH should now be running. Don’t expect much, but do check the log files and make sure there are no errors.
Next Steps:
[ol][li]Use @guessed scripts to create an initial set of items [url=http://forum.micasaverde.com/index.php/topic,30367.0.html]
http://forum.micasaverde.com/index.php/topic,30367.0.html[/url]. Note you might have to install ‘curl’ and ‘xsltproc’ if not on your system for this to work.[/li]
[li]Edit that items file, cleanup item names, etc. If not sure, leave it for now – you can change them later[/li]
[li]Copy the item file into the $OH/configurations/items directory.[/li]
[li]Copy the MiOS binding transforms into the $OH/configurations/transform. This is kinda of a pain right now – see below for my ‘best’ way of doing it today. Things will not work until this is done, so don’t skip it![/li]
[li]Consider auto-starting OH: [url=https://github.com/openhab/openhab/wiki/Samples-Tricks#how-to-configure-openhab-to-start-automatically-on-linux]Samples Tricks · openhab/openhab1-addons Wiki · GitHub
[li]Write a sample rule or two to test your items and understanding of rules[/li]
[li]Good time to read MiOS binding Wiki [url=https://github.com/openhab/openhab/wiki/MiOS-Binding]https://github.com/openhab/openhab/wiki/MiOS-Binding[/url][/li]
[li]Read the part of the MiOS binding on logging and just tack the logging additions into logback.xml (inside the … tags. It’ll create a logs/mios.log and it can be very helpful.[/li]
[li]Read about and configure a persistence engine. I use db4o and others use the rrd4j. Both are easy to setup.[/li][/ol]
There is still a lot for you to setup, between editing and updating items and considering creating a sitemap so you can use the web control interface (check the demo directory configurations/sitemaps to get a taste of how that works). I’d recommend you get a couple of rules working, tweak your item names/definitions a bit and make a rudimentary sitemap file before you try to take on any other bindings (the MiOS binding is complex and once you are semi-comfortable with it, you’ll be ready to for the rest of the OH bindings).
Installing Transformations:
There are a bunch of files you really need to install in order for OH and MiOS to talk to each other. These files, called ‘transformations’, map the OH terms, values and concepts into MiOS/Vera terms, values and concepts and are REQUIRED for the mios binding to be do much. Unfortunatly, there is no way for the MiOS binding to automatically include them, so you’ll have to download them and install them by hand. More unfortunatly, there are about 30 of them and no easy way to download them in a single file/zip.
Here’s what I found to be about the ‘quickest’ way for now:
[ol][li]Go to the OpenHAB repository at [url=https://github.com/openhab/openhab]https://github.com/openhab/openhab[/url][/li]
[li]On the right side, press the Download ZIP button[/li]
[li]In an empty scratch/temporary directory, unzip the file (usually called openhab-master.zip)
[/li][li]Copy the transforms to the OH directory[/li][/ol]
cp openhab-master/bundles/binding/org.openhab.binding.mios/examples/transform/* $OH/configurations/transform
When done, get out of that scratch/temporary directory and delete the temporary directory - you don’t need it anymore