sonoff_post.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. /*
  2. sonoff_post.h - Post header file for Sonoff-Tasmota
  3. Copyright (C) 2018 Theo Arends
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef _SONOFF_POST_H_
  16. #define _SONOFF_POST_H_
  17. /*********************************************************************************************\
  18. * Function declarations
  19. \*********************************************************************************************/
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #include "user_interface.h"
  24. // Function prototypes
  25. void WifiWpsStatusCallback(wps_cb_status status);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. //#ifdef USE_KNX // Enabling this will fail compilation. It has no impact if not used. (20180417)
  30. #include <esp-knx-ip.h>
  31. void KNX_CB_Action(message_t const &msg, void *arg);
  32. //#endif // USE_KNX
  33. /*********************************************************************************************\
  34. * Default global defines
  35. \*********************************************************************************************/
  36. #ifndef MODULE
  37. #define MODULE SONOFF_BASIC // [Module] Select default model
  38. #endif
  39. /*********************************************************************************************\
  40. * [sonoff-sensors.bin]
  41. * Provide an image with useful supported sensors enabled
  42. \*********************************************************************************************/
  43. #ifdef USE_SENSORS
  44. #undef CODE_IMAGE
  45. #define CODE_IMAGE 3
  46. #undef USE_ADC_VCC // Add Analog input on selected devices
  47. #define USE_DS18x20 // For more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
  48. //#define USE_DS18x20_LEGACY // For more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
  49. #define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
  50. #define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code)
  51. #define USE_SHT3X // Add I2C code for SHT3x sensor (+0k6 code)
  52. #define USE_HTU // Add I2C code for HTU21/SI7013/SI7020/SI7021 sensor (+1k5 code)
  53. #define USE_LM75AD // Add I2C code for LM75AD sensor (+0k5 code)
  54. #define USE_BMP // Add I2C code for BMP085/BMP180/BMP280/BME280 sensor (+4k code)
  55. #define USE_BME680 // Add additional support for BME680 sensor using Bosch BME680 library (+4k code)
  56. #define USE_SGP30 // Add I2C code for SGP30 sensor (+1k1 code)
  57. #define USE_BH1750 // Add I2C code for BH1750 sensor (+0k5 code)
  58. #define USE_VEML6070 // Add I2C code for VEML6070 sensor (+0k5 code)
  59. #define USE_TSL2561 // Add I2C code for TSL2561 sensor using library Adafruit TSL2561 Arduino (+1k2 code)
  60. //#define USE_SI1145 // Add I2C code for SI1145/46/47 sensor (+1k code)
  61. #define USE_ADS1115 // Add I2C code for ADS1115 16 bit A/D converter based on Adafruit ADS1x15 library (no library needed) (+0k7 code)
  62. //#define USE_ADS1115_I2CDEV // Add I2C code for ADS1115 16 bit A/D converter using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code)
  63. #define USE_INA219 // Add I2C code for INA219 Low voltage and current sensor (+1k code)
  64. #define USE_MGS // Add I2C code for Xadow and Grove Mutichannel Gas sensor using library Multichannel_Gas_Sensor (+10k code)
  65. //#define USE_APDS9960 // Add I2C code for APDS9960 Proximity Sensor. Disables SHT and VEML6070 (+4k7 code)
  66. //#define USE_MCP230xx // Enable MCP23008/MCP23017 - Must define I2C Address in #define USE_MCP230xx_ADDR below - range 0x20 - 0x27 (+4k7 code)
  67. // #define USE_MCP230xx_ADDR 0x20 // Enable MCP23008/MCP23017 I2C Address to use (Must be within range 0x20 through 0x27 - set according to your wired setup)
  68. // #define USE_MCP230xx_OUTPUT // Enable MCP23008/MCP23017 OUTPUT support through sensor29 commands (+1k5 code)
  69. // #define USE_MCP230xx_DISPLAYOUTPUT // Enable MCP23008/MCP23017 to display state of OUTPUT pins on Web UI (+0k2 code)
  70. //#define USE_PCA9685 // Enable PCA9685 I2C HW PWM Driver - Must define I2C Address in #define USE_PCA9685_ADDR below - range 0x40 - 0x47 (+1k4 code)
  71. // #define USE_PCA9685_ADDR 0x40 // Enable PCA9685 I2C Address to use (Must be within range 0x40 through 0x47 - set according to your wired setup)
  72. // #define USE_PCA9685_FREQ 50 // Define default PWM frequency in Hz to be used (must be within 24 to 1526) - If other value is used, it will rever to 50Hz
  73. //#define USE_MPR121 // Enable MPR121 controller (I2C addresses 0x5A, 0x5B, 0x5C and 0x5D) in input mode for touch buttons (+1k3 code)
  74. //#define USE_CCS811 // Add I2C code for CCS811 sensor (+2k2 code)
  75. //#define USE_MPU6050 // Enable MPU6050 sensor (I2C address 0x68 AD0 low or 0x69 AD0 high) (+2k6 code)
  76. //#define USE_DS3231 // Enable DS3231 external RTC in case no Wifi is avaliable. See docs in the source file (+1k2 code)
  77. //#define USE_MGC3130 // Enable MGC3130 Electric Field Effect Sensor (I2C address 0x42) (+2k7 code, 0k3 mem)
  78. #define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code)
  79. #define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code)
  80. #ifndef CO2_LOW
  81. #define CO2_LOW 800 // Below this CO2 value show green light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
  82. #endif
  83. #ifndef CO2_HIGH
  84. #define CO2_HIGH 1200 // Above this CO2 value show red light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
  85. #endif
  86. #define USE_PMS5003 // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code)
  87. #define USE_NOVA_SDS // Add support for SDS011 and SDS021 particle concentration sensor (+0k7 code)
  88. #define USE_SERIAL_BRIDGE // Add support for software Serial Bridge (+0k8 code)
  89. #define USE_SDM120 // Add support for Eastron SDM120-Modbus energy meter (+1k7 code)
  90. #define USE_SDM630 // Add support for Eastron SDM630-Modbus energy meter (+2k code)
  91. #define USE_MP3_PLAYER // Use of the DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop
  92. #define MP3_VOLUME 10 // Set the startup volume on init, the range can be 0..30(max)
  93. #define USE_TUYA_DIMMER // Add support for Tuya Serial Dimmer
  94. #ifndef TUYA_DIMMER_ID
  95. #define TUYA_DIMMER_ID 0 // Default dimmer Id
  96. #endif
  97. #define USE_PS_16_DZ // Add support for PS-16-DZ Dimmer
  98. #define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code)
  99. #define USE_PZEM_AC // Add support for PZEM014,016 Energy monitor (+1k1 code)
  100. #define USE_PZEM_DC // Add support for PZEM003,017 Energy monitor (+1k1 code)
  101. #define USE_MCP39F501 // Add support for MCP39F501 Energy monitor as used in Shelly 2 (+3k1 code)
  102. #define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
  103. #define USE_IR_HVAC // Support for HVAC system using IR (+2k code)
  104. #define USE_IR_RECEIVE // Support for IR receiver (+5k5 code, 264 iram)
  105. #define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
  106. #ifndef USE_WS2812_CTYPE
  107. #define USE_WS2812_CTYPE NEO_GRB // WS2812 Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW)
  108. #endif
  109. // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
  110. #define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
  111. #define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code)
  112. #define USE_TM1638 // Add support for TM1638 switches copying Switch1 .. Switch8 (+1k code)
  113. #define USE_HX711 // Add support for HX711 load cell (+1k5 code)
  114. //#define USE_HX711_GUI // Add optional web GUI to HX711 as scale (+1k8 code)
  115. #define USE_RF_FLASH // Add support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (+3k code)
  116. #define USE_TX20_WIND_SENSOR // Add support for La Crosse TX20 anemometer (+2k code)
  117. #define USE_RC_SWITCH // Add support for RF transceiver using library RcSwitch (+2k7 code, 460 iram)
  118. #define USE_RF_SENSOR // Add support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
  119. // #define USE_THEO_V2 // Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver (+1k4 code)
  120. #define USE_ALECTO_V2 // Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 using 868MHz RF sensor receiver (+1k7 code)
  121. //#define USE_AZ7798 // Add support for AZ-Instrument 7798 CO2 datalogger
  122. #endif // USE_SENSORS
  123. /*********************************************************************************************\
  124. * [sonoff-classic.bin]
  125. * Provide an image close to version 5.12.0 but still within 499k program space to allow one time OTA
  126. \*********************************************************************************************/
  127. #ifdef USE_CLASSIC
  128. #undef CODE_IMAGE
  129. #define CODE_IMAGE 2
  130. #ifndef USE_WPS
  131. #define USE_WPS // Add support for WPS as initial wifi configuration tool (+33k code, 1k mem (5k mem with core v2.4.2+))
  132. #endif
  133. #ifndef USE_SMARTCONFIG
  134. #define USE_SMARTCONFIG // Add support for Wifi SmartConfig as initial wifi configuration tool (+23k code, +0.6k mem)
  135. #endif
  136. #undef MQTT_LIBRARY_TYPE
  137. #define MQTT_LIBRARY_TYPE MQTT_PUBSUBCLIENT // Use PubSubClient library
  138. #undef USE_ARDUINO_OTA // Disable support for Arduino OTA
  139. //#undef USE_DOMOTICZ // Disable Domoticz
  140. #undef USE_HOME_ASSISTANT // Disable Home Assistant
  141. #undef USE_KNX // Disable KNX IP Protocol Support
  142. #undef USE_CUSTOM // Disable Custom features
  143. #undef USE_TIMERS // Disable support for up to 16 timers
  144. #undef USE_TIMERS_WEB // Disable support for timer webpage
  145. #undef USE_SUNRISE // Disable support for Sunrise and sunset tools
  146. #undef USE_RULES // Disable support for rules
  147. #undef USE_I2C // Disable all I2C sensors
  148. #undef USE_SPI // Disable all SPI devices
  149. #undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor
  150. #undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor
  151. #undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor
  152. #undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor
  153. #undef USE_PZEM004T // Disable PZEM004T energy sensor
  154. #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor
  155. #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor
  156. #undef USE_MCP39F501 // Disable support for MCP39F501 Energy monitor as used in Shelly 2 (+3k1 code)
  157. #undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge
  158. #undef USE_SDM120 // Disable support for Eastron SDM120-Modbus energy meter
  159. #undef USE_SDM630 // Disable support for Eastron SDM630-Modbus energy meter
  160. #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop
  161. #undef USE_TUYA_DIMMER // Disable support for Tuya Serial Dimmer
  162. #undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code)
  163. #undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer
  164. #undef USE_IR_REMOTE // Disable IR remote commands using library IRremoteESP8266 and ArduinoJson
  165. #undef USE_IR_RECEIVE // Disable support for IR receiver
  166. #undef USE_ARILUX_RF // Disable support for Arilux RF remote controller
  167. #undef USE_SR04 // Disable support for for HC-SR04 ultrasonic devices
  168. #undef USE_TM1638 // Disable support for TM1638 switches copying Switch1 .. Switch8
  169. #undef USE_HX711 // Disable support for HX711 load cell
  170. #undef USE_RF_FLASH // Disable support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB
  171. #undef USE_TX20_WIND_SENSOR // Disable support for La Crosse TX20 anemometer
  172. #undef USE_RC_SWITCH // Disable support for RF transceiver using library RcSwitch
  173. #undef USE_RF_SENSOR // Disable support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
  174. #undef DEBUG_THEO // Disable debug code
  175. #undef USE_DEBUG_DRIVER // Disable debug code
  176. #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger
  177. #endif // USE_CLASSIC
  178. /*********************************************************************************************\
  179. * [sonoff-knx.bin]
  180. * Provide a dedicated KNX image allowing enough code and memory space
  181. \*********************************************************************************************/
  182. #ifdef USE_KNX_NO_EMULATION
  183. #undef CODE_IMAGE
  184. #define CODE_IMAGE 4
  185. #ifndef USE_KNX
  186. #define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem)
  187. #endif
  188. #undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem)
  189. #endif // USE_KNX_NO_EMULATION
  190. /*********************************************************************************************\
  191. * [sonoff-display.bin]
  192. * Provide an image with display drivers enabled
  193. \*********************************************************************************************/
  194. #ifdef USE_DISPLAYS
  195. #undef CODE_IMAGE
  196. #define CODE_IMAGE 6
  197. #undef USE_ENERGY_SENSOR // Disable energy sensors (-14k code)
  198. #undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem)
  199. #undef USE_DOMOTICZ // Disable Domoticz
  200. #undef USE_HOME_ASSISTANT // Disable Home Assistant
  201. #define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
  202. #define USE_DISPLAY // Add I2C Display Support (+2k code)
  203. #define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0
  204. #define USE_DISPLAY_LCD // [DisplayModel 1] Enable Lcd display (I2C addresses 0x27 and 0x3F) (+6k code)
  205. #define USE_DISPLAY_SSD1306 // [DisplayModel 2] Enable SSD1306 Oled 128x64 display (I2C addresses 0x3C and 0x3D) (+16k code)
  206. #define USE_DISPLAY_MATRIX // [DisplayModel 3] Enable 8x8 Matrix display (I2C adresseses see below) (+11k code)
  207. #define USE_SPI // Hardware SPI using GPIO12(MISO), GPIO13(MOSI) and GPIO14(CLK) in addition to two user selectable GPIOs(CS and DC)
  208. #define USE_DISPLAY_ILI9341 // [DisplayModel 4] Enable ILI9341 Tft 480x320 display (+19k code)
  209. #define USE_DISPLAY_EPAPER_29 // [DisplayModel 5] Enable e-paper 2.9 inch display (+19k code)
  210. #undef USE_ARILUX_RF // Remove support for Arilux RF remote controller (-0k8 code, 252 iram (non 2.3.0))
  211. #undef USE_RF_FLASH // Remove support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (-3k code)
  212. #endif // USE_DISPLAYS
  213. /*********************************************************************************************\
  214. * Mandatory define for DS18x20 if changed by above image selections
  215. \*********************************************************************************************/
  216. #if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY)
  217. #else
  218. #define USE_DS18B20 // Default DS18B20 sensor needs no external library
  219. #endif
  220. /*********************************************************************************************\
  221. * [sonoff-basic.bin]
  222. * Provide an image without sensors
  223. \*********************************************************************************************/
  224. #ifdef USE_BASIC
  225. #undef CODE_IMAGE
  226. #define CODE_IMAGE 5
  227. #undef APP_SLEEP
  228. #define APP_SLEEP 1 // Default to sleep = 1 for USE_BASIC
  229. //#undef USE_ENERGY_SENSOR // Disable energy sensors
  230. #undef USE_ARDUINO_OTA // Disable support for Arduino OTA
  231. #undef USE_WPS // Disable support for WPS as initial wifi configuration tool
  232. #undef USE_SMARTCONFIG // Disable support for Wifi SmartConfig as initial wifi configuration tool
  233. #undef USE_DOMOTICZ // Disable Domoticz
  234. #undef USE_HOME_ASSISTANT // Disable Home Assistant
  235. #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set
  236. #undef USE_KNX // Disable KNX IP Protocol Support
  237. //#undef USE_WEBSERVER // Disable Webserver
  238. //#undef USE_EMULATION // Disable Wemo or Hue emulation
  239. #undef USE_CUSTOM // Disable Custom features
  240. #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server
  241. //#undef USE_TIMERS // Disable support for up to 16 timers
  242. //#undef USE_TIMERS_WEB // Disable support for timer webpage
  243. //#undef USE_SUNRISE // Disable support for Sunrise and sunset tools
  244. //#undef USE_RULES // Disable support for rules
  245. #undef USE_DHT // Disable internal DHT sensor
  246. #undef USE_DS18x20 // Disable DS18x20 sensor
  247. #undef USE_DS18x20_LEGACY // Disable DS18x20 sensor
  248. #undef USE_DS18B20 // Disable internal DS18B20 sensor
  249. #undef USE_I2C // Disable all I2C sensors and devices
  250. #undef USE_SPI // Disable all SPI devices
  251. #undef USE_DISPLAY // Disable Display support
  252. #undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor
  253. #undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor
  254. #undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor
  255. #undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor
  256. #undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge
  257. #undef USE_SDM120 // Disable support for Eastron SDM120-Modbus energy meter
  258. #undef USE_SDM630 // Disable support for Eastron SDM630-Modbus energy meter
  259. #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop
  260. //#undef USE_TUYA_DIMMER // Disable support for Tuya Serial Dimmer
  261. #undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code)
  262. #undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer
  263. #undef USE_PZEM004T // Disable PZEM004T energy sensor
  264. #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor
  265. #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor
  266. //#undef USE_MCP39F501 // Disable MCP39F501 Energy monitor as used in Shelly 2
  267. #undef USE_IR_REMOTE // Disable IR driver
  268. #undef USE_WS2812 // Disable WS2812 Led string
  269. #undef USE_ARILUX_RF // Disable support for Arilux RF remote controller
  270. #undef USE_SR04 // Disable support for for HC-SR04 ultrasonic devices
  271. #undef USE_TM1638 // Disable support for TM1638 switches copying Switch1 .. Switch8
  272. #undef USE_HX711 // Disable support for HX711 load cell
  273. #undef USE_RF_FLASH // Disable support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB
  274. #undef USE_TX20_WIND_SENSOR // Disable support for La Crosse TX20 anemometer
  275. #undef USE_RC_SWITCH // Disable support for RF transceiver using library RcSwitch
  276. #undef USE_RF_SENSOR // Disable support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
  277. #undef DEBUG_THEO // Disable debug code
  278. #undef USE_DEBUG_DRIVER // Disable debug code
  279. #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger
  280. #endif // USE_BASIC
  281. /*********************************************************************************************\
  282. * [sonoff-minimal.bin]
  283. * Provide the smallest image possible while still enabling a webserver for intermediate image load
  284. \*********************************************************************************************/
  285. #ifdef BE_MINIMAL
  286. #undef CODE_IMAGE
  287. #define CODE_IMAGE 1
  288. #undef USE_ENERGY_SENSOR // Disable energy sensors
  289. #undef USE_ARDUINO_OTA // Disable support for Arduino OTA
  290. #undef USE_WPS // Disable support for WPS as initial wifi configuration tool
  291. #undef USE_SMARTCONFIG // Disable support for Wifi SmartConfig as initial wifi configuration tool
  292. #undef USE_DOMOTICZ // Disable Domoticz
  293. #undef USE_HOME_ASSISTANT // Disable Home Assistant
  294. #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set
  295. #undef USE_KNX // Disable KNX IP Protocol Support
  296. //#undef USE_WEBSERVER // Disable Webserver
  297. #undef USE_EMULATION // Disable Wemo or Hue emulation
  298. #undef USE_CUSTOM // Disable Custom features
  299. #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server
  300. #undef USE_TIMERS // Disable support for up to 16 timers
  301. #undef USE_TIMERS_WEB // Disable support for timer webpage
  302. #undef USE_SUNRISE // Disable support for Sunrise and sunset tools
  303. #undef USE_RULES // Disable support for rules
  304. #undef USE_DHT // Disable internal DHT sensor
  305. #undef USE_DS18x20 // Disable DS18x20 sensor
  306. #undef USE_DS18x20_LEGACY // Disable DS18x20 sensor
  307. #undef USE_DS18B20 // Disable internal DS18B20 sensor
  308. #undef USE_I2C // Disable all I2C sensors and devices
  309. #undef USE_SPI // Disable all SPI devices
  310. #undef USE_DISPLAY // Disable Display support
  311. #undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor
  312. #undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor
  313. #undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor
  314. #undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor
  315. #undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge
  316. #undef USE_SDM120 // Disable support for Eastron SDM120-Modbus energy meter
  317. #undef USE_SDM630 // Disable support for Eastron SDM630-Modbus energy meter
  318. #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop
  319. #undef USE_TUYA_DIMMER // Disable support for Tuya Serial Dimmer
  320. #undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code)
  321. #undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer
  322. #undef USE_PZEM004T // Disable PZEM004T energy sensor
  323. #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor
  324. #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor
  325. #undef USE_MCP39F501 // Disable MCP39F501 Energy monitor as used in Shelly 2
  326. #undef USE_IR_REMOTE // Disable IR driver
  327. #undef USE_WS2812 // Disable WS2812 Led string
  328. #undef USE_ARILUX_RF // Disable support for Arilux RF remote controller
  329. #undef USE_SR04 // Disable support for for HC-SR04 ultrasonic devices
  330. #undef USE_TM1638 // Disable support for TM1638 switches copying Switch1 .. Switch8
  331. #undef USE_HX711 // Disable support for HX711 load cell
  332. #undef USE_RF_FLASH // Disable support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB
  333. #undef USE_TX20_WIND_SENSOR // Disable support for La Crosse TX20 anemometer
  334. #undef USE_RC_SWITCH // Disable support for RF transceiver using library RcSwitch
  335. #undef USE_RF_SENSOR // Disable support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
  336. #undef DEBUG_THEO // Disable debug code
  337. #undef USE_DEBUG_DRIVER // Disable debug code
  338. #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger
  339. #endif // BE_MINIMAL
  340. /*********************************************************************************************\
  341. * Mandatory defines satisfying possible disabled defines
  342. \*********************************************************************************************/
  343. #ifndef USE_WPS // See https://github.com/esp8266/Arduino/pull/4889
  344. #undef NO_EXTRA_4K_HEAP // Allocate 4k heap for WPS in ESP8166/Arduino core v2.4.2 (was always allocated in previous versions)
  345. #endif
  346. #ifndef SWITCH_MODE
  347. #define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state)
  348. #endif
  349. #ifndef MQTT_FINGERPRINT1
  350. #define MQTT_FINGERPRINT1 "A5 02 FF 13 99 9F 8B 39 8E F1 83 4F 11 23 65 0B 32 36 FC 07"
  351. #endif
  352. #ifndef MQTT_FINGERPRINT2
  353. #define MQTT_FINGERPRINT2 "A5 02 FF 13 99 9F 8B 39 8E F1 83 4F 11 23 65 0B 32 36 FC 07"
  354. #endif
  355. #ifndef WS2812_LEDS
  356. #define WS2812_LEDS 30 // [Pixels] Number of LEDs
  357. #endif
  358. #ifndef MQTT_MAX_PACKET_SIZE
  359. #define MQTT_MAX_PACKET_SIZE 1000 // Bytes
  360. #endif
  361. #ifndef MQTT_KEEPALIVE
  362. #define MQTT_KEEPALIVE 15 // Seconds
  363. #endif
  364. #ifndef MQTT_TIMEOUT
  365. #define MQTT_TIMEOUT 10000 // milli seconds
  366. #endif
  367. #ifndef MESSZ
  368. //#define MESSZ 405 // Max number of characters in JSON message string (6 x DS18x20 sensors)
  369. //#define MESSZ 893 // Max number of characters in JSON message string (Hass discovery and nice MQTT_MAX_PACKET_SIZE = 1000)
  370. #define MESSZ (MQTT_MAX_PACKET_SIZE -TOPSZ -7) // Max number of characters in JSON message string (6 x DS18x20 sensors)
  371. #endif
  372. //#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
  373. #ifndef ARDUINO_ESP8266_RELEASE
  374. #define ARDUINO_ESP8266_RELEASE "STAGE"
  375. #endif
  376. #ifdef ARDUINO_ESP8266_RELEASE_2_3_0 // Disable not supported features in core 2.3.0
  377. #undef USE_MQTT_TLS_CA_CERT
  378. #endif
  379. #endif // _SONOFF_POST_H_