forked from mongoose-os-apps/shelly-homekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mos.yml
276 lines (258 loc) · 9.27 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
author: 'Deomid "rojer" Ryabkov'
description: A HomeKit firmware for Shelly switches
version: 2.0.12
platform: esp8266
libs_version: latest
modules_version: latest
mongoose_os_version: latest
sources:
- src
filesystem:
- fs
config_schema:
# Try .gz-compressed html.
- ["http.index_files", "index.html,index.html.gz"]
- ["sntp.enable", true]
- ["debug.event_level", 3]
- ["file_logger.level", 3]
- ["file_logger.enable", false]
- ["file_logger.buf_size", 1000]
- ["sw", "o", {"Switch settings"}]
- ["sw.id", "i", 0, {"ID of the switch"}]
- ["sw.name", "s", "", {"Name of the switch"}]
- ["sw.enable", "b", true, {"Enable this switch in the accessory"}]
- ["sw.out_gpio", "i", -1, {"Output pin"}]
- ["sw.out_on_value", "i", 1, {"Active (ON) output for gpio, 1 or 0"}]
- ["sw.in_gpio", "i", -1, {"Input sensing pin"}]
- ["sw.in_mode", "i", 1, {"0 - Momentary, 1 - Toggle, 2 - Edge, 3 - Detached"}]
- ["sw.state", "b", false, {"State of the switch"}]
- ["sw.svc_type", "i", 0, {"HAP service type, 0 = switch, 1 = outlet"}]
- ["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"}]
- ["shelly.cfg_version", "i", 0, {"Configuration version"}]
# 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"'
SERVICE_NAME: '"Switch"'
LED_GPIO: -1
BTN_GPIO: -1
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
version: master
- origin: https://github.com/mongoose-os-libs/mqtt
- 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-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_MODEL: '"Shelly1"'
PRODUCT_HW_REV: '"1.0"'
NUM_SWITCHES: 1
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
# This saves quite a bit of space but disables all HAP debug output.
# HAP_LOG_LEVEL: 0
config_schema:
- ["device.id", "shelly1-??????"]
- ["wifi.ap.ssid", "shelly1-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW"]
- ["sw1.out_gpio", 4]
- ["sw1.in_gpio", 5]
- 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:
PRODUCT_MODEL: '"Shelly1PM"'
PRODUCT_HW_REV: '"1.0"'
NUM_SWITCHES: 1
# We don't use SSL, HomeKit uses its own crypto. This saves ~120K.
MG_ENABLE_SSL: 0
# This saves quite a bit of space but disables all HAP debug output.
# HAP_LOG_LEVEL: 0
config_schema:
- ["device.id", "shelly1pm-??????"]
- ["wifi.ap.ssid", "shelly1pm-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW"]
- ["sw1.out_gpio", 15]
- ["sw1.in_gpio", 4]
- 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_MODEL: '"ShellyPlugS"'
PRODUCT_HW_REV: '"1.0"'
NUM_SWITCHES: 1
MG_ENABLE_SSL: 0
config_schema:
- ["device.id", "shellyplug-s-??????"]
- ["wifi.ap.ssid", "shellyplug-s-??????"]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW"]
- ["sw1.out_gpio", 15]
- ["sw1.in_gpio", 13]
- 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_MODEL: '"Shelly2"'
PRODUCT_HW_REV: '"1.0"'
NUM_SWITCHES: 2
MG_ENABLE_SSL: 0
# HAP_LOG_LEVEL: 0
config_schema:
- ["device.id", "shellyswitch21-??????"]
- ["wifi.ap.ssid", "shellyswitch21-??????"]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW1"]
- ["sw1.out_gpio", 4]
- ["sw1.in_gpio", 12]
- ["sw2", "sw", {"title": "SW2 settings"}]
- ["sw2.id", 1]
- ["sw2.name", "Shelly SW2"]
- ["sw2.out_gpio", 5]
- ["sw2.in_gpio", 14]
- 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_MODEL: '"Shelly2.5"'
PRODUCT_HW_REV: '"2.5"'
NUM_SWITCHES: 2
MG_ENABLE_SSL: 0
SHELLY_HAVE_PM: 1
# HAP_LOG_LEVEL: 0
config_schema:
- ["device.id", "shellyswitch25-??????"]
- ["wifi.ap.ssid", "shellyswitch25-??????"]
- ["i2c.enable", true]
- ["i2c.sda_gpio", 12]
- ["i2c.scl_gpio", 14]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW1"]
- ["sw1.out_gpio", 4]
- ["sw1.in_gpio", 13]
- ["sw2", "sw", {"title": "SW2 settings"}]
- ["sw2.id", 1]
- ["sw2.name", "Shelly SW2"]
- ["sw2.out_gpio", 15]
- ["sw2.in_gpio", 5]
- 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/ota-http-server
- origin: https://github.com/mongoose-os-libs/rpc-service-ota
- origin: https://github.com/mongoose-os-libs/wifi
- when: mos.platform == "ubuntu"
apply:
cdefs:
PRODUCT_MODEL: '"ShellyU"'
PRODUCT_HW_REV: '"1.0"'
NUM_SWITCHES: 1
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-????"]
- ["http.document_root", "."]
- ["sw1", "sw", {"title": "SW settings"}]
- ["sw1.id", 0]
- ["sw1.name", "SW"]
- ["sw1.out_gpio", 4]
- ["sw1.in_gpio", 5]
manifest_version: 2020-01-29