Skip to content

Commit

Permalink
finally it's building
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Busch committed Oct 26, 2015
1 parent cfae824 commit 1ad6c13
Show file tree
Hide file tree
Showing 4 changed files with 339 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/config.json
66 changes: 66 additions & 0 deletions Dockerfile
@@ -0,0 +1,66 @@
FROM ubuntu:15.04
MAINTAINER Patrick Busch <p@trickbusch.de>

RUN apt-get update

##################################################
# Set environment variables #
##################################################

# Ensure UTF-8
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV TERM xterm


##################################################
# Add app user #
##################################################

RUN useradd --create-home --home-dir /home/app --shell /bin/bash app


##################################################
# Install tools #
##################################################

RUN apt-get install -y curl git apt-transport-https python build-essential make g++ libavahi-compat-libdnssd-dev


##################################################
# Install node #
##################################################

RUN curl -sLf -o /dev/null 'https://deb.nodesource.com/node_0.12/dists/vivid/Release'
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo 'deb https://deb.nodesource.com/node_0.12 vivid main' > /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb-src https://deb.nodesource.com/node_0.12 vivid main' >> /etc/apt/sources.list.d/nodesource.list

RUN apt-get update
RUN apt-get install -y nodejs
#RUN ln -s /usr/bin/nodejs /usr/bin/node


##################################################
# Install homebridge #
##################################################

ADD homebridge-src /home/app/homebridge
ADD config.json /home/app/homebridge/config.json
RUN chown -R app:app /home/app/homebridge

WORKDIR /home/app/homebridge
USER app
RUN npm install


##################################################
# Start #
##################################################

WORKDIR /home/app/homebridge

EXPOSE 51826

CMD ["npm run start"]
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -2,7 +2,16 @@

Docker image for Homebrigde by nfarina

For Details see https://github.com/nfarina/homebridge
For details see https://github.com/nfarina/homebridge

This is simply wrapping the source in a runnable Docker image for everyone that cannot install the dev environment on his machine or everyone that wants a simple containerized solution.

## Configuration

Copy `config-sample.json` to `config.json` and adapt to your likings.

## Build

`docker build --tag="patrickbusch/homebridge:0.1-SNAPSHOT" .`

## Run
262 changes: 262 additions & 0 deletions config-sample.json
@@ -0,0 +1,262 @@
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},

"description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.",

"platforms": [
{
"platform" : "Nest",
"name" : "Nest",
"username" : "username",
"password" : "password"
},
{
"platform" : "TelldusLive",
"name" : "Telldus Live!",
"public_key" : "telldus public key",
"private_key" : "telldus private key",
"token" : "telldus token",
"token_secret" : "telldus token secret"
},
{
"platform" : "Telldus",
"name" : "Telldus"
},
{
"platform": "Wink",
"name": "Wink",
"client_id": "YOUR_WINK_API_CLIENT_ID",
"client_secret": "YOUR_WINK_API_CLIENT_SECRET",
"username": "your@email.com",
"password": "WINK_PASSWORD"
},
{
"platform": "SmartThings",
"name": "SmartThings",
"app_id": "JSON SmartApp Id",
"access_token": "JSON SmartApp AccessToken"
},
{
"platform": "Domoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080",
"roomid": 0,
"loadscenes": 1
},
{
"platform": "PhilipsHue",
"name": "Phillips Hue",
"username": ""
},
{
"platform": "ISY",
"name": "ISY",
"host": "192.168.1.20",
"port": "8000",
"username": "username",
"password": "password"
},
{
"platform": "LogitechHarmony",
"name": "Living Room Harmony Hub"
},
{
"platform": "Sonos",
"name": "Sonos",
"play_volume": 25
},
{
"platform": "YamahaAVR",
"play_volume": -35,
"setMainInputTo": "AirPlay"
},
{
"platform": "ZWayServer",
"url": "http://192.168.1.10:8083/",
"login": "zwayusername",
"password": "zwayuserpassword",
"poll_interval": 2,
"split_services": false
},
{
"platform": "MiLight",
"name": "MiLight",
"ip_address": "255.255.255.255",
"port": 8899,
"type": "rgbw",
"delay": 30,
"repeat": 3,
"zones":["Kitchen Lamp","Bedroom Lamp","Living Room Lamp","Hallway Lamp"]
},
{
"platform": "HomeAssistant",
"name": "HomeAssistant",
"host": "http://192.168.1.10:8123",
"password": "XXXXX",
"supported_types": ["light", "switch", "media_player", "scene"]
},
{
"platform": "LIFx",
"name": "LIFx",
"access_token": "XXXXXXXX generate at https://cloud.lifx.com/settings"
}
],

