Homebridge plugin for openHAB.
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.
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [
],
"platforms": [
{
"platform": "openHAB",
"name": "openHAB",
"host": "192.168.0.100",
"port": "8080",
"sitemap": "demo",
"useLabelForName": true
}
]
}
Fields:
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:
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
}
]
}
]