-
Notifications
You must be signed in to change notification settings - Fork 1
/
home_example.ini
375 lines (351 loc) · 19.1 KB
/
home_example.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
; THIS FILE NEEDS TO BE RENAMED TO home.ini AFTER FULL CONFIGURATION
; Homeserver configuration file
; RPi3 related configurables
[SERVER]
; The RPI3 IP address
HOST = 000.000.000.000
; The RPI3 server port. Must be accessible thru firewall
PORT = 1111
; Allows to choose the VOICE server port, if the ifttt or dialogflow module is active
VOICE_SERVER_PORT = 1234
; Allows to choose the webserver port, if the webserver module is active
WEBSERVER_PORT = 8080
; Enables file journaling
JOURNALING = True
; Journal files. Any time a path is required in config files, you may use BASEDIR as the location of the home.py python script itself.
JOURNAL_DIR = BASEDIR/journals
; Hour of day to start accepting TCP socket-based requests, in hh:mm format
TCP_START_HOUR = 18:00
; Hour of day to start refusing TCP socket-based requests, in hh:mm format
TCP_END_HOUR = 23:30
; Loads the tensorflow DNN apparatus and enables wifi-rtt requests (android app not yet published)
ENABLE_WIFI_RTT = false
; Enables or disables logged and in-file debug
ENABLE_DEBUG = True
; Number of history debug files to keep
MAX_DEBUG_FILES = 3
; Modules to load
MODULES = webserver,ifttt,detector,backup,weblog,updater,timesched
; Time (in seconds) before a device state change request times out. Increase if you have slow-communicating devices or stability issues.
REQUEST_TIMEOUT = 10
; Available languages up to now: en, fr
LANGUAGE = en
[USERS]
; Known users for the homeserver. Allows to link devices IPs with their users, or "_" if user has no associated device.
; This is required to authenticate some user to the webserver when security is set to "restrictive"
; Also shows the user's first name in the detector module
John Smith = 192.168.1.34,192.168.1.54
Kitty Cat = _
[TIMESCHED]
; DEFAULT_EVENT_HOUR - The "default" starting hour for devices to accept AUTOMATIC requests. Useful for some kinds of devices such as lamps to make sure that they do not turn on during the day. You can either set this to a time of day (HH:mm format, such as 18:00) or to 'auto' - which will set this to the sunset time at your EVENT_LOCALIZATION (see below) every day.
DEFAULT_EVENT_HOUR = auto
; DEFAULT_EVENT_HOUR_STOP - Same as the above, but the end time. If set to 'auto' - will be set to the sunrise time at your localization every day.
DEFAULT_EVENT_HOUR_STOP = auto
; Defines which localization parser to use. "python" (default) uses the Astral module to find your localization and sunset/sunrise times (more precise but not all cities are available). "bash" uses the older script to fetch your localization from weather.com (see the EVENT_LOCALIZATION help)
EVENT_LOCALIZATION_PARSER = python
; Current localization. If EVENT_LOCALIZATION_PARSER is set to "bash", set this code using https://weather.com/weather/today/l/(THIS IS THE CODE), when searching for your city. Otherwise (python), this should be the name of your city (for example: New York)
EVENT_LOCALIZATION = New York
; NEW_DAY_RESET_HOUR - time to perform the new day maintenance (see below options). If set to 'auto' - will execute them at sunrise. You may want to set this before anyone uses the homeserver.
NEW_DAY_RESET_HOUR = auto
; If true, will set all devices back to AUTO mode on the next day
; You might want to keep it True, as setting a device as MANUAL on the last day will prevent non-automatic functions from changing its state
; - if this is set to False - on the next day also
FALLBACK_AUTO_ON_NEW_DAY = True
; If true, will attempt to automatically reconnect all disabled/offline devices on new day
AUTO_RECONNECT_ON_NEW_DAY = True
; Optionals. DEVICES state change active time. These are the times when devices start accepting state change requests (format: DEVICE# - as listed below - = HH:mm-HH:mm, where the first time is the time to accept requests and the second is the end time). For example, DEVICE0 = 18:00-5:00 will force DEVICE #0 to accept requests only between 18:00PM and 5:00AM (day+1). Setting a device to 'auto' will set the times from sunset to sunrise (nighttime). Setting a device manually or using a specific device button from the webserver overrides these. Also useful when you use group requests (such as voice requests in IFTTT) and do not want some devices from that group from being enabled/disabled during a period of time.
DEVICE0 = auto
DEVICE1 = auto
DEVICE5 = auto
DEVICE6 = 05:00-19:00
DEVICE7 = auto
DEVICE8 = 18:00-06:00
DEVICE9 = auto
[WEBSERVER]
; Security level, either "restrictive" (connected devices IPs MUST be in the USERS list) or "permissive" (any user can connect)
SECURITY = restrictive
; Optional. Set some device groups as rooms. The devices will be merged together on the webserver interface.
ROOM_GROUPS = livingroom,kitchen
; Optional. Hide presets that should not be used via the webinterface, such as internal commands
HIDDEN_PRESETS = all_on,all_of
; Protocol used to connect to IFTTT module, either http or https. If you do not have a SSL key, use http
PROTOCOL = http
WEBSERVER_HTTPS_CERTS_KEY =
WEBSERVER_HTTPS_CERTS_CERT =
; Device-on-lan IP detection and event triggering configurables
[DETECTOR]
; RUN_TIME *optional* can be applied to any module and depends on the TIMESCHED module. Allows to enable a module during specific hours (default: always).
; Useful for stopping certain functions, for example stop the detector during nighttime or ifttt when not required or not at home.
RUN_TIME = 06:00-23:00
; Local IPs to track status. Comma-separated. You can also add untracked users using an underscore "_" which will show their picture on the webui only.
TRACKED_IPS = 192.168.1.60,192.168.1.70,_
; Optional. This allows to show a picture of the people who owns the devices listed in TRACKED_IPS on the webserver as well as
; their presence status. Pictures are stored in the /web/images folder and you must provide the same number of pictures as
; there are TRACKED_IPS. Comma-separated.
TRACKED_PICTURES = myself.jpg,mycatwhoownsacellphone.jpg,someperson.jpg
; Number of successful pings required to trigger an event change
; Needed because some devices do turn off and on their wifi from time to time
MAX_STATE_LEVEL = 3
; Ping frequency in seconds
PING_FREQ_SEC = 10
; If true, will set all devices back to AUTO mode when tracked IPs are all offline.
FALLBACK_AUTO_ON_DISCONNECT = True
; DETECTOR EVENTS
; All detector events. These should refer to presets as defined in the PRESETS section
; ON EVENT HOUR EVENT - Event to run when EVENT_TIME (as defined in SERVER) is reached and/or has already passed and at least one device is detected
ON_EVENT_HOUR_EVENT = livingroom-on
; ON_ALL_DISCONNECT_EVENT - Event that runs when all devices are disconnected during active DETECTOR hours. Useful for turning everything off.
ON_ALL_DISCONNECT_EVENT = all-off
; ON_DEVICE_CONNECT_EVENT - Event to run when a device is connected, even before EVENT_HOUR.
ON_DEVICE_CONNECT_EVENT =
; ON_DEVICE_DISCONNECT_EVENT - Event to run when a device is disconnected, even before EVENT_HOUR.
ON_DEVICE_DISCONNECT_EVENT =
; ON_EVENT_HOUR_DEVICE_CONNECT_EVENT - Event to run when a device is connected after EVENT_HOUR. Will run with ON_DEVICE_CONNECT_EVENT if both are set.
ON_EVENT_HOUR_DEVICE_CONNECT_EVENT = tplink-on
; ON_EVENT_HOUR_DEVICE_CONNECT_EVENT - Event to run when a device is disconnected after EVENT_HOUR.
ON_EVENT_HOUR_DEVICE_DISCONNECT_EVENT =
[UPDATER]
; Configurations for the updater module
; UPDATER_HOUR sets the hour-of-day to perform update check (here 10AM). If an update is found and AUTOMATIC_UPDATE is True, will perform
; a git fetch + reset to master of the Homeserver repo and a reboot of the server, so you may want to set this to a time when the server is
; not used and when most devices are OFF
UPDATER_HOUR = 10
; AUTOMATIC_UPDATE True automatically fetches the updated version and restarts the Homeserver. Set it to False to add a Update Now button
; to the webserver itself for more control
AUTOMATIC_UPDATE = True
; UPDATE_PYTHON_PACKAGES True automatically reads the requirements file after an update and pip installs the required python packages
UPDATE_PYTHON_PACKAGES = True
[TCP-PRESETS]
AUTOMATIC_MODE = True
livingon = {'on':True, 'group':['livingroom','lights']}
livingoff = {'off':True, 'group':['livingroom','lights']}
; IFTTT server-related configurables
[IFTTT]
; Here you might want to set AUTOMATIC_MODE to False as these presets are executed by yourself vocally, and not by
; some automatic device... usually.
AUTOMATIC_MODE = False
; Random SALT string. Used in custom actions listed below
SALT = asaltstring
; Protocol used to connect to IFTTT module, either http or https. If you do not have a SSL key, use http
PROTOCOL = http
; When named, priority groups will trigger a device mode change to MANUAL, preventing automatic devices from changing these
; devices afterwards.
; This is useful when you want to create turn on/off requests and then let the devices be controlled by some software, like
; Kodi. In this example below, saying "turn on the living room" would change the state of all living room devices but leave
; them in AUTO mode (so the presets/TCP/FIND3/detector would still work on them), but saying "turn on the living room lights"
; would turn on the living room lights and leave them in MANUAL mode, as you said a priority group (lights).
; Does nothing if IFTTT is configured as AUTOMATIC_MODE = True.
PRIORITY_GROUPS = lights,television
; Global group name, such as 'home', that applies to all devices.
GLOBAL_GROUP = home
; Link to SSL key and cert, if using https. Otherwise leave both empty. Paths can be absolute or relative to BASEDIR.
IFTTT_HTTPS_CERTS_KEY = BASEDIR/../mykeys/some-cert-key.key
IFTTT_HTTPS_CERTS_CERT = /path/to/some-cert-dir/some-cert.cer
; List actions below, as: ACTION = PRESET_TO_RUN_ON_ACTION
; Your IFTTT Webhook should POST with a content_type application/x-www-form-urlencoded and a body:
; action=SOME_ACTION_STRING&hash=LOWERCAPS_SHA512_OF_SALT+ACTION for these actions.
; Otherwise you might want to create a generic webhook, with google assistant sending a text element
; and a body: group={{TextField}}&function=(on or off)
; This will turn on or off anything you say via the text element (groups) without any custom action
; configuration here.
some_action = agroup-delayed-off
some_other_action = some-other-preset
; DIALOGFLOW server-related configurables. Not required if not used
[DIALOGFLOW]
; Dialogflow requires a HTTPS server. You can get free SSL certs and keys using the ACME script.
DIALOGFLOW_HTTPS_CERTS_KEY = /path/to/key.key
DIALOGFLOW_HTTPS_CERTS_CERT = /path/to/cert.cert
AUTOMATIC_MODE = False
; List of presets, listed as PRESET_NAME = {PRESET_STRING}
; Use the preset editor on the webserver to generate this
; These are JSON-type strings that sends {'OPTION':Value} to the homeserver. See below for examples.
[PRESETS]
AUTOMATIC_MODE = True
; {'tplinkswitch':['-1','-1','1for120']} here sends states -1 (ignore), -1 (ignore) and 1for120 to tplinkswitch 1, 2 and 3. In that case, it is used to
; set the third switch to ON (state 1) for 120 seconds, then it turns it off. Useful for turning lights ON when you come home at night!
tplink-on = {'tplinkswitch':['-1','-1','1for120']}
all_off = {'off':True, 'skip_time':True}
all_on = {'on':True, 'skip_time':True}
; {'on':True, 'group':['livingroom','lights']} sends the DEVICE_ON state (by setting 'on' as True) to all devices from the livingroom AND lights groups.
livingroom-on = {'on':True, 'group':['livingroom','lights']}
; You can also use hexvalues and select the device to change using 'deviceid#:devicestate'
agroup-delayed-off = {'hexvalues':['8:0', '11:0'], 'reset-mode':True, 'group':['agroup'], 'delay':30}
some-other-preset = {'milight':['0','1'], 'reset-mode':True, 'group':['agroup']}
; BACKUP Module - allows you to backup specific linux Computers folders (including the RPi) to another
; Computer backup server. Both the clients and the backup server must either be the homeserver itself
; or a Computer-type device in this ini config.
; If you want to use the backup module without controlling your devices with Homeserver, you
; may want to add the devices with the COLOR_TYPE = noop configuration entry.
; The backups are incremental and compression is on by default.
[BACKUP]
; Delay in hours between each backups
DELAY_BETWEEN_BACKUPS = 23
; Backup server. Either write the DEVICE# of a Computer-type device or "local" to backup to the server itself
BACKUP_SERVER = 3
; Whether to launch a ON request to power-on the backup server and turn it off after the backups
BACKUP_SERVER_FORCE_ON = False
;
; Client configurations (DEVICE# or "local"). Always append each CLIENT# with a number starting from zero
; This is the first machine to backup to the server, aka CLIENT0
;
; Client 0 is DEVICE10
CLIENT0 = 10
; Whether to launch a ON request to power-on the client and turn it off after the backups
CLIENT0_FORCE_ON = False
; List of folders to backup, separated by ","
CLIENT0_FOLDERS = /home/myuser/Documents,/home/myuser/Téléchargements,/home/myuser/Images
; Destination folder on the server
CLIENT0_DESTINATION = /storage/backups/myuser
; Whether to delete files that are also deleted on CLIENT on the backup server (true sync)
CLIENT0_DELETE = True
;
; This is the second machine to backup. In this case, this is the backup server itself (you can send
; files on different disks from the same machine like that)
;
CLIENT1 = 3
CLIENT1_FORCE_ON = False
CLIENT1_FOLDERS = /home/myotheruser
CLIENT1_DESTINATION = /storage/backups/myotheruser
CLIENT1_DELETE = True
; Device configurations, listed as DEVICE0 ... DEVICE1 ... DEVICE#
; Available devices: Milight, Playbulb, DecoraSwitch
[DEVICE0]
TYPE = DecoraSwitch
; Name of device as configured in the Decora (MyLeviton) mobile app
DEVICE = A_Name
; Optional - a display name for the webserver. Will fall back to DEVICE if not defined
NAME = My Light
; Email address of MyLeviton account
EMAIL = aaa@aaa.com
; Password of MyLeviton account
PASSWORD = abcd
; Description of device
DESCRIPTION = Some Description
; Group(s) of devices (for example: same-room devices), comma separated
GROUP = agroup,asubgroup
; Default ON state intensity
DEFAULT_INTENSITY = 2
[DEVICE1]
TYPE = Playbulb
; BLE MAC address of playbulb device
ADDRESS = 00:11:22:33:44:55
; Optional - Sets a device name for the webserver. Can be applied to any device
NAME = Passageway lights
DESCRIPTION = Some playbulb
GROUP = passage,lights
; DEFAULT_INTENSITY can receive any base value, from 0-100% white intensity to ARGB color codes
DEFAULT_INTENSITY = 5
; *Not required* Always skip the time check for this device. Can be applied to any device. Default = False
SKIPTIME = True
; *Not required* Always send a OFF request, even if the state is already OFF. Can be applied to any device. Default = True
FORCEOFF = True
; *Not required* Add an icon to the device header for the webserver. Go to https://fontawesome.com/icons and note the full <i> class
; of the chosen icon in this property (usually fa(s)(r) fa-(name-of-icon))
ICON = fas fa-traffic-light
; RETRY_DELAY_ON_FAILURE - Optional. Allows to schedule another state change (retry) after # seconds if the initial request failed.
RETRY_DELAY_ON_FAILURE = 10
[DEVICE2]
TYPE = Milight
; BLE MAC address of milight device
ADDRESS = 00:11:22:33:44:55
; For the following values, see https://github.com/moosd/ReverseEngineeredMiLightBluetooth/blob/master/getid.py
; Default brightness level from 1% (1) to 100% (100)
DEFAULT_INTENSITY = 50
; Default white temperature (approx.) from 2000K (2000 - yellowish) to 6500K (6500 - blueish)
DEFAULT_TEMP = 2700
ID1 = 80
ID2 = 112
DESCRIPTION = Some milight
GROUP = passage,lights
[DEVICE3]
TYPE = Computer
; Name of device
DEVICE = HTPC
DESCRIPTION = living room HTPC
GROUP = livingroom,tv
; Computer IP address and MAC address (for wakeonlan)
IP_ADDRESS = 192.168.1.2
ADDRESS = 00:11:22:33:44:55
; User to log in via SSH
SSH_USER = my_user
SKIPTIME = True
FORCEOFF = True
; *Not required* IGNOREMODE = True allows state changes independent of the actual mode. Useful for devices that should
; always be triggered by some automatic detector even though it was manually changed before - via the webserver for example.
IGNOREMODE = True
; *Not requires* ACTION_DELAY = (seconds) allows a time delay before querying the device state. Useful for devices that
; have a boot-time delay, or lag, before they reach their final state (for example, wakeonlan and PCs). This should
; be the expected delay between the ON= request and the proper state return from the STATE= command.
ACTION_DELAY = 20
[DEVICE4]
; This is a CEC capable, HDMI connected Tv directly to the RPi (any input port on tv)
TYPE = HDMITv
DEVICE = TV
DESCRIPTION = living room TV
GROUP = livingroom,tv
IGNOREMODE = True
; MANDATORY_VOICE_GROUP - Optional. Only run a device change from IFTTT when a specific group is spelled. Useful when you do not want to turn on/off
; a device in a room using less precise requests, such a "Turn on the living room" in this case.
MANDATORY_VOICE_GROUP = tv
[DEVICE5]
TYPE = GenericOnOff
DEVICE = Sound-system
DESCRIPTION = Living room sound station
GROUP = livingroom,tv
; Some bash/sh command to run when device state should be ON
ON = irsend SEND_ONCE some-device POWER
; Some bash/sh command to run when device state should be OFF
OFF = irsend SEND_ONCE some-device POWER
; If no command exists to find device state, set to nothing
STATE =
; If this following string is found in the output (stdout) of the STATE command, consider device as ON.
STATE_ON_EXPECT =
RESTART = None
SKIPTIME = True
FORCEOFF = False
IGNOREMODE = True
; STATE_INFERENCE_GROUP is a last resort option for devices fulfilling three conditions: - A high state change failure rate, - A high probability
; chance that the device will have the same state as other devices from a group, - A device that has no means of knowing its state in real-time
; programatically. In other words, this is a device that you would often switch manually, like a sound system connected via a IR controller that often
; fails, and that its state often follows the other devices in the same group (such as a TV or a HTPC). The required value is the group name itself.
STATE_INFERENCE_GROUP = tv
[DEVICE6]
TYPE = MerossSwitch
ADDRESS = 00:11:22:33:44:55
EMAIL = your@email.com
PASSWORD = your_password
DESCRIPTION = Some description
GROUP = livingroom,lights
[DEVICE7]
TYPE = TPLinkSwitch
DEVICE = some_room
; The device IP address as found in the TP Link mobile app after configuration
IP_ADDRESS = 192.168.1.000
DESCRIPTION = Smart switch in some room
GROUP = lights,room_name
[DEVICE8]
TYPE = Computer
DEVICE = MyComputer
DESCRIPTION = my own personal laptop
IP_ADDRESS = 192.168.1.3
ADDRESS = 11:22:22:33:44:66
; User to log in via SSH
SSH_USER = my_user
; COLOR_TYPE can be applied to all compatible device and forces the input color/state type (as defined in the convert module)
;
; Type noop - the device is not-editable (it only get its state). Useful if you simply want to know if your device is on or off
; or connect it to a module (for example the backup module)
COLOR_TYPE = noop
ICON = fas fa-laptop
[DEVICE9]
TYPE = TPLinkSwitch
NAME = Kitchen lights
DEVICE = kitchen
IP_ADDRESS = 192.168.1.4
DESCRIPTION = Kitchen
GROUP = lights,home,kitchen
; This allows sending brightness (0-100%) values to the TPLink switch (for HS220 devices and dimmer switches)
DIMMABLE = True
; Default brightness (in %) when device is turned ON by the homeserver
DEFAULT_INTENSITY = 2
ICON = fas fa-lightbulb