forked from mongoose-os-apps/shelly-homekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mos.yml
371 lines (347 loc) · 14.1 KB
/
mos.yml
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
author: 'Deomid "rojer" Ryabkov'
description: A HomeKit firmware for Shelly switches
version: 2.4.0
platform: esp8266
libs_version: latest
modules_version: latest
mongoose_os_version: latest
sources:
- src
- src/${build_vars.MODEL}
filesystem:
- fs
config_schema:
# Try .gz-compressed html.
- ["http.index_files", "index.html,index.html.gz"]
- ["http.extra_headers", "Pragma: no-cache"]
- ["sntp.enable", true]
- ["debug.event_level", 3]
- ["file_logger.level", 3]
- ["file_logger.max_num_files", 1]
- ["file_logger.max_file_size", 16000]
- ["file_logger.buf_size", 1000]
- ["sw", "o", {"Switch settings"}]
- ["sw.name", "s", "", {"Name of the switch"}]
- ["sw.enable", "b", true, {"Enable this switch in the accessory"}]
- ["sw.in_mode", "i", 1, {"-1 - Absent, 0 - Momentary, 1 - Toggle, 2 - Edge, 3 - Detached"}]
- ["sw.state", "b", false, {"State of the switch"}]
- ["sw.svc_type", "i", 0, {"HAP service type, -1 = disable, 0 = switch, 1 = outlet, 2 = lock"}]
- ["sw.initial_state", "i", 3, {"Initial state on power-on: 0 - off, 1 - on, 2 - restore last state, 3 - matches input if in toggle mode, otherwise off"}]
- ["sw.auto_off", "b", false, {"Whether the switch should automatically turn OFF after turning ON"}]
- ["sw.auto_off_delay", "d", 0, {"Delay for automatically turning OFF, in seconds"}]
- ["ssw", "o", {"Stateless Switch settings"}]
- ["ssw.name", "s", "", {"Name of the switch"}]
- ["ssw.in_mode", "i", 0, {"0 - Momentary; 1 - Toggle, single press event on change; 2 - Toggle, on = single press, off = double press"}]
- ["wc", "o", {"Roller shutter settings"}]
- ["wc.name", "s", "Shutter 1", {"title": "Accessory name"}]
- ["wc.in_mode", "i", 0, {"title": "Input mode: 0 - separate, momentary; 0 - separate, toggle; 2 - single, momentary; 3 - detached"}]
- ["wc.swap_inputs", "b", false, {"title": "Swap inputs (2 - open, 1 - close)"}]
- ["wc.swap_outputs", "b", false, {"title": "Swap outputs (2 - open, 1 - close)"}]
- ["wc.calibrated", "b", false, {"title": "Calibration done"}]
- ["wc.idle_power_thr", "d", 10.0, {"title": "Power consumption threshold for motor idle detection"}]
- ["wc.move_power", "d", 0.0, {"title": "Power consumption during movement, watts"}]
- ["wc.move_time_ms", "i", 0, {"title": "Move time, in millseconds"}]
- ["wc.current_pos", "d", 0.0, {"title": "Last position, percent: 0 - fully closed, 100 - fully open."}]
- ["gdo", "o", {"Garage door settings"}]
- ["gdo.name", "s", "Garage Door", {"title": "Accessory name"}]
- ["gdo.close_sensor_mode", "i", 0, {"title": "Close sensor mode: 0 - normally closed, 1 - normally open"}]
- ["gdo.open_sensor_mode", "i", 0, {"title": "Close sensor mode: 0 - normally closed, 1 - normally open, 2 - disabled"}]
- ["gdo.out_mode", "i", 0, {"title": "Output mode: 0 - single (open=close=1), 1 - dual (1=open, 2=close)"}]
- ["gdo.move_time_ms", "i", 30000, {"title": "Movement time, ms"}]
- ["gdo.pulse_time_ms", "i", 300, {"title": "Output active time, ms"}]
- ["shelly.name", "s", "", {"title": "User-facing device name"}] # Note: will be overridden by cfg 2 -> 3 migration.
- ["shelly.mode", "i", 0, {"System mode: 0 - default, 1 - roller shutter (if supported), 2 - garage door opener (if supported)"}]
- ["shelly.cfg_version", "i", 0, {"Configuration version"}]
- ["shelly.legacy_hap_layout", "b", false, {"Use legacy accessory layout instead of a bridged accessory"}]
- ["shelly.overheat_on", "i", 100, {"Overheat protection mode kicks in at or above this temperature"}]
- ["shelly.overheat_off", "i", 90, {"Overheat protection mode turns off when the temperature is back below this threshold"}]
# Deprecated settings, only kept to enable migration.
- ["sw.persist_state", "b", false, {"Deprecated"}] # Since cfg v1
build_vars:
# Enables storing setup info in the config and a simple RPC service to configure it.
MGOS_HAP_SIMPLE_CONFIG: 1
cdefs:
PRODUCT_VENDOR: '"Allterco"'
PRODUCT_MODEL: '"${build_vars.MODEL}"'
LED_GPIO: -1
BTN_GPIO: -1
HAP_LOG_LEVEL: 0 # This saves ~44K on esp8266.
libs:
- origin: https://github.com/mongoose-os-libs/core
- origin: https://github.com/mongoose-os-libs/file-logger
- origin: https://github.com/mongoose-os-libs/homekit-adk
- origin: https://github.com/mongoose-os-libs/mqtt
- origin: https://github.com/mongoose-os-libs/ota-http-server
- origin: https://github.com/mongoose-os-libs/rpc-service-config
- origin: https://github.com/mongoose-os-libs/rpc-service-fs
- origin: https://github.com/mongoose-os-libs/rpc-service-ota
- origin: https://github.com/mongoose-os-libs/rpc-uart
- origin: https://github.com/mongoose-os-libs/http-server
- origin: https://github.com/mongoose-os-libs/rpc-mqtt
- origin: https://github.com/mongoose-os-libs/rpc-ws
- origin: https://github.com/mongoose-os-libs/sntp
conds:
- when: build_vars.MODEL == "Shelly1"
apply:
name: switch1 # To allow OTA from stock fw.
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000 # To be compatible with stock firmware.
MGOS_ROOT_FS_TYPE: SPIFFS
# We don't need the cryptochip support. Saves approx 12K flash.
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHSW-1"'
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shelly1-??????"]
- ["shelly.name", "shelly1-??????"]
- ["wifi.ap.ssid", "shelly1-??????"]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.name", "Shelly SW"]
- ["ssw1", "ssw", {"title": "SSW1 settings"}]
- ["ssw1.name", "Input"]
- ["gdo1", "gdo", {"title": "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
- when: build_vars.MODEL == "Shelly1PM"
apply:
name: switch1pm # To allow OTA from stock fw.
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000 # To be compatible with stock firmware.
MGOS_ROOT_FS_TYPE: SPIFFS
# We don't need the cryptochip support. Saves approx 12K flash.
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
LED_GPIO: 0
LED_ON: 0
BTN_GPIO: 2
BTN_DOWN: 0
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHSW-PM"'
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shelly1pm-??????"]
- ["shelly.name", "shelly1pm-??????"]
- ["wifi.ap.ssid", "shelly1pm-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.name", "Shelly SW"]
- ["ssw1", "ssw", {"title": "SSW1 settings"}]
- ["ssw1.name", "Input"]
- ["gdo1", "gdo", {"title": "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
# Note this is also known as "ShellyPlug 2", as opposed to the original Plug
# which was based on CC3200. However, that one is long gone and we can ignore it.
- when: build_vars.MODEL == "ShellyPlug"
apply:
name: shelly-plug2 # To allow OTA from stock fw.
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
build_vars:
# Note: 4 MB flash chip
FS_SIZE: 262144
MGOS_ROOT_FS_TYPE: SPIFFS
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
LED_GPIO: 13 # Green, 14 red, 16 blue.
LED_ON: 0
BTN_GPIO: 12
BTN_DOWN: 1
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHPLG2-1"'
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shellyplug-??????"]
- ["shelly.name", "shellyplug-??????"]
- ["wifi.ap.ssid", "shellyplug-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.name", "Shelly Plug"]
- ["sw1.in_mode", -1]
- ["sw1.initial_state", 2]
- when: build_vars.MODEL == "ShellyPlugS"
apply:
name: shelly-plug-s # To allow OTA from stock fw.
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x7000 # To be compatible with stock firmware.
MGOS_ROOT_FS_TYPE: SPIFFS
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
LED_GPIO: 0
LED_ON: 0
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHPLG-S"'
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shellyplug-s-??????"]
- ["shelly.name", "shellyplug-s-??????"]
- ["wifi.ap.ssid", "shellyplug-s-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.name", "Shelly SW"]
- ["sw1.in_mode", -1]
- ["sw1.initial_state", 2]
- when: build_vars.MODEL == "Shelly2"
apply:
name: switch
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000
MGOS_ROOT_FS_TYPE: SPIFFS
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHSW-21"'
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shellyswitch21-??????"]
- ["shelly.name", "shellyswitch21-??????"]
- ["wifi.ap.ssid", "shellyswitch21-??????"]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.name", "Shelly SW1"]
- ["ssw1", "ssw", {"title": "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["sw2", "sw", {"title": "SW2 settings"}]
- ["sw2.name", "Shelly SW2"]
- ["ssw2", "ssw", {"title": "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- ["gdo1", "gdo", {"title": "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- when: build_vars.MODEL == "Shelly25"
apply:
name: switch25
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
- origin: https://github.com/mongoose-os-libs/ade7953
version: master # Until 2.18 is out.
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000
MGOS_ROOT_FS_TYPE: SPIFFS
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
LED_GPIO: 0
LED_ON: 0
BTN_GPIO: 2
BTN_DOWN: 0
PRODUCT_HW_REV: '"2.5"'
STOCK_FW_MODEL: '"SHSW-25"'
MG_ENABLE_SSL: 0
SHELLY_HAVE_PM: 1
config_schema:
- ["device.id", "shellyswitch25-??????"]
- ["shelly.name", "shellyswitch25-??????"]
- ["wifi.ap.ssid", "shellyswitch25-??????"]
- ["i2c.enable", true]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.name", "Shelly SW1"]
- ["ssw1", "ssw", {"title": "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["sw2", "sw", {"title": "SW2 settings"}]
- ["sw2.name", "Shelly SW2"]
- ["ssw2", "ssw", {"title": "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- ["wc1", "wc", {"title": "WC1 settings"}]
- ["wc1.name", "Window 1"]
- ["gdo1", "gdo", {"title": "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- when: mos.platform != "ubuntu"
apply:
config_schema:
- ["wifi.ap.pass", ""]
- ["wifi.ap.keep_enabled", false]
- ["wifi.ap.ip", "192.168.33.1"]
- ["wifi.ap.gw", ""]
- ["wifi.ap.dhcp_start", "192.168.33.2"]
- ["wifi.ap.dhcp_end", "192.168.33.100"]
libs:
- origin: https://github.com/mongoose-os-libs/adc
- origin: https://github.com/mongoose-os-libs/wifi
- when: build_vars.MODEL == "ShellyI3"
apply:
name: ix3
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: esp8266-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
- origin: https://github.com/mongoose-os-libs/rpc-service-gpio
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000
MGOS_ROOT_FS_TYPE: SPIFFS
MGOS_MBEDTLS_ENABLE_ATCA: 0
cdefs:
PRODUCT_MODEL: '"Shelly-i3"'
PRODUCT_HW_REV: '"1.0"'
MG_ENABLE_SSL: 0
# HAP_LOG_LEVEL: 0
LED_GPIO: 5
LED_ON: 0
BTN_GPIO: 4
BTN_DOWN: 0
config_schema:
- ["device.id", "shellyix3-????????????"]
- ["wifi.ap.ssid", "shellyix3-????????????"]
- ["ssw1", "ssw", {"title": "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["ssw2", "ssw", {"title": "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- ["ssw3", "ssw", {"title": "SSW3 settings"}]
- ["ssw3.name", "Input 3"]
- when: mos.platform == "ubuntu"
apply:
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '""'
MG_ENABLE_SSL: 0
libs:
- origin: https://github.com/mongoose-os-libs/mbedtls
variant: ubuntu-noatca
- origin: https://github.com/mongoose-os-libs/mongoose
variant: ubuntu-nossl
config_schema:
- ["device.id", "ShellyU-????"]
- ["shelly.name", "ShellyU-????"]
- ["file_logger.dir", "./"]
- ["http.document_root", "."]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.name", "SW"]
- ["sw1.in_mode", -1]
manifest_version: 2020-01-29