Author Topic: Getting Started: What components are involved?  (Read 25214 times)

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Getting Started: What components are involved?
« on: January 24, 2015, 11:58:06 am »
So I've been following along this thread for quite some time and really love what I'm seeing.  After waiting a bit, I am to the point where I'd like to jump in and try this.

However, combing through this whole thread seems difficult at best, especially as there have been lots of changes since it all started.

Is there any place to get a good start?  I was going to just grab OH and install it, but when I read about the MIOS bindings, I get the impression (and that is the key word) that any such bindings I find in any standard places are out of date and that there are different places you need to go to either get newer bindings and/or newer OH + MIOS downloads.

I suspect I'm not the only one interested as the OH momentum seems to keep building.

Is there a place that ties all the "most current" parts you need for OH+MIOS together?  Ideally, along with current recommended best practices (setting up MIOS, what files need to be configured, what backing stores, if any, are best, caveats, etc)?

Just a 'quick & dirty' bootstrap reference (a paragraph and a few links -- given to point the direction, googling and reading things over should fill in the rest).

Anything like this would be very much appreciated!

Gerry

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #2 on: January 24, 2015, 12:32:00 pm »
Thanks Garret!  I had been reading those over in the recent past and they are pretty helpful. 

I just felt there were differences in what I was reading there and here (some of that was about 6+ weeks ago,  and things here get superseded with later posts too).

I think one thing that was leaving me uncertain was where to get the most current MIOS binding for OH.  I've seen mention what appear to be several discrete download sites listed outside of the "normal" channels over the life of this thread and knowing the binding was going through it's growth period, expected there was likely a "more current than standard" version available.

Gerry

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Getting Started: What components are involved?
« Reply #3 on: January 24, 2015, 12:46:48 pm »
Hey Gerry,
I put a request into Marc and Florin to promote 7 different Plugin threads to have their own sub-forum, since they've all reached their 400-post requirement

The openHAB - MiOS Binding was in that list, but I only submitted the request to promote on Thursday.  Once executed, it'll be possible to structure this a little more.


From an openHAB standpoint, when you install it you only get a core set of "Bindings" installed by default.  This list is [deliberately] tiny, and things like the MiOS Binding need to be added afterwards anyhow, so go ahead and get the "Runtime core" of openHAB installed and running.

This provides a reasonable set of instructions for that:

    http://www.openhab.org/gettingstarted.html

NOTE: I only configure by command-line/text-file so I don't have the Designer components installed.  I used to have the Demo component installed, and that was handy to keep around in order to see the syntax in the various files (although, that syntax is online also)


Once you have the basics up and running, you can then install the Addons for MiOS:
  • MiOS Bridge Binding (required) - Download
  • MiOS Action Binding (optional) - Download

These are the latest versions, and contain everything in my "build" environment, but not yet approved for the openHAB release environment.  They'll work in any recent version of openHAB, they were built against a 1.6.x env.

NOTE: There's a README.md file in openHAB for the MiOS Binding.  The version that @garrettwp pointed to is the latest-released-version.  There are others, but they're in varying states of flux:


There's a lot more, but this will get you started (as well as provide me a template for the first sticky post once we get broken out in the forum)
« Last Edit: January 29, 2015, 08:47:10 pm by guessed »

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #4 on: January 25, 2015, 08:39:19 am »
Couple of questions:

1) The download links are for 1.7 version.  I'm assuming that will only work if you are also running the 1.7 OH and not the 1.6 OH? 

2) If so, are there enough changes to the MIOS 1.7 bindings that it's worth starting there (1.7 vs 1.6)?

3) What is the difference between the mios binding and the mios action?  What do you gain/lose from installing or not installing the actions (as they are labeled as optional)?

4) There appear to be a number of files that you have to download from the git repositiory and install in addition to the .jar
   a) Is it only the transformations or are there other files too that should be downloaded?
   b) Is there a way the build process could bundle those files into a .tgz or .zip so end users had only one additional download?

I suspect #3 might be more obvious once I'm more familiar with OH overall, but figured it couldn't hurt to ask.

Thanks!

Gerry
« Last Edit: January 25, 2015, 08:41:51 am by gduprey »

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Getting Started: What components are involved?
« Reply #5 on: January 25, 2015, 10:44:44 am »
He Gerry,
The 1.7 versions of the MiOS Bridge Bundle file(s) will work fine against the 1.6.x versions of openHAB.  It's just a build labeling process, and 1.6/1.7 openHAB Runtime core is mostly just bug fixes so either can be used there also (I run a prerelease of 1.6.0 openHAB Runtime core)

The 1.7 MiOS Bridge Bundle files contain a number of significant improvements that are well worth picking up.  They are going to be pulled back into a 1.6.2 OpenHAB Runtime core patch release, but that's not GA yet. 

Also, the MiOS Action binding (for writing complex openHAB Rules) will only be available in the 1.7.0 code line, but most people won't need that, as its really needed for complex rules.  If you're not writing complex rules, then you can leave out the MiOS Action bundle... It can always be added later.

I'll see if I can make a build target the bundles/zips the MiOS Transform files.  Thiese files are required to be separately installed because the openHAB 1.x Runtime core doesn't support having these load as Bundle-specific resources.

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #6 on: January 25, 2015, 11:22:51 am »
Thanks so much!  I seriously appreciate all this!

