Giter VIP home page Giter VIP logo

homebridge-openhab's Introduction

homebridge-openHAB

Homebridge plugin for openHAB.

Prerequisites

Installation

  • Install the mdns and avahi library:

    sudo apt-get install libnss-mdns libavahi-compat-libdnssd-dev

  • Install homebridge:

    npm install -g homebridge

  • This plugin is published through NPM and should be installed "globally" by typing:

    npm install -g homebridge-openhab

  • Update your config.json file (usually is in your home/.homebridge/ directory, if you can't find, follow the instruction in homebridge). See config.json in this repository for a sample.

Configuration (config.json)

"platforms": [
    {
        "platform": "openHAB",
        "name": "openHAB",
        "host": "192.168.0.100",
        "port": "8080",
        "sitemap": "demo",
        "useLabelForName": true
    }
]

Fields:

  • "platform" - Must be set to openHAB
  • "name" - Name of openHAB server, default openHAB
  • "host" - IP address of the openHAB server
  • "port" - Port of the openHAB server
  • "sitemap" - Sitemap name of your openHAB server
  • "useLabelForName" - true if you want use item's label in the name field of HomeKit, useful if you want to use Siri. If you set this attribute to true it's important that you have unique label in your sitemap.

Advanced configuration (config.json)

If you want set custom attributes to your openHAB's item you should add "customAttrs" attribute to your config.json file. In this section you can change these attributes:

  • "itemLabel" - you can set a different label,
  • "itemManufacturer" - you can set item's manufacter,
  • "itemModel" - you can set item's model,
  • "itemSerialNumber" - you can set item's serial number,
  • "itemType" - you can have different type of switch item, number item, contact item, etc. Here you can define the type:
    • use "TemperatureSensorItem" for Temperature Sensor,
    • use "LightSensorItem" for Light Sensor,
    • use "FanItem" for Fan,
    • use "LightbulbItem" for Lightbulb,
    • use "OutletItem" for Outlet,
    • use "MotionSensorItem" for Motion Sensor.
  • "skipItem" - set to true if you want avoid to load the item in Homekit catalog, default is false.

Configuration sample:

"platforms": [
    {
        "platform": "openHAB",
        "name": "openHAB",
        "host": "192.168.0.100",
        "port": "8080",
        "sitemap": "demo",
        "useLabelForName": true,
        "customAttrs": [
            {
                "itemName":"Demo_Switch",
                "itemLabel":"Demo Switch Label",
                "itemManufacturer": "Demo Manufacter Switch",
                "itemModel": "Demo Model Switch",
                "itemSerialNumber":"12345678"
            },
            {
                "itemName":"Demo_Lightbulb",
                "itemLabel":"Demo Lightbulb Label",
                "itemManufacturer": "Demo Manufacter Lightbulb",
                "itemModel": "Demo Model Lightbulb",
                "itemSerialNumber":"12345678",
                "itemType":"LightbulbItem"
            },
            {
                "itemName":"Demo_Fan",
                "itemLabel":"Demo Fan Label",
                "itemManufacturer": "Demo Manufacter Fan",
                "itemModel": "Demo Model Fan",
                "itemSerialNumber":"12345678",
                "itemType":"FanItem"
            },
            {
                "itemName":"Demo_Outlet",
                "itemLabel":"Demo Outlet Label",
                "itemManufacturer": "Demo Manufacter Outlet",
                "itemModel": "Demo Model Outlet",
                "itemSerialNumber":"123456378",
                "itemType":"OutletItem"
            },
            {
                "itemName":"Demo_Dimmer",
                "itemLabel":"Demo Dimmer Label",
                "itemManufacturer": "Demo Manufacter Dimmer",
                "itemModel": "Demo Model Dimmer",
                "itemSerialNumber":"23456789"
            },
            {
                "itemName":"Demo_Temperature",
                "itemLabel":"Demo Temperature",
                "itemManufacturer": "Demo Manufacter Temperature",
                "itemModel": "Demo Model Temperature",
                "itemSerialNumber":"23456781",
                "itemType": "TemperatureSensorItem",
                "skipItem": false
            }
        ]    
    }
]

homebridge-openhab's People

Contributors

tommasomarchionni avatar

Watchers

 avatar  avatar

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.