Giter Site home page Giter Site logo

docker-openhab's Introduction

Overview

Docker image for Openhab (1.8.3). Included is JRE 1.8.45.

Official DEMO Included

If you do not have a openHAB configuration yet, you can start this Docker without one. The official openHAB DEMO will be started.

Pull

docker pull tdeckers/openhab

Building

docker build -t <username>/openhab .

Running

  • The image exposes openHAB ports 8080, 8443, 5555 and 9001 (supervisord).

  • It expects you to map a configurations directory on the host to /etc/openhab. This allows you to inject your openhab configuration into the container (see example below).

    • /etc/openhab - openHAB configuration
    • /opt/openhab/logs - openHAB logs
    • /opt/openhab/webapps/static - Folder for uuid & secret for http://my.openhab.org
    • /opt/openhab/etc - Folder for data like db4o and rr4jd
  • To enable specific plugins, add a file with name addons.cfg in the configuration directory which lists all addons you want to add.

    Example content for addons.cfg:

    org.openhab.action.mail
    org.openhab.action.squeezebox
    org.openhab.action.xmpp
    org.openhab.binding.exec
    org.openhab.binding.http
    org.openhab.binding.knx
    org.openhab.binding.mqtt
    org.openhab.binding.networkhealth
    org.openhab.binding.serial
    org.openhab.binding.squeezebox
    org.openhab.io.squeezeserver
    org.openhab.persistence.cosm
    org.openhab.persistence.db4o
    org.openhab.persistence.gcal
    org.openhab.persistence.rrd4j
    
  • The openHAB process is managed using supervisord. You can manage the process (and view logs) by exposing port 9001. From there it is possible to switch between NORMAL and DEBUG versions of OpenHAB runtime.

  • The container supports starting without network (--net="none"), and adding network interfaces using pipework.

  • You can add a timezone file in the configurations directory, which will be placed in /etc/timezone. Default: UTC.

    Example content for timezone:

    Europe/Brussels
    

Example: run command (with your openHAB config)

<<<<<<< HEAD
docker run -d -p 8080:8080 -v /tmp/configuration:/etc/openhab/ tdeckers/openhab
=======
docker run -d -p 8080:8080 -v /tmp/configuration:/etc/openhab tdeckers/openhab
>>>>>>> 325750d... Various

Example: Map configuration and logging directory as well as allow access to Supervisor:

docker run -d -p 8080:8080 -p 9001:9001 -v /tmp/configurations/:/etc/openhab -v /tmp/logs:/opt/openhab/logs tdeckers/openhab

Example: run command (with Demo)

docker run -d -p 8080:8080 tdeckers/openhab

Start the Demo with:

http://[IP-of-Docker-Host]:8080/openhab.app?sitemap=demo

Access Supervisor with:

http://[IP-of-Docker-Host]:9001

HABmin

HABmin is not included in this deployment. However you can easily add is as follows:

docker run -d -p 8080:8080 -v /<your_location>/webapps/habmin:/opt/openhab/webapps/habmin -v /<your_location>/openhab/config:/etc/openhab -v /<your_location>/openhab/addons-available/habmin:/opt/openhab/addons-available/habmin tdeckers/openhab

Then add these lines to addon.cfg

habmin/org.openhab.binding.zwave
habmin/org.openhab.io.habmin

Contributors

  • maddingo
  • scottt732
  • TimWeyand
  • dprus
  • tdeckers
  • wetware
  • carlossg
  • dimitrystd
  • JensErat

docker-openhab's People

Contributors

carlossg avatar dimitrystd avatar jenserat avatar joltcoke avatar m0se avatar maddingo avatar richardpowellus avatar scottt732 avatar tdeckers avatar timweyand avatar wetwarelabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-openhab's Issues

Telnet to 5555 to access osgi isn't working

I've got -p "127.0.0.1:5555:5555" in my docker run command. After that I run: "telnet localhost 5555" from my host machine but I'm not able to connect to the osgi console interface.

Should you be specifying the port (5555) after the -console command when you run the OpenHAB jar?

Long reaction time compared to raspberry pi installation

Hi, quite silent here therefore not sure if you still support this Image. I have some challenges that the user interface takes quite long until a switch is changed. On my raspberry this was always less than a second. Now 3 to 5 seconds is normal. I cannot see any load above 10%. Also changing the committed ram from unlimited to 2GB sem to make not that big effect. Any idea?

Everything else is unchanged. Just switched to docker on a Synology 918+ with 12GB ram. Any hint would be great.

timezone file is not working any more

I just updated my openhab and noticed that time zone file is not working any more.

with out further checking I think dpkg-reconfigure -f noninteractive tzdata behaves other in the ubuntu:16.04 image.

Regards
Alex

Running on UnRaid with USB support?

Hi, sorry if this is the wrong place for discussion.
I tried to create my own docker for OpenHAB2 a while ago, but being new to both Docker and OpenHAB I failed miserably (could get the interface to launch, but nothing else). Now I have OpenHAB running in a VM on UnRaid, but does your docker method work with a USB ZWave stick, i.e. it'll mount onto ttyUSB0 etc and can be used in HabMIN?

If so I might move back over to Docker instead of VM.
Thanks
Christian

my.openhab addon

It seems I was having trouble getting the my.openhab add-on to correctly map in the configuration add ons.cfg file. Entering the container I can see that there are 2 versions with the same name (1.7.0 / 1.7.1) so I renamed the 1.7.0 file to a different name. After doing so the mapping worked fine. Likely want to remove that extra add-on from the addons-available directory.

I'm not clear on how to get the logdir to work?

It seems that by default openhab will put the log files in a java environment variable openhab.logdir but I don't see any way to control that since it needs to be passed into the java command like -Dopenhab.logdir ?

I've tried mounting /var/log/openhab but I don't see any log files showing up there.

One thing I did get to work was to create a logback.xml and tell it to explicitly write the log files to /var/log/openhab but unfortunately it appears as though some plugins rely on openhab.logdir to find the log files.

The immediately obvious solution would be to change this docker image so that it passes in the environment variable, say, OPENHAB_LOGDIR into Java when launching OpenHAB so that the logdir gets set when I do: "docker run -e OPENHAB_LOGDIR=/var/log/openhab" but I wanted to be sure I wasn't missing anything obvious before messing with making changes to the image :)

Typo in readme.md

When running the example there seems to be a "/" where it should be a space in:
docker run -d -p 8080:8080 -v /tmp/configuration:/etc/openhab/tdeckers/openhab
Should be:
docker run -d -p 8080:8080 -v /tmp/configuration:/etc/openhab tdeckers/openhab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.