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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?