Skip to content

openhab/openhabian

Repository files navigation

As an openHAB end user looking for a system to run on, please check out the official documentation:

openHABian - Hassle-free openHAB Setup

GitHub ShellCheck BATS Installation Build

openHABian is here to provide a self-configuring Linux system setup to meet the needs of every openHAB user, in two flavors:

  • A SD-card image pre-configured with openHAB for all Raspberry Pi models
  • As a set of scripts that sets up openHAB and tools on any Debian based system

A note on dedication and commitment

openHABian is for starters and expert users. We sometimes read about people deciding against use of openHABian because they want to install additional software and believe openHABian does not let them do this. Everybody wants their home automation to be stable and most people install a dedicated RPi, i.e. they don't install any other software there that may interfere with proper openHAB operation. Reasonably so, this is our clear recommendation. Saving another 100 bucks is not worth putting the reliable day-to-day operations of your home at risk.

Then again that being said, those who want to can use openHABian as the starting point for their 'generic' server and run whatever software else on top. There's no genuine reason why this wouldn't work. The openHABian image is really just Raspberry Pi OS (lite) under the hood and openHABian is "just" some scripts that install a number of packages and configure the system in a specific way, optimized to run openHAB.

On openHAB 4 and older

openHABian will install openHAB 5 and Java 21 by default. To have it install openHAB 4 or openHAB 3 right from the beginning, set clonebranch=openHAB4 or clonebranch=openHAB3, respectively, in openhabian.conf before first boot. Use clonebranch=legacy to get openHAB 2.

Hardware

Hardware recommendation

Let's put this first: our current recommendation is to get a RPi model 4 or 5 with 2 or 4 GB of RAM, whatever you can get hold of for a good price, plus an "Endurance" SD card. If you want to be on the safe side, order the official 3A power supply, else any old mobile charger will usually do. Cards named "Endurance" can handle more write cycles and will be more enduring under openHAB's use conditions. Prepare to make use of the SD mirroring feature, get a 2nd SD card right away, same model or at least the size of your internal one, plus a USB card reader.

Hardware support

As of openHABian version 1.6 and later, all Raspberry Pi models are supported as hardware. openHABian can run on x86 based systems but on those you need to install the OS yourself. Anything else ARM based such as ODroids, OrangePis and the like may work or not. NAS servers such as QNAP and Synology boxes will not work.

We strongly recommend Raspberry Pi 2, 3 or 4 systems that have 1 GB of RAM or more. RPi 1 and 0/0W just have a single CPU core and only 512 MB of RAM. The RPi0W2 has 4 cores but only 512 MB as well. 512 MB can be sufficient to run a smallish openHAB setup, but it will not be enough to run a full-blown system with many bindings and memory consuming openHABian features/components such as zram or InfluxDB. We do not actively prohibit installation on any hardware, including unsupported systems, but we might skip or deny to install specific extensions such as those memory hungry applications named above.

Supporting hardware means testing every single patch and every release. There are simply too many combinations of SBCs, peripherals and OS flavors that maintainers do not have available, or, even if they did, the time to spend on the testing efforts that is required to make openHABian a reliable system. It means that to run on hardware other than RPi 2/3/4/5 or bare metal x86 Debian may work but is not a supported setup. Please stay with a supported version. This will help you and those you will want to ask for help on the forum focus on a known set of issues and solutions.

For ARM hardware that we don't support, you can try any of the fake hardware parameters to 'simulate' RPi hardware and Raspberry Pi OS.

OS support

Going beyond what the RPi image provides, as a manually installed set of scripts, we support running openHABian on x86 hardware on generic Debian. We provide code that is reported "as-is" to run on Ubuntu but we do not support Ubuntu so please don't open issues for this (PRs then again are welcome). Several optional components such as WireGuard or Homegear are known to expose problems on Ubuntu.

Note with openHAB 4 and Java 17, buster and older distros are no longer supported and there'll be issues when you attempt upgrading Java 11->17. Note openHAB 5 and Java 21 require a 64 bit image. Should you still be running an older distribution, we recommend not to upgrade the distro but to re-install using the latest openHABian image and import your config instead.

on 64 bit

openHAB 5 requires to run on a 64 bit OS and Java 21 version so the recommended openHABian image is the 64 bit version.

Many RPi users are still on a 32 bit based Linux OS. You can check bitness using the command getconf LONG_BIT. 64 bit has one major drawback: increased memory usage. That is not a good idea on heavily memory constrained platforms like older Raspberries. So if you want to go with 64 bit, ensure your RPi has a minimum of 2 GB, 4 will put you on the safe side. On x86 hardware, it's all 64 bit but that in turn once more increases memory usage. A NUC to run on should have no less than 4 GB, 8 are better.

You can temporarily use the 32 bit version if you want to stay with openHAB 4 or if you cannot upgrade your HW or OS at the very moment, BUT ATTENTION: RUNNING openHAB 5 on any 32 bit OS image IS NOT SUPPORTED ANY MORE and known to have issues with some functions like JS scripting. Please don't ask for help if you nonetheless run in 32 and hit trouble. You cannot change your OS once you decided in favor of either 32 or 64 bit, so should you decide to upgrade, export/backup your config and install a fresh system, then import your config there.

Installation and Setup

Please check the official documentation article to learn about openHABian use and please visit and subscribe to our community forum thread.

On Development and Testing

Testing of new code is done continuously with GitHub Actions using the test framework BATS and the linter ShellCheck. As the tests focus on installing software, a Docker solution is used for easy build-up and teardown.

To run the test suite on a amd64 platform execute the commands below. Docker and ShellCheck need to be installed first. For more details regarding the tests see Test Architecture in CONTRIBUTING.md.

docker build --tag openhabian/bats-openhabian -f tests/Dockerfile.amd64-BATS .
docker run --rm --name "openhabian-bats" -d openhabian/bats-openhabian
docker exec -i "openhabian-bats" bash -c 'bats --tap --recursive --filter "development-." .'
docker exec -i "openhabian-bats" bash -c 'bats --tap --recursive --filter "unit-." .'
docker exec -i "openhabian-bats" bash -c 'bats --tap --recursive --filter "installation-." .'
docker exec -i "openhabian-bats" bash -c 'bats --tap --recursive --filter "destructive-." .'
docker stop openhabian-bats

docker build --tag openhabian/install-openhabian -f tests/Dockerfile.amd64-installation .
docker run --privileged --rm --name "openhabian-install" -d openhabian/install-openhabian
docker exec -i "openhabian-install" bash -c "./build.bash local-test && /boot/first-boot.bash"
docker stop openhabian-install

The ShellCheck linter can be run by using the following commands:

shellcheck -x -s bash openhabian-setup.sh
shellcheck -x -s bash functions/*.bash
shellcheck -x -s bash build-image/*.bash
shellcheck -x -s bash build.bash tests/ci-setup.bash

Happy Hacking!

About

openHABian - empowering the smart home, for Raspberry Pi and Debian systems

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors 61

Languages