HABitatX is a tool that supports batch management of multiple devices, which tends to be complicated in the openHAB smart home system. This system works as an interface to provide batch management operations for openHAB. It is required that openHAB is running. The system operates as a stand-alone application and runs on the same computer as openHAB. It can create, modify, and delete text files that configure openHAB devices at once.
Text files that configure openHAB devices are created from template codes and spreadsheets. Template code defines the structure of a text file that configures the openHAB device. Template code is an embedded type and creates a text file by embedding information obtained from external sources in specified locations. It uses ERB, a template engine, as the format. A spreadsheet is an interface that contains a list of information to be embedded in the template code. It uses Excel as the format.
HABitatX" is a term coined from "openHAB", "habitat", and "X" which represents a vision for the future.
- Ruby 3.3.3
- Ruby on Rails 7.1.3.4
- openHAB 3.4.3 ~
- RDBMS (Relational Data Base Management System)
- Clone this repository
$ git clone https://github.com/SenoOh/HABitatX.git
This system uses ActiveRecord
for DB connection, so it can use relational database management system (RDBMS
).
When you use Docker
to launch HABitatX, you need not to install it. We explain the installation of SQLite3 as an example.
- Install SQlite3
$ sudo apt install sqlite3
- Copy
.env.example
file and create.env
file. - Replace
OPENHAB_PATH
,AUTH_SERVER_PATH
andPUB_KEY
in the.env
file with your own information. - Add any RDBMS gem to the
Gemfile
, and add or edit other RDBMS information as needed.
- bundle install
$ bundle install
- Generate DB
$ rails db:migrate
- Launch
$ bin/rails server
After launching, open http://localhost:3000 in your browser to open the HABitatX screen.
- Launch
$ ./start.sh
After launching, open http://localhost:3000 in your browser to open the HABitatX screen.
-
Generate template code.
Switch <%= code['itemID'] %> "<%= code['label'] %>" <<%= code['icon'] %>>
-
Set title, code, openHAB ID prefix, and extension in the template operator.
https://www.youtube.com/watch?v=XqZT1b-lbVg
・code is template code.
・Create a text file name by combining openHAB ID prefix and the ID of each device.
・For "extension", select the extension from the pull-down menu.
-
Generate spreadsheet.
Spreadsheets can be used by placing them in
HABitatX/db/excel
. -
Set title,spreadsheet and code in the datafile operator.
-
Generate devices at once.
The template code and spreadsheets used in the demo video are placed in HABitatX/examples
.