openhabian

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

Github星跟踪图

As an openHABian end user, please check out the official openHAB documentation:
? https://www.openhab.org/docs/installation/openhabian.html

openHABian - Hassle-free openHAB Setup

Setting up a fully working Linux system with all needed packages and openHAB recommendations is a boring task taking quite some time and Linux newcomers shouldn't worry about these technical details.

A home automation enthusiast doesn't have to be a Linux enthusiast!

openHABian aims to provide a self-configuring Linux system setup specific to the needs of every openHAB user.
The project provides two things:

  • A set of scripts to set up openHAB on any Debian/Ubuntu based system
  • Complete SD-card images pre-configured with openHAB and many other openHAB- and Hardware-specific preparations, for the Raspberry Pi and the Pine A64 platforms.

Close related to openHABian is the repository openhab-linuxpkg providing linux packages for openHAB. Openhabian uses those package to setup openHAB with some additional configurations.

Installation and Setup

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

Development

OpenHABian is foremost a collection of bash script version handled and deployed using GIT. In the current state the scripts can only be invoked through the terminal menu system whiptail. There is a longterm need to better seperate the UI part form the script code. A work have started to define conventions and further explain the code base in the document CONTRIBUTING along with development guidelines in general.

A good place to start to look at to understand the code is the file openhabian-setup.sh.

Building Hardware Images

Take a look at the build.bash script to get an idea of the process.
Simply explained run code below with platform being either rpi or pine64. The RPi image is based on the Raspbian Lite standard image while the Pine64 image is based on build-pine64-image.

$ sudo bash ./build.bash platform

As the script uses openhab/openhabian git repository during installation it must sometimes be changes to test code from other repositories, like a new feature in a fork. There is two commands for this replacing the git repo with a custom one. The first command uses the current checkout repository used in the filesystem:

$ sudo bash build.bash platform dev-git

The second command uses a fully customable repository:

$ sudo bash build.bash platform dev-url branch url

Testing

Testing is done continuously with Travis 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 execute the commands below or "$ ./test.bash docker-full". Docker and Shellcheck needs to be installed. For more details regarding the tests see Test Architecture in CONTRIBUTING.

docker build --tag openhabian/openhabian-bats .
docker run -it openhabian/openhabian-bats bash -c 'bats -r -f "unit-." .'

docker run --name "install-test" --privileged -d openhabian/openhabian-bats
docker exec -it install-test bash -c "./build.bash local-test && mv ~/.profile ~/.bash_profil && /etc/rc.local"                                                
docker exec -it install-test bash -c 'bats -r -f "installation-." .'
docker exec -it install-test bash -c 'bats -r -f "destructive-." .'

docker stop install-test
docker rm install-test

Use the linter by executing:

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

Happy Hacking!

主要指标

概览
名称与所有者openhab/openhabian
主编程语言Shell
编程语言Shell (语言数: 4)
平台
许可证ISC License
所有者活动
创建于2016-08-15 22:56:12
推送于2025-06-24 12:20:38
最后一次提交
发布数47
最新版本名称v1.10.4 (发布于 )
第一版名称v0.5 (发布于 )
用户参与
星数828
关注者数62
派生数256
提交数2.1k
已启用问题?
问题数1009
打开的问题数10
拉请求数863
打开的拉请求数0
关闭的拉请求数143
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?