forked from mongoose-os-apps/shelly-homekit
-
Notifications
You must be signed in to change notification settings - Fork 5
/
mos.yml
668 lines (635 loc) · 27.2 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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
author: Shelly-HomeKit contributors
description: A HomeKit firmware for Shelly switches
version: 2.11.0-alpha1
libs_version: latest
modules_version: latest
mongoose_os_version: latest
sources:
- src
- src/mock
- src/BL0937
- src/${build_vars.MODEL}
includes:
- src
filesystem:
- fs
config_schema:
- ["debug.event_level", 3]
- ["dns_sd.txt", "fw_type=homekit"] # To be easily distinguishable from stock.
- ["file_logger.level", 3]
- ["file_logger.max_num_files", 1]
- ["file_logger.max_file_size", 16000]
- ["file_logger.buf_size", 1000]
- ["http.auth_algo", 1] # SHA-256
- ["http.auth_domain", ""]
- ["rpc.auth_algo", 1] # SHA-256
- ["rpc.auth_domain", ""]
- ["sntp.enable", true]
- ["shelly.name", "s", "", {title: "User-facing device name"}] # Note: will be overridden by cfg 2 -> 3 migration.
- ["shelly.mode", "i", 0, {title: "System mode: 0 - default, 1 - roller shutter (if supported), 2 - garage door opener (if supported), 3 - RGB (if supported), 4 - RGBW (if supported)"}]
- ["shelly.cfg_version", "i", 0, {title: "Configuration version"}]
- ["shelly.legacy_hap_layout", "b", false, {title: "Use legacy accessory layout instead of a bridged accessory"}]
- ["shelly.overheat_on", "i", 100, {title: "Overheat protection mode kicks in at or above this temperature"}]
- ["shelly.overheat_off", "i", 90, {title: "Overheat protection mode turns off when the temperature is back below this threshold"}]
- ["sw", "o", {title: "Switch settings", abstract: true}]
- ["sw.name", "s", "", {title: "Name of the switch"}]
- ["sw.enable", "b", true, {title: "Enable this switch in the accessory"}]
- ["sw.out_inverted", "b", false, {title: "Invert output, set to true for normally open output"}]
- ["sw.in_mode", "i", 1, {title: "-1 - Absent, 0 - Momentary, 1 - Toggle, 2 - Edge, 3 - Detached"}]
- ["sw.in_inverted", "b", false, {title: "Invert input, set to true for normally closed input"}]
- ["sw.state", "b", false, {title: "State of the switch"}]
- ["sw.svc_type", "i", 0, {title: "HAP service type, -1 = disable, 0 = switch, 1 = outlet, 2 = lock, 3 = valve"}]
- ["sw.valve_type", "i", 1, {title: "HAP valve type (if svc is 3), -1 = disable, 0 = GenericValve, 1 = Irrigation"}] # see for details about non supported types https://github.com/mongoose-os-apps/shelly-homekit/issues/510
- ["sw.initial_state", "i", 3, {title: "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, {title: "Whether the switch should automatically turn OFF after turning ON"}]
- ["sw.auto_off_delay", "d", 0, {title: "Delay for automatically turning OFF, in seconds"}]
- ["sw.state_led_en", "i", -1, {title: "State LED: -1 - unsupported by device, 0 - off, 1 - on"}]
- ["in", "o", {title: "Detached Input settings", abstract: true}]
- ["in.type", "i", 3, {title: "HAP service type, 3 - Stateless switch, 7 - Motion sensor, 8 - Occupancy sensor, 6 - Disabled"}]
- ["in.inverted", "b", false, {title: "Invert input, set to true for normally closed input"}]
- ["in.ssw", "o", {title: "Stateless Switch settings"}]
- ["in.ssw.name", "s", "", {title: "Name of the switch"}]
- ["in.ssw.in_mode", "i", 0, {title: "0 - Momentary; 1 - Toggle, single press event on change; 2 - Toggle, on = single press, off = double press"}]
- ["in.sensor", "o", {title: "Motion Sensor settings"}]
- ["in.sensor.name", "s", "", {title: "Name of the sensor"}]
- ["in.sensor.in_mode", "i", 0, {title: "0 - Level, 1 - Pulse"}]
- ["in.sensor.idle_time", "i", 15, {title: "In pulse mode, go back to 'no motion' after no pulse received within this interval"}]
- ["wc", "o", {title: "Roller shutter settings", abstract: true}]
- ["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.man_cal", "b", false, {title: "Manual Calibration active"}]
- ["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.move_time_limit_pos_ms", "i", 0, {title: "Move time to limit position, in milliseconds"}]
- ["wc.max_ramp_up_time_ms", "i", 5000, {title: "Maximum ramp up time, in millseconds"}]
- ["wc.current_pos", "d", 0.0, {title: "Last position, percent: 0 - fully closed, 100 - fully open."}]
- ["gdo", "o", {title: "Garage door settings", abstract: true}]
- ["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.begin_move_time_ms", "i", 7000, {title: "Time allowed for movement to begin, ms"}]
- ["gdo.pulse_time_ms", "i", 300, {title: "Output active time, ms"}]
- ["lb", "o", {title: "Light bulb settings", abstract: true}]
- ["lb.name", "s", "Light bulb", {title: "Accessory name"}]
- ["lb.enable", "b", true, {title: "Enable this light in the accessory"}]
- ["lb.in_mode", "i", 1, {title: "-1 - Absent, 0 - Momentary, 1 - Toggle, 2 - Edge, 3 - Detached"}]
- ["lb.in_inverted", "b", false, {title: "Invert input, set to true for normally closed input"}]
- ["lb.state", "b", false, {title: "State of the light"}]
- ["lb.hue", "i", 0, {title: "Hue of the light"}]
- ["lb.brightness", "i", 100, {title: "Brightness of the light"}]
- ["lb.saturation", "i", 100, {title: "Saturation of the light"}]
- ["lb.initial_state", "i", 3, {title: "Initial state on power-on: 0 - off, 1 - on, 2 - restore last state, 3 - matches input if in toggle mode, otherwise off"}]
- ["lb.auto_off", "b", false, {title: "Whether the switch should automatically turn OFF after turning ON"}]
- ["lb.auto_off_delay", "d", 0, {title: "Delay for automatically turning OFF, in seconds"}]
- ["lb.transition_time", "i", 2000, {title: "Time in milliseconds how long a transition will take"}]
- ["_const.rpc_acl", "s", '[{"ch_type": "UART", "acl": "*"},{"method": "Shelly.GetInfo", "acl": "*"},{"method": "*", "ch_type": "HTTP", "acl": "admin"},{"method": "*", "ch_type": "WS_in", "acl": "admin"}]', {}]
# Preserved from stock.
- ["k_apparent", "i", 1750000, {}]
- ["max_power", "i", 1800, {}]
# Deprecated settings, only kept to enable migration.
- ["sw.persist_state", "b", false, {}] # Since cfg v1
- ["ssw", "o", {abstract: true}]
- ["ssw.name", "s", "", {}]
- ["ssw.in_mode", "i", 0, {}]
build_vars:
# BLE disabled for most models.
MGOS_HAP_BLE: 0
# Enables storing setup info in the config and a simple RPC service to configure it.
MGOS_HAP_SIMPLE_CONFIG: 1
MGOS_FW_EXTRA_ATTRS: shelly_hk_model=${build_vars.MODEL}
cdefs:
PRODUCT_VENDOR: '"Allterco"'
PRODUCT_MODEL: '"${build_vars.MODEL}"'
LED_GPIO: -1
BTN_GPIO: -1
BTN_NOISY: 1
RST_GPIO_INIT: -1
SHELLY_HAVE_DUAL_INPUT_MODES: 0
libs:
- location: ./libreset
- location: https://github.com/mongoose-os-libs/core
- location: https://github.com/mongoose-os-libs/file-logger
- location: https://github.com/mongoose-os-libs/homekit-adk
- location: https://github.com/mongoose-os-libs/http-server
- location: https://github.com/mongoose-os-libs/ota-http-server
- location: https://github.com/mongoose-os-libs/rpc-service-config
- location: https://github.com/mongoose-os-libs/rpc-service-fs
- location: https://github.com/mongoose-os-libs/rpc-service-ota
- location: https://github.com/mongoose-os-libs/rpc-uart
# Not enough space on 2.5
# - location: https://github.com/mongoose-os-libs/rpc-mqtt
- location: https://github.com/mongoose-os-libs/rpc-ws
- location: https://github.com/mongoose-os-libs/sntp
conds:
- when: build_vars.MODEL == "Shelly1"
apply:
name: switch1 # To allow OTA from stock fw.
libs:
- location: 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
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"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input"]
- when: build_vars.MODEL == "Shelly1L"
apply:
name: switch1l # To allow OTA from stock fw.
libs:
- location: 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
cdefs:
LED_GPIO: 0
LED_ON: 0
BTN_GPIO: 13
BTN_DOWN: 0
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHSW-L"'
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
SHELLY_HAVE_DUAL_INPUT_MODES: 1
config_schema:
- ["device.id", "shelly1l-??????"]
- ["shelly.name", "shelly1l-??????"]
- ["wifi.ap.ssid", "shelly1l-??????"]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "Shelly SW"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "Shelly SSW2"]
- ["in2.sensor.name", "Shelly S2"]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["ssw2", "ssw", {title: "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- when: build_vars.MODEL == "Shelly1PM"
apply:
name: switch1pm # To allow OTA from stock fw.
libs:
- location: 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
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"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
- ["bl0937.power_coeff", "f", 0, {title: "BL0937 counts -> watts conversion coefficient"}]
- ["bl0937.power_coeff", 1.79942025] # (16 + 1010 + 1935) / (8.53 + 561 + 1076)
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input"]
- when: build_vars.MODEL == "Shelly2"
apply:
name: switch
libs:
- location: 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
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"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["sw2", "sw", {title: "SW2 settings"}]
- ["sw2.name", "Shelly SW2"]
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "Shelly SSW2"]
- ["in2.sensor.name", "Shelly S2"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["ssw2", "ssw", {title: "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- when: build_vars.MODEL == "Shelly25"
apply:
name: switch25
sources:
- src/ADE7953
includes:
- src/ADE7953
libs:
- location: https://github.com/mongoose-os-libs/mongoose
variant: esp8266-nossl
- location: https://github.com/mongoose-os-libs/ade7953
build_vars:
FLASH_SIZE: 2097152
FS_SIZE: 262144
BOOT_CONFIG_ADDR: 0x1000
MGOS_ROOT_FS_TYPE: SPIFFS
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"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["sw2", "sw", {title: "SW2 settings"}]
- ["sw2.name", "Shelly SW2"]
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "Shelly SSW2"]
- ["in2.sensor.name", "Shelly S2"]
- ["wc1", "wc", {title: "WC1 settings"}]
- ["wc1.name", "Window 1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input 1"]
- ["ssw2", "ssw", {title: "SSW2 settings"}]
- ["ssw2.name", "Input 2"]
- when: build_vars.MODEL == "ShellyI3"
apply:
name: ix3
libs:
- location: 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
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHIX3-1"'
MG_ENABLE_SSL: 0
LED_GPIO: 5
LED_ON: 0
BTN_GPIO: 4
BTN_DOWN: 0
config_schema:
- ["device.id", "shellyix3-????????????"]
- ["wifi.ap.ssid", "shellyix3-????????????"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Input 1"]
- ["in1.sensor.name", "Shelly S1"]
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "Input 2"]
- ["in2.sensor.name", "Shelly S2"]
- ["in3", "in", {title: "Input 3 settings"}]
- ["in3.ssw.name", "Input 3"]
- ["in3.sensor.name", "Shelly S3"]
# Only for backward compatibility (config <= v3).
- ["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"]
# 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:
- location: 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
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: "Plug settings"}]
- ["sw1.name", "Shelly Plug"]
- ["sw1.in_mode", -1]
- ["sw1.svc_type", 1] # Outlet
- ["sw1.initial_state", 2]
- ["bl0937.power_coeff", "f", 0, {title: "BL0937 counts -> watts conversion coefficient"}]
- ["bl0937.power_coeff", 8.59980831] # (16 + 1010 + 1935) / (2.01 + 117.3 + 225)
- when: build_vars.MODEL == "ShellyPlugS"
apply:
name: shelly-plug-s # To allow OTA from stock fw.
libs:
- location: 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
cdefs:
LED_GPIO: 2 # Blue, 0 red.
LED_ON: 0
BTN_GPIO: 13
BTN_DOWN: 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: "Plug settings"}]
- ["sw1.name", "Shelly Plug S"]
- ["sw1.in_mode", -1]
- ["sw1.svc_type", 1] # Outlet
- ["sw1.initial_state", 2]
- ["sw1.state_led_en", 1]
- ["bl0937.power_coeff", "f", 0, {title: "BL0937 counts -> watts conversion coefficient"}]
- ["bl0937.power_coeff", 1.64358469] # (16 + 1010 + 1935) / (9.55 + 617 + 1175)
- when: build_vars.MODEL == "ShellyPlus1"
apply:
name: Plus1
build_vars:
MGOS_ROOT_FS_TYPE: LFS
MGOS_ROOT_FS_SIZE: 458752
ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K"
ESP_IDF_EXTRA_PARTITION_2: "shelly,data,nvs,0x3fc000,16K"
ESP_IDF_SDKCONFIG_OPTS: >
${build_vars.ESP_IDF_SDKCONFIG_OPTS}
CONFIG_FREERTOS_UNICORE=y
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
cdefs:
LED_GPIO: 0
LED_ON: 0
BTN_GPIO: 25
BTN_DOWN: 0
PRODUCT_HW_REV: '"0.1.6"'
STOCK_FW_MODEL: '"Plus1"'
config_schema:
- ["device.id", "ShellyPlus1-????????????"]
- ["shelly.name", "ShellyPlus1-????????????"]
- ["wifi.ap.ssid", "ShellyPlus1-????????????"]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "Shelly SW"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input"]
- when: build_vars.MODEL == "ShellyPlus1PM"
apply:
name: Plus1PM
build_vars:
MGOS_ROOT_FS_TYPE: LFS
MGOS_ROOT_FS_SIZE: 458752
ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K"
ESP_IDF_EXTRA_PARTITION_2: "shelly,data,nvs,0x3fc000,16K"
ESP_IDF_SDKCONFIG_OPTS: >
${build_vars.ESP_IDF_SDKCONFIG_OPTS}
CONFIG_FREERTOS_UNICORE=y
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
cdefs:
LED_GPIO: 0
LED_ON: 0
BTN_GPIO: 25
BTN_DOWN: 0
PRODUCT_HW_REV: '"0.1.6"'
STOCK_FW_MODEL: '"Plus1PM"'
config_schema:
- ["device.id", "ShellyPlus1-????????????"]
- ["shelly.name", "ShellyPlus1-????????????"]
- ["wifi.ap.ssid", "ShellyPlus1-????????????"]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "Shelly SW"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "Garage Door"]
- ["gdo1.open_sensor_mode", -1]
# Calibration values from stock
- ["bl0937_0", "o", {title: "BL0937 calibration"}]
- ["bl0937_0.apower_scale", "f", 2.028531, {title: "BL0937 apower scale"}]
- ["bl0937_0.voltage_scale", "f", 0.15510, {title: "BL0937 voltage scale"}]
- ["bl0937_0.current_scale", "f", 0.01287, {title: "BL0937 current scale"}]
# Only for backward compatibility (config <= v3).
- ["ssw1", "ssw", {title: "SSW1 settings"}]
- ["ssw1.name", "Input"]
- when: build_vars.MODEL == "ShellyRGBW2"
apply:
name: rgbw2-color # To allow OTA from stock fw.
libs:
- location: 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
cdefs:
LED_GPIO: 2
LED_ON: 0
BTN_GPIO: 13
BTN_DOWN: 0
BTN_NOISY: 0
RST_GPIO_INIT: 15 # reset GPIO 15 to prevent green flash on startup
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"SHRGBW2-color"'
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
config_schema:
- ["shelly.mode", 3] # 3 - RGB, 4 - RGBW"
- ["device.id", "shellyrgbw2-??????"]
- ["shelly.name", "shellyrgbw2-??????"]
- ["wifi.ap.ssid", "shellyrgbw2-??????"]
- ["lb1", "lb", {title: "RGB 1 settings"}]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "Shelly SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- 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"]
- ["wifi.sta_connect_timeout", 15]
- ["wifi.sta_roam_rssi_thr", -80]
- ["wifi.sta_roam_interval", 600]
# This is a mitigation for devices dropping of wifi and never coming back.
# While this is being investigated, the workaround is to reboot if not connected for 5 minutes when supposed to be.
- ["shelly.wifi_connect_reboot_timeout", "i", 300, {title: "If not connected for this long when supposed to be, reboot"}]
libs:
- location: https://github.com/mongoose-os-libs/adc
- location: https://github.com/mongoose-os-libs/pwm
- location: https://github.com/mongoose-os-libs/wifi
cdefs:
# Size fine-tuning, saves substantial amount of RAM vs defaults.
HAP_SESSION_SIZE: 392
HAP_IP_SESSION_SIZE: 600
# XXX: fix size calculation with and without BLE
XHAP_ACCESSORY_SERVER_SIZE: 1680
HAP_LOG_LEVEL: 0 # This saves 36K on esp8266.
HAP_DISABLE_ASSERTS: 1 # 32K
HAP_DISABLE_PRECONDITIONS: 1 # 40K
- when: build_vars.MODEL == "ShellyU"
apply:
sources:
- src/mock/pwm
libs:
- location: https://github.com/mongoose-os-libs/mongoose
variant: ubuntu-nossl
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '""'
MG_ENABLE_SSL: 0
SHELLY_HAVE_PM: 1
BTN_NOISY: 0
config_schema:
- ["device.id", "ShellyU-????"]
- ["shelly.name", "ShellyU-????"]
- ["file_logger.dir", "./"]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "ShellyU SW1"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "ShellyU SSW1"]
- ["in1.sensor.name", "ShellyU S1"]
- when: build_vars.MODEL == "ShellyU25"
apply:
sources:
- src/Shelly25/shelly_init_components.cpp # Same components as Shelly25
- src/mock/pwm
libs:
- location: https://github.com/mongoose-os-libs/mongoose
variant: ubuntu-nossl
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '""'
MG_ENABLE_SSL: 0
SHELLY_HAVE_PM: 1
BTN_NOISY: 0
config_schema:
- ["device.id", "ShellyU25-????"]
- ["shelly.name", "ShellyU25-????"]
- ["file_logger.dir", "./"]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "ShellyU25 SW1"]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "ShellyU25 SSW1"]
- ["in1.sensor.name", "Shelly S1"]
- ["sw2", "sw", {title: "SW2 settings"}]
- ["sw2.name", "ShellyU25 SW2"]
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "ShellyU25 SSW2"]
- ["in2.sensor.name", "ShellyU25 S2"]
- ["wc1", "wc", {title: "WC1 settings"}]
- ["wc1.name", "Window 1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
- ["gdo1.name", "ShellyU25 GDO"]
# Test device for BLE development.
- when: build_vars.MODEL == "ShellyT32"
apply:
libs:
# adding bt-common enables BLE support at compile time
- origin: https://github.com/mongoose-os-libs/bt-common
- origin: https://github.com/mongoose-os-libs/ethernet
build_vars:
APP_SLOT_SIZE: 0x1b0000
MGOS_HAP_BLE: 1
cdefs:
PRODUCT_HW_REV: '"1.0"'
STOCK_FW_MODEL: '"XXX"'
SHELLY_HAVE_PM: 0
BTN_NOISY: 0
config_schema:
# - ["bt.enable", true]
- ["bt.adv_enable", false] # ADK controls advertisement.
- ["bt.keep_enabled", true]
- ["bt.random_address", true]
- ["device.id", "ShellyT32-????"]
- ["shelly.name", "ShellyT32-????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.name", "SWT32"]
- ["sw1.in_mode", 0]
- ["in1", "in", {title: "Input 1 settings"}]
- ["in1.ssw.name", "SSWT32"]
- ["in1.sensor.name", "ST32"]
manifest_version: 2020-01-29