When I download the transformations -- is there a better place than the master branch of the MiOS binding on github?  In short, do I need a more current set of transformations than the ones under 1.6 on github for the 1.7 snapshot binding you included a link for?

Thanks!!

Gerry

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Getting Started: What components are involved?
« Reply #7 on: January 25, 2015, 12:05:23 pm »
No new Transforms yet, so 1.6 or 1.7 will be the same.

I'm waiting for more feedback before adding additional ones (based upon need) but they can always be added manually also.

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #8 on: January 26, 2015, 08:55:05 am »
Hopefully running out of questions.  I have OH and the MiOS bindings running, but I'm not clear about the item definitions.  Do I have to create them for all the devices I have or does the binding create them automatically?

Reading the wiki, I can't quite tell if the part on items is for custom stuff or meant for absolutely every/any vera device (dimmer/.switch/thermostat/lock) you want to talk to.

Thanks!!
Gerry

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Getting Started: What components are involved?
« Reply #9 on: January 26, 2015, 09:04:24 am »
You need to manually populate the items config with the devices you want to show up or control in vera. They will not be automatically generated.

- Garrett


Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #10 on: January 26, 2015, 01:10:58 pm »
You need to manually populate the items config with the devices you want to show up or control in vera. They will not be automatically generated.

Thanks -- i sort of feared that (over 100 devices to create).  That said, the code at the MCV wiki on OH actually was a good starting place: http://wiki.micasaverde.com/index.php/OpenHAB 

Instead of trying to mount a remote partition (per the wiki), I just redirected output to the /tmp/log/cmh space and dumped it, the xfered it over.  I'll have too hand tailor things, but it's a great start!

Gerry

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Getting Started: What components are involved?
« Reply #11 on: January 26, 2015, 02:52:27 pm »
OpenHAB does require some setting up, but once you have it going, it offers a lot of potential.

- Garrett


Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #12 on: January 29, 2015, 06:32:24 pm »
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:
  • If you haven't already, insure your Vera has a fixed IP address and know it
  • Install Java JDK (not just the runtime, but full SDK/JDK) 1.7 or higher
  • Go to http://www.openhab.org/downloads.html and download the Runtime core, Add Ons and Demo kit.  For the moment, skip the designer
  • Pick a clean directory for OpenHAB (OH) and unzip the core.  We'll call this $OH
  • 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.
  • From your "completely different" directory, copy the files org.openhab.*.mios*.jar into your $OH/addons
  • Resist the urge to install other add-ons yet.  You can do it later.  Keep it Simple.
  • Edit $OH/configurations/openhab.cfg.  Go to the bottom of the file and append this line mios:house.host=192.168.1.99 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.
  • cd $OH
  • chmod a+rx start.sh
  • ./start.sh

OH should now be running.  Don't expect much, but do check the log files and make sure there are no errors.

Next Steps:
  • Use @guessed scripts to create an initial set of items
    http://forum.micasaverde.com/index.php/topic,30367.0.html
    .  Note you might have to install 'curl' and 'xsltproc' if not on your system for this to work.
  • Edit that items file, cleanup item names, etc.  If not sure, leave it for now -- you can change them later
  • Copy the item file into the $OH/configurations/items directory.
  • 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!
  • Consider auto-starting OH: https://github.com/openhab/openhab/wiki/Samples-Tricks#how-to-configure-openhab-to-start-automatically-on-linux
  • Write a sample rule or two to test your items and understanding of rules
  • Good time to read MiOS binding Wiki https://github.com/openhab/openhab/wiki/MiOS-Binding
  • Read the part of the MiOS binding on logging and just tack the logging additions into logback.xml (inside the <configuration>...</configuration> tags.  It'll create a logs/mios.log and it can be very helpful.
  • Read about and configure a persistence engine.  I use db4o and others use the rrd4j.  Both are easy to setup.

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:
  • Go to the OpenHAB repository at https://github.com/openhab/openhab
  • On the right side, press the Download ZIP button
  • In an empty scratch/temporary directory, unzip the file (usually called openhab-master.zip)
  • Copy the transforms to the OH directory
Code: [Select]
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
« Last Edit: February 03, 2015, 09:41:59 am by gduprey »

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: Getting Started: What components are involved?
« Reply #13 on: February 02, 2015, 10:22:49 pm »
@gduprey, what a great write up.  Thank you for getting me started so quickly.

Just one note, to download the Transforms in one Zip file, go to:
https://github.com/mrguessed/openhab

Choose the "Download Zip" button on right sidebar to get the entire project.

When downloaded, extract the files from openhab/bundles/binding/org.openhab.binding.mios/examples/transform to the directory @gduprey mentioend

Cheers!
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline gduprey

  • Beta Testers
  • Full Member
  • *****
  • Posts: 122
  • Karma: +6/-1
Re: Getting Started: What components are involved?
« Reply #14 on: February 03, 2015, 09:43:26 am »
Just one note, to download the Transforms in one Zip file, go to:

Good point! It's one less step than the git approach and doesn't require installing the git tool first.  I have updated my post to use that technique instead.

Thanks!

Gerry