Skip to content

Commit 253384c

Browse files
committed
initial working version
1 parent 5481e98 commit 253384c

4 files changed

Lines changed: 308 additions & 1 deletion

File tree

‎Dockerfile‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM resin/rpi-raspbian:jessie
2+
3+
EXPOSE 5353 51826
4+
5+
ENV DEBIAN_FRONTEND noninteractive
6+
ENV LANG en_US.UTF-8
7+
8+
# install dependencies
9+
RUN apt-get update && apt-get install -y \
10+
wget build-essential curl git apt-transport-https python make g++ avahi-daemon avahi-discover libnss-mdns libavahi-compat-libdnssd-dev libkrb5-dev net-tools
11+
12+
# install latest stable node 6
13+
RUN wget --no-check-certificate -O - https://deb.nodesource.com/setup_6.x | bash && \
14+
apt-get install -y nodejs && \
15+
apt-get clean
16+
17+
# install homebridge
18+
RUN npm install -g --unsafe-perm homebridge hap-nodejs node-gyp
19+
20+
# install homebridge plugins
21+
RUN npm install -g homebridge-http --unsafe-perm
22+
23+
USER root
24+
RUN mkdir -p /var/run/dbus
25+
26+
ADD run.sh /root/run.sh
27+
RUN chmod +x /root/run.sh
28+
CMD ["/root/run.sh"]

