Skip to content

tecracer-chef/openhab-cookbook

Repository files navigation

DEPRECATION NOTICE

This should still work for some installs, but I'm no longer actively developing it - I've switched to Team Docker for my personal OpenHAB needs.

I'll still happily merge any PR's, but if anyone wants to take over maintainance of this, I'm happy to hand it over!

openhab-cookbook

This installs openhab and selected plugins. You can either install via the debian packages, or from source.

NOTE: This is only for versions 1.x of openhab. When I move to OpenHAB 2, I'll start a openhab2 cookbook.

Dependencies

  • Cookbooks:
    • apt
    • java
  • On the system:
  • apt updated (including apt in the run-list will do this)
  • java 8 installed
    • this cookbook will install java for you by default - make sure to set the attributes for oracle v8

Supported Platforms

Tested succesful on:

  • Ubuntu 12.04
  • Ubuntu 14.04
  • Raspbian (source-only)

Recipies

  • openhab - Installs openhab
  • openhab::init_script - Installs openhab init.d script
  • openhab::my_openhab - Installs my.openhab addon .jar
  • openhab::habmin - Installs HABmin console

Attributes

Global

Key Type Description Default
['openhab']['install_java'] Boolean Whether to install java via the java cookbook true
['openhab']['install_method'] String Whether to install openhab via the deb packages (default) or via 'source' 'package'
['openhab']['version'] String What version of openhab to install 1.7.1
['openhab']['plugins'] Array List of plugins to install []

Init script install only

Key Type Description Default
['openhab']['http_port'] String HTTP Port for the init script 8080
['openhab']['https_port'] String HTTPS Port for the init script 8443

Source install only

Key Type Description Default
['openhab']['install_dir'] String Which directoy to install 'openhab' into '/opt'
['openhab']['user'] String What user to run install as root
['openhab']['group'] String What user to run install as root

my.openHAB plugin

Key Type Description Default
['openhab']['my']['version'] String Which version of the my.openhab plugin to install 1.7.0

habmin console

Key Type Description Default
['openhab']['habmin']['install_dir'] String Where to install habmin /opt/openhab/webapps/habmin
['openhab']['habmin']['git_repository'] String Which repo to download habmin from https://github.com/cdjackson/HABmin
['openhab']['habmin']['git_revision'] String Which ref of habmin to use e523d77c7a3d73d75ce050a582a3bfe8bc7a1324
['openhab']['habmin']['user'] String What user to run install as root
['openhab']['habmin']['group'] String What group to run install as root

Usage

    1. Make sure you have Java setup:
{
  attributes: {
    java: {
      install_flavor: 'oracle',
      jdk_version: '8',
      oracle: {accept_oracle_download_terms: true}
    }
  }
}
    1. Pick some plugins:
{
  attributes: {
    openhab: {
      plugins: %w{binding-xbmc action-xbmc binding-twitter persistance-mysql}
    }
  }
}
    1. Include openhab in your node's run_list:
{
  "run_list": [
    "recipe[apt]",
    "recipe[openhab]"
  ]
}
    1. ???
    1. Profit!

You now have OpenHAB installed. If you did it from the packages, you have the init.d script set up and openhab running already.

Init script

If you want to install an init.d script for booting, use the openhab::init_script recipie. Currently only Raspbian is supported.

my.openhab plugin

If you want to install the myOpenHABplugin, run the openhab::my_openhab recipie - it will place the requested .jar in the addons dir.

You'll still need to set/get the uuid/secret registration yourself.

License and Authors

Author:: Justin Aiken