"accessories": [
{
"accessory": "WeMo",
"name": "Coffee Maker",
"description": "This shim supports Belkin WeMo devices on the same network as this server. You can create duplicate entries for this device and change the 'name' attribute to reflect what device is plugged into the WeMo, for instance 'Air Conditioner' or 'Coffee Maker'. This name will be used by Siri. Make sure to update the 'wemo_name' attribute with the EXACT name of the device in the WeMo app itself. This can be the same value as 'name' but it doesn't have to be.",
"wemo_name": "CoffeeMaker"
},
{
"accessory": "LiftMaster",
"name": "Garage Door",
"description": "This shim supports LiftMaster garage door openers that are already internet-connected to the 'MyQ' service.",
// "requiredDeviceId", "<ID of door if you have multiple doors, prompted by shim during startup if needed>",
"username": "your-liftmaster-username",
"password" : "your-liftmaster-password"
},
{
"accessory": "Lockitron",
"name": "Front Door",
"description": "This shim supports Lockitron locks. It uses the Lockitron cloud API, so the Lockitron must be 'awake' for locking and unlocking to actually happen. You can wake up Lockitron after issuing an lock/unlock command by knocking on the door.",
"lock_id": "your-lock-id",
"api_token" : "your-lockitron-api-access-token"
},
{
"accessory": "Carwings",
"name": "Leaf",
"description": "This shim supports controlling climate control on Nissan cars with Carwings. Note that Carwings is super slow and it may take up to 5 minutes for your command to be processed by the Carwings system.",
"username": "your-carwings-username",
"password" : "your-carwings-password"
},
{
"accessory": "iControl",
"name": "Xfinity Home",
"description": "This shim supports iControl-based security systems like Xfinity Home.",
"system": "XFINITY_HOME",
"email": "your-comcast-email",
"password": "your-comcast-password",
"pin": "your-security-system-pin-code"
},
{
"accessory": "HomeMatic",
"name": "Light",
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
"ccu_id": "The XMP-API id of your HomeMatic device",
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
},
{
"accessory": "HomeMaticWindow",
"name": "Contact",
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
"ccu_id": "The XMP-API id of your HomeMatic device (type HM-Sec-RHS)",
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
},
{
"accessory": "HomeMaticThermo",
"name": "Contact",
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
"ccu_id_TargetTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
"ccu_id_CurrentTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
"ccu_id_ControlMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
"ccu_id_ManuMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
"ccu_id_AutoMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
},
{
"accessory": "X10",
"name": "Lamp",
"ip_address": "localhost:3000",
"device_id": "E1",
"protocol": "pl",
"can_dim": true
},
{
"accessory": "Http",
"name": "Kitchen Lamp",
"on_url": "https://192.168.1.22:3030/devices/23222/on",
"off_url": "https://192.168.1.22:3030/devices/23222/off",
"brightness_url": "https://192.168.1.22:3030/devices/23222/brightness/%b",
"http_method": "POST"
},
{
"accessory": "HttpHygrometer",
"name": "Kitchen",
"url": "http://host/URL",
"http_method": "GET"
},
{
"accessory": "HttpThermometer",
"name": "Garage",
"url": "http://home/URL",
"http_method": "GET"
},
{
"accessory": "ELKM1",
"name": "Security System",
"description": "Allows basic control of Elk M1 security system. You can use 1 of 3 arm modes: Away, Stay, Night. If you need to access all 3, create 3 accessories with different names.",
"zone": "1",
"host": "192.168.1.10",
"port": "2101",
"pin": "1234",
"arm": "Away"
},
{
"accessory": "AD2USB",
"name": "Alarm",
"description": "Arm, disarm, and status monitoring of the default partition for Honeywell/Ademco alarm systems. Requires network configured AD2USB interface",
"host": "192.168.1.200", // IP address of the SER2SOCK service
"port" : 4999, // Port the SER2SOCK process is running on
"pin": "1234" // PIN used for arming / disarming
},
{
"accessory": "Tesla",
"name": "Tesla",
"description": "This shim supports controlling climate control on the Tesla Model S.",
"username": "tesla_email",
"password" : "tesla_password"
},
{
"accessory": "Hyperion",
"name": "TV Backlight",
"description": "Control the Hyperion TV backlight server. https://github.com/tvdzwan/hyperion",
"host": "localhost",
"port": "19444"
},
{
"accessory": "mpdclient",
"name" : "mpd",
"host" : "localhost",
"port" : 6600,
"description": "Allows some control of an MPD server"
},
{
"accessory": "FileSensor",
"name": "File Time Motion Sensor",
"path": "/tmp/CameraDump/",
"window_seconds": 5,
"sensor_type": "m",
"inverse": false
},
{
"accessory": "GenericRS232Device",
"name": "Projector",
"description": "Make sure you set a 'Siri-Name' for your iOS-Device (example: 'Home Cinema') otherwise it might not work.",
"id": "TYDYMU044UVNP",
"baudrate": 9600,
"device": "/dev/tty.usbserial",
"manufacturer": "Acer",
"model_name": "H6510BD",
"on_command": "* 0 IR 001\r",
"off_command": "* 0 IR 002\r"
}
]
}

0 comments on commit 1ad6c13

Please sign in to comment.