‎config.json‎

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
{
2+
"bridge": {
3+
"name": "Homebridge",
4+
"username": "CC:22:3D:E3:CE:30",
5+
"port": 51826,
6+
"pin": "031-45-154"
7+
},
8+
9+
"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.",
10+
11+
"platforms": [
12+
{
13+
"platform" : "Nest",
14+
"name" : "Nest",
15+
"username" : "username",
16+
"password" : "password"
17+
},
18+
{
19+
"platform" : "TelldusLive",
20+
"name" : "Telldus Live!",
21+
"public_key" : "telldus public key",
22+
"private_key" : "telldus private key",
23+
"token" : "telldus token",
24+
"token_secret" : "telldus token secret"
25+
},
26+
{
27+
"platform" : "Telldus",
28+
"name" : "Telldus"
29+
},
30+
{
31+
"platform": "Wink",
32+
"name": "Wink",
33+
"client_id": "YOUR_WINK_API_CLIENT_ID",
34+
"client_secret": "YOUR_WINK_API_CLIENT_SECRET",
35+
"username": "your@email.com",
36+
"password": "WINK_PASSWORD"
37+
},
38+
{
39+
"platform": "SmartThings",
40+
"name": "SmartThings",
41+
"app_id": "JSON SmartApp Id",
42+
"access_token": "JSON SmartApp AccessToken"
43+
},
44+
{
45+
"platform": "Domoticz",
46+
"name": "Domoticz",
47+
"server": "127.0.0.1",
48+
"port": "8080",
49+
"roomid": 0,
50+
"loadscenes": 1
51+
},
52+
{
53+
"platform": "PhilipsHue",
54+
"name": "Phillips Hue",
55+
"username": ""
56+
},
57+
{
58+
"platform": "ISY",
59+
"name": "ISY",
60+
"host": "192.168.1.20",
61+
"port": "8000",
62+
"username": "username",
63+
"password": "password"
64+
},
65+
{
66+
"platform": "LogitechHarmony",
67+
"name": "Living Room Harmony Hub"
68+
},
69+
{
70+
"platform": "Sonos",
71+
"name": "Sonos",
72+
"play_volume": 25
73+
},
74+
{
75+
"platform": "YamahaAVR",
76+
"play_volume": -35,
77+
"setMainInputTo": "AirPlay"
78+
},
79+
{
80+
"platform": "ZWayServer",
81+
"url": "http://192.168.1.10:8083/",
82+
"login": "zwayusername",
83+
"password": "zwayuserpassword",
84+
"poll_interval": 2,
85+
"split_services": false
86+
},
87+
{
88+
"platform": "MiLight",
89+
"name": "MiLight",
90+
"ip_address": "255.255.255.255",
91+
"port": 8899,
92+
"type": "rgbw",
93+
"delay": 30,
94+
"repeat": 3,
95+
"zones":["Kitchen Lamp","Bedroom Lamp","Living Room Lamp","Hallway Lamp"]
96+
},
97+
{
98+
"platform": "HomeAssistant",
99+
"name": "HomeAssistant",
100+
"host": "http://192.168.1.10:8123",
101+
"password": "XXXXX",
102+
"supported_types": ["light", "switch", "media_player", "scene"]
103+
},
104+
{
105+
"platform": "LIFx",
106+
"name": "LIFx",
107+
"access_token": "XXXXXXXX generate at https://cloud.lifx.com/settings"
108+
}
109+
],
110+
111+
"accessories": [
112+
{
113+
"accessory": "WeMo",
114+
"name": "Coffee Maker",
115+
"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.",
116+
"wemo_name": "CoffeeMaker"
117+
},
118+
{
119+
"accessory": "LiftMaster",
120+
"name": "Garage Door",
121+
"description": "This shim supports LiftMaster garage door openers that are already internet-connected to the 'MyQ' service.",
122+
// "requiredDeviceId", "<ID of door if you have multiple doors, prompted by shim during startup if needed>",
123+
"username": "your-liftmaster-username",
124+
"password" : "your-liftmaster-password"
125+
},
126+
{
127+
"accessory": "Lockitron",
128+
"name": "Front Door",
129+
"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.",
130+
"lock_id": "your-lock-id",
131+
"api_token" : "your-lockitron-api-access-token"
132+
},
133+
{
134+
"accessory": "Carwings",
135+
"name": "Leaf",
136+
"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.",
137+
"username": "your-carwings-username",
138+
"password" : "your-carwings-password"
139+
},
140+
{
141+
"accessory": "iControl",
142+
"name": "Xfinity Home",
143+
"description": "This shim supports iControl-based security systems like Xfinity Home.",
144+
"system": "XFINITY_HOME",
145+
"email": "your-comcast-email",
146+
"password": "your-comcast-password",
147+
"pin": "your-security-system-pin-code"
148+
},
149+
{
150+
"accessory": "HomeMatic",
151+
"name": "Light",
152+
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
153+
"ccu_id": "The XMP-API id of your HomeMatic device",
154+
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
155+
},
156+
{
157+
"accessory": "HomeMaticWindow",
158+
"name": "Contact",
159+
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
160+
"ccu_id": "The XMP-API id of your HomeMatic device (type HM-Sec-RHS)",
161+
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
162+
},
163+
{
164+
"accessory": "HomeMaticThermo",
165+
"name": "Contact",
166+
"description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)",
167+
"ccu_id_TargetTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
168+
"ccu_id_CurrentTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
169+
"ccu_id_ControlMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
170+
"ccu_id_ManuMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
171+
"ccu_id_AutoMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )",
172+
"ccu_ip": "The IP-Adress of your HomeMatic CCU device"
173+
},
174+
{
175+
"accessory": "X10",
176+
"name": "Lamp",
177+
"ip_address": "localhost:3000",
178+
"device_id": "E1",
179+
"protocol": "pl",
180+
"can_dim": true
181+
},
182+
{
183+
"accessory": "Http",
184+
"name": "Kitchen Lamp",
185+
"on_url": "https://192.168.1.22:3030/devices/23222/on",
186+
"off_url": "https://192.168.1.22:3030/devices/23222/off",
187+
"brightness_url": "https://192.168.1.22:3030/devices/23222/brightness/%b",
188+
"http_method": "POST"
189+
},
190+
{
191+
"accessory": "HttpHygrometer",
192+
"name": "Kitchen",
193+
"url": "http://host/URL",
194+
"http_method": "GET"
195+
},
196+
{
197+
"accessory": "HttpThermometer",
198+
"name": "Garage",
199+
"url": "http://home/URL",
200+
"http_method": "GET"
201+
},
202+
{
203+
"accessory": "ELKM1",
204+
"name": "Security System",
205+
"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.",
206+
"zone": "1",
207+
"host": "192.168.1.10",
208+
"port": "2101",
209+
"pin": "1234",
210+
"arm": "Away"
211+
},
212+
{
213+
"accessory": "AD2USB",
214+
"name": "Alarm",
215+
"description": "Arm, disarm, and status monitoring of the default partition for Honeywell/Ademco alarm systems. Requires network configured AD2USB interface",
216+
"host": "192.168.1.200", // IP address of the SER2SOCK service
217+
"port" : 4999, // Port the SER2SOCK process is running on
218+
"pin": "1234" // PIN used for arming / disarming
219+
},
220+
{
221+
"accessory": "Tesla",
222+
"name": "Tesla",
223+
"description": "This shim supports controlling climate control on the Tesla Model S.",
224+
"username": "tesla_email",
225+
"password" : "tesla_password"
226+
},
227+
{
228+
"accessory": "Hyperion",
229+
"name": "TV Backlight",
230+
"description": "Control the Hyperion TV backlight server. https://github.com/tvdzwan/hyperion",
231+
"host": "localhost",
232+
"port": "19444"
233+
},
234+
{
235+
"accessory": "mpdclient",
236+
"name" : "mpd",
237+
"host" : "localhost",
238+
"port" : 6600,
239+
"description": "Allows some control of an MPD server"
240+
},
241+
{
242+
"accessory": "FileSensor",
243+
"name": "File Time Motion Sensor",
244+
"path": "/tmp/CameraDump/",
245+
"window_seconds": 5,
246+
"sensor_type": "m",
247+
"inverse": false
248+
},
249+
{
250+
"accessory": "GenericRS232Device",
251+
"name": "Projector",
252+
"description": "Make sure you set a 'Siri-Name' for your iOS-Device (example: 'Home Cinema') otherwise it might not work.",
253+
"id": "TYDYMU044UVNP",
254+
"baudrate": 9600,
255+
"device": "/dev/tty.usbserial",
256+
"manufacturer": "Acer",
257+
"model_name": "H6510BD",
258+
"on_command": "* 0 IR 001\r",
259+
"off_command": "* 0 IR 002\r"
260+
}
261+
]
262+
}

‎readme.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
### rpi-homebridge
22

3-
A docker image that runs the [Homebridge](https://github.com/nfarina/homebridge) iOS HomeKit emulator on a raspberry pi.
3+
A docker image that runs the [Homebridge](https://github.com/nfarina/homebridge) iOS HomeKit emulator on raspberry pi
4+
5+
6+
#### usage
7+
8+
map a volume to the homebridge root directory containing your config.json file.
9+
10+
```
11+
$ docker run -d -p 0.0.0.0:51826:51826 -v /home/pi/rpi-homebridge:/root/.homebridge --net=host rpi-homebridge
12+
```

‎run.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf
4+
5+
dbus-daemon --system
6+
avahi-daemon -D
7+
8+
homebridge

0 commit comments

Comments
 (0)