Giter Site home page Giter Site logo

habitatx's Introduction

English | 日本語

HABitatX

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.

Requirements

Setup

HABitatX

  1. Clone this repository
    $ git clone https://github.com/SenoOh/HABitatX.git

Install RDBMS

This system uses ActiveRecord for DB connection, so it can use relational database management system (RDBMS). We explain the installation of SQLite3 as an example.

  1. Install SQlite3
    $ sudo apt install sqlite3

Launch

Preliminary Preparations

  1. Copy .env.example file and create .env file.
  2. Replace OPENHAB_PATH, MYSQL, and MYSQL_DATABASE in the .env file with your own information.
  3. Add any RDBMS gem you want to use to Gemfile and habitatx.rb.
  4. bundle install
    $ bundle install
  5. Generate DB
    $ bundle exec rake db:migrate

Linux

  1. Launch
$ bundle exec ruby habitatx.rb

After launching, open http://localhost:4567 in your browser to open the HABitatX screen.

Docker

  1. Generate Container Image
$ docker build -t habitatx_docker .
  1. Launch (If openHAB is not running in a container)
$ docker run -it -p 4567:4567 --name habitatx -v ${PWD}/:/var/www habitatx_docker
  1. Launch (If openHAB is running in a container)
$ docker run -it -p 4567:4567 --name habitatx -v ${PWD}/:/var/www --volumes-from <openHABのコンテナ名> habitatx_docker

After launching, open http://localhost:4567 in your browser to open the HABitatX screen

Usage

Overview

Demo movie

  1. Generate template code.

    Switch <%= code['itemID'] %> "<%= code['label'] %>" <<%= code['icon'] %>>
  2. 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.

  3. Generate spreadsheet.

    Overview

    Spreadsheets can be used by placing them in HABitatX/db/excel.

  4. Set title,spreadsheet and code in the datafile operator.

    https://www.youtube.com/watch?v=Kh5YQE_awGI

  5. Generate devices at once.

    https://www.youtube.com/watch?v=ZzczEUgfLsQ

The template code and spreadsheets used in the demo video are placed in HABitatX/examples.

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.