npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-openhab

v0.1.31

Published

Homebridge plugin for openHAB

Downloads

31

Readme

homebridge-openHAB

npm package

Gitter

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 "ThermostatItem" for Thermostat (experimental support),
    • 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,
  • "itemSubType" - use only with itemType=ThermostatItem, defines the type of openHAB item associated to ThermostatItem:
    • use "CurrentTemperatureCItem" for openHAB item with current temperature value in Celsius,
    • use "CurrentTemperatureFItem" for openHAB item with current temperature value in Fahrenheit,
    • use "TargetTemperatureCItem" for openHAB item with target temperature value in Celsius,
    • use "TargetTemperatureFItem" for openHAB item with target temperature value in Fahrenheit,
    • use "CurrentRelativeHumidityItem" for openHAB item with humidity value.
  • "itemUniqueAggregationId" - use only with itemType=ThermostatItem, defines which item are associated with a Thermostat, use the same integer value for the same thermostat.

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
            },
            {
                "itemName":"living_room_ambient_temperature_c",
                "itemLabel":"Termostat 1",
                "itemType": "ThermostatItem",
                "itemSubType":"CurrentTemperatureCItem",
                "itemUniqueAggregationId":1
            },
            {
                "itemName":"living_room_target_temperature_c",
                "itemLabel":"Termostat 1",
                "itemType": "ThermostatItem",
                "itemSubType":"TargetTemperatureCItem",
                "itemUniqueAggregationId":1
            },
            {
                "itemName":"living_room_humidity",
                "itemLabel":"Termostat 1",
                "itemType": "ThermostatItem",
                "itemSubType":"CurrentRelativeHumidityItem",
                "itemUniqueAggregationId":1
            }
        ]
    }
]