forked from mongoose-os-apps/shelly-homekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmos.yml
221 lines (205 loc) · 7.26 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
author: 'Deomid "rojer" Ryabkov'
description: A HomeKit firmware for Shelly switches
version: 1.3.1
platform: esp8266
libs_version: ${mos.version}
modules_version: ${mos.version}
mongoose_os_version: ${mos.version}
sources:
- src
filesystem:
- fs
config_schema:
# Serial number. This can be later set in the field but HomeKit requires at least 2 bytes.
- ["device.sn", "000000"]
# Try .gz-compressed html.
- ["http.index_files", "index.html,index.html.gz"]
- ["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.persist_state", "b", false, {"Whether state of the switch should be persisted across reboots."}]
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/homekit-adk
- 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-ws
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: 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: '"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 == "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
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
# HAP_LOG_LEVEL: 0
config_schema:
- ["device.id", "shellyswitch25-??????"]
- ["wifi.ap.ssid", "shellyswitch25-??????"]
- ["sw1", "sw", {"title": "SW1 settings"}]
- ["sw1.id", 0]
- ["sw1.name", "Shelly SW1"]
- ["sw1.out_gpio", 4]
- ["sw1.in_gpio", 5]
- ["sw2", "sw", {"title": "SW2 settings"}]
- ["sw2.id", 1]
- ["sw2.name", "Shelly SW2"]
- ["sw2.out_gpio", 15]
- ["sw2.in_gpio", 13]
- 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