Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

847 lines
26 KiB

6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Devices
  3. // -----------------------------------------------------------------------------
  4. // New boards have to be added just before the BOARD_LAST line,
  5. // then add configuration in the hardware.ino
  6. enum boards {
  7. BOARD_UNKNOWN,
  8. BOARD_CUSTOM,
  9. BOARD_NODEMCU_LOLIN,
  10. BOARD_WEMOS_D1_MINI_RELAYSHIELD,
  11. BOARD_ITEAD_SONOFF_BASIC,
  12. BOARD_ITEAD_SONOFF_TH,
  13. BOARD_ITEAD_SONOFF_SV,
  14. BOARD_ITEAD_SONOFF_TOUCH,
  15. BOARD_ITEAD_SONOFF_POW,
  16. BOARD_ITEAD_SONOFF_DUAL,
  17. BOARD_ITEAD_1CH_INCHING,
  18. BOARD_ITEAD_SONOFF_4CH,
  19. BOARD_ITEAD_SLAMPHER,
  20. BOARD_ITEAD_S20,
  21. BOARD_ELECTRODRAGON_WIFI_IOT,
  22. BOARD_WORKCHOICE_ECOPLUG,
  23. BOARD_JANGOE_WIFI_RELAY_NC,
  24. BOARD_JANGOE_WIFI_RELAY_NO,
  25. BOARD_OPENENERGYMONITOR_MQTT_RELAY,
  26. BOARD_JORGEGARCIA_WIFI_RELAYS,
  27. BOARD_AITHINKER_AI_LIGHT,
  28. BOARD_MAGICHOME_LED_CONTROLLER,
  29. BOARD_ITEAD_MOTOR,
  30. BOARD_TINKERMAN_ESPURNA_H06,
  31. BOARD_HUACANXING_H801,
  32. BOARD_ITEAD_BNSZ01,
  33. BOARD_ITEAD_SONOFF_RFBRIDGE,
  34. BOARD_ITEAD_SONOFF_4CH_PRO,
  35. BOARD_ITEAD_SONOFF_B1,
  36. BOARD_ITEAD_SONOFF_LED,
  37. BOARD_ITEAD_SONOFF_T1_1CH,
  38. BOARD_ITEAD_SONOFF_T1_2CH,
  39. BOARD_ITEAD_SONOFF_T1_3CH,
  40. BOARD_ITEAD_SONOFF_RF,
  41. BOARD_WION_50055,
  42. BOARD_EXS_WIFI_RELAY_V31,
  43. BOARD_HUACANXING_H802,
  44. BOARD_GENERIC_V9261F,
  45. BOARD_GENERIC_ECH1560,
  46. BOARD_TINKERMAN_ESPURNA_H08,
  47. BOARD_MANCAVEMADE_ESPLIVE,
  48. BOARD_INTERMITTECH_QUINLED,
  49. BOARD_MAGICHOME_LED_CONTROLLER_20,
  50. BOARD_ARILUX_AL_LC06,
  51. BOARD_XENON_SM_PW702U,
  52. BOARD_AUTHOMETION_LYT8266,
  53. BOARD_ARILUX_E27,
  54. BOARD_YJZK_SWITCH_2CH,
  55. BOARD_ITEAD_SONOFF_DUAL_R2,
  56. BOARD_GENERIC_8CH,
  57. BOARD_ARILUX_AL_LC01,
  58. BOARD_ARILUX_AL_LC11,
  59. BOARD_ARILUX_AL_LC02,
  60. BOARD_KMC_70011,
  61. BOARD_GIZWITS_WITTY_CLOUD,
  62. BOARD_EUROMATE_WIFI_STECKER_SCHUKO,
  63. BOARD_TONBUX_POWERSTRIP02,
  64. BOARD_LINGAN_SWA1,
  65. BOARD_HEYGO_HY02,
  66. BOARD_MAXCIO_WUS002S,
  67. BOARD_YIDIAN_XSSSA05,
  68. BOARD_TONBUX_XSSSA06,
  69. BOARD_GREEN_ESP8266RELAY,
  70. BOARD_IKE_ESPIKE,
  71. BOARD_ARNIEX_SWIFITCH,
  72. BOARD_GENERIC_ESP01S_RELAY_V40,
  73. BOARD_GENERIC_ESP01S_RGBLED_V10,
  74. BOARD_HELTEC_TOUCHRELAY,
  75. BOARD_GENERIC_ESP01S_DHT11_V10,
  76. BOARD_GENERIC_ESP01S_DS18B20_V10,
  77. BOARD_ZHILDE_EU44_W,
  78. BOARD_ITEAD_SONOFF_POW_R2,
  79. BOARD_LUANI_HVIO,
  80. BOARD_ALLNET_4DUINO_IOT_WLAN_RELAIS,
  81. BOARD_TONBUX_MOSQUITO_KILLER,
  82. BOARD_NEO_COOLCAM_NAS_WR01W,
  83. BOARD_PILOTAK_ESP_DIN_V1,
  84. BOARD_ESTINK_WIFI_POWER_STRIP,
  85. BOARD_BH_ONOFRE,
  86. BOARD_BLITZWOLF_BWSHP2,
  87. BOARD_TINKERMAN_ESPURNA_SWITCH,
  88. BOARD_ITEAD_SONOFF_S31,
  89. BOARD_STM_RELAY,
  90. BOARD_VANZAVANZU_SMART_WIFI_PLUG_MINI,
  91. BOARD_GENERIC_GEIGER_COUNTER,
  92. BOARD_TINKERMAN_RFM69GW,
  93. BOARD_ITEAD_SONOFF_IFAN02,
  94. BOARD_GENERIC_AG_L4,
  95. BOARD_HOMECUBE_16A,
  96. BOARD_LAST
  97. };
  98. // -----------------------------------------------------------------------------
  99. // Board => Image type
  100. // -----------------------------------------------------------------------------
  101. #if \
  102. defined(ALLNET_4DUINO_IOT_WLAN_RELAIS) || \
  103. defined(ARNIEX_SWIFITCH) || \
  104. defined(BH_ONOFRE) || \
  105. defined(ELECTRODRAGON_WIFI_IOT) || \
  106. defined(ESTINK_WIFI_POWER_STRIP) || \
  107. defined(EUROMATE_WIFI_STECKER_SCHUKO) || \
  108. defined(EXS_WIFI_RELAY_V31) || \
  109. defined(GENERIC_8CH) || \
  110. defined(GENERIC_ESP01S_RELAY_V40) || \
  111. defined(GENERIC_ESP01S_RGBLED_V10) || \
  112. defined(GREEN_ESP8266RELAY) || \
  113. defined(HELTEC_TOUCHRELAY) || \
  114. defined(HEYGO_HY02) || \
  115. defined(IKE_ESPIKE) || \
  116. defined(ITEAD_1CH_INCHING) || \
  117. defined(ITEAD_MOTOR) || \
  118. defined(ITEAD_S20) || \
  119. defined(ITEAD_SLAMPHER) || \
  120. defined(ITEAD_SONOFF_4CH) || \
  121. defined(ITEAD_SONOFF_4CH_PRO) || \
  122. defined(ITEAD_SONOFF_BASIC) || \
  123. defined(ITEAD_SONOFF_DUAL_R2) || \
  124. defined(ITEAD_SONOFF_IFAN02) || \
  125. defined(ITEAD_SONOFF_RF) || \
  126. defined(ITEAD_SONOFF_SV) || \
  127. defined(ITEAD_SONOFF_T1_1CH) || \
  128. defined(ITEAD_SONOFF_T1_2CH) || \
  129. defined(ITEAD_SONOFF_T1_3CH) || \
  130. defined(ITEAD_SONOFF_TOUCH) || \
  131. defined(JANGOE_WIFI_RELAY_NC) || \
  132. defined(JANGOE_WIFI_RELAY_NO) || \
  133. defined(JORGEGARCIA_WIFI_RELAYS) || \
  134. defined(LINGAN_SWA1) || \
  135. defined(LUANI_HVIO) || \
  136. defined(NEO_COOLCAM_NAS_WR01W) || \
  137. defined(NODEMCU_LOLIN) || \
  138. defined(OPENENERGYMONITOR_MQTT_RELAY) || \
  139. defined(TINKERMAN_ESPURNA_SWITCH) || \
  140. defined(TONBUX_MOSQUITO_KILLER) || \
  141. defined(TONBUX_POWERSTRIP02) || \
  142. defined(TONBUX_XSSSA06) || \
  143. defined(WEMOS_D1_MINI_RELAYSHIELD) || \
  144. defined(WION_50055) || \
  145. defined(WORKCHOICE_ECOPLUG) || \
  146. defined(XENON_SM_PW702U) || \
  147. defined(YJZK_SWITCH_2CH) || \
  148. defined(ZHILDE_EU44_W)
  149. #define ESPURNA_IMAGE ESPURNA_BASIC
  150. // -----------------------------------------------------------------------------
  151. #elif \
  152. defined(BLITZWOLF_BWSHP2) || \
  153. defined(HOMECUBE_16A) || \
  154. defined(ITEAD_SONOFF_POW) || \
  155. defined(KMC_70011) || \
  156. defined(MAXCIO_WUS002S) || \
  157. defined(TINKERMAN_ESPURNA_H06) || \
  158. defined(TINKERMAN_ESPURNA_H08) || \
  159. defined(VANZAVANZU_SMART_WIFI_PLUG_MINI) || \
  160. defined(YIDIAN_XSSSA05)
  161. #define ESPURNA_IMAGE ESPURNA_HLW8012
  162. // -----------------------------------------------------------------------------
  163. #elif \
  164. defined(ITEAD_SONOFF_POW_R2) || \
  165. defined(ITEAD_SONOFF_S31)
  166. #define ESPURNA_IMAGE ESPURNA_CSE77XX
  167. // -----------------------------------------------------------------------------
  168. #elif defined(GENERIC_V9261F)
  169. #define ESPURNA_IMAGE ESPURNA_V9261F
  170. // -----------------------------------------------------------------------------
  171. #elif defined(GENERIC_ECH1560)
  172. #define ESPURNA_IMAGE ESPURNA_ECH1560
  173. // -----------------------------------------------------------------------------
  174. #elif \
  175. defined(GENERIC_ESP01S_DHT11_V10) || \
  176. defined(GENERIC_ESP01S_DS18B20_V10) || \
  177. defined(ITEAD_SONOFF_TH)
  178. #define ESPURNA_IMAGE ESPURNA_SENSOR
  179. // -----------------------------------------------------------------------------
  180. #elif defined(TINKERMAN_RFM69GW)
  181. #define ESPURNA_IMAGE ESPURNA_RFM69
  182. // -----------------------------------------------------------------------------
  183. #elif defined(ITEAD_SONOFF_DUAL)
  184. #define ESPURNA_IMAGE ESPURNA_SONOFF_DUAL
  185. // -----------------------------------------------------------------------------
  186. #elif defined(STM_RELAY)
  187. #define ESPURNA_IMAGE ESPURNA_STM
  188. // -----------------------------------------------------------------------------
  189. #elif defined(GENERIC_GEIGER_COUNTER)
  190. #define ESPURNA_IMAGE ESPURNA_GEIGER
  191. // -----------------------------------------------------------------------------
  192. // PENDING
  193. // -----------------------------------------------------------------------------
  194. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  195. #define ESPURNA_IMAGE ESPURNA_SONOFF_RFBRIDGE
  196. // Info
  197. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  198. // RFB Direct hack thanks to @wildwiz
  199. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  200. #ifndef RFB_DIRECT
  201. #define RFB_DIRECT 0
  202. #endif
  203. #ifndef RFB_RX_PIN
  204. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  205. #endif
  206. #ifndef RFB_TX_PIN
  207. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  208. #endif
  209. // When using un-modified harware, ESPurna communicates with the secondary
  210. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  211. // the port and remove UART noise on serial line
  212. #if not RFB_DIRECT
  213. #define SERIAL_BAUDRATE 19200
  214. #define DEBUG_SERIAL_SUPPORT 0
  215. #endif
  216. // -----------------------------------------------------------------------------
  217. #elif defined(MANCAVEMADE_ESPLIVE)
  218. #define ESPURNA_IMAGE ESPURNA_SENSOR
  219. // DS18B20
  220. #define DALLAS_PIN 2
  221. #define DALLAS_UPDATE_INTERVAL 5000
  222. #define TEMPERATURE_MIN_CHANGE 1.0
  223. // -----------------------------------------------------------------------------
  224. #elif defined(PILOTAK_ESP_DIN_V1)
  225. #define ESPURNA_IMAGE ESPURNA_SENSOR
  226. #ifndef RF_SUPPORT
  227. #define RF_SUPPORT 1 // Does this need the RFBRIDGE image?
  228. #endif
  229. #define RF_PIN 14
  230. // -----------------------------------------------------------------------------
  231. #elif defined(ITEAD_BNSZ01)
  232. #define ESPURNA_IMAGE ESPURNA_DIMMER
  233. // Info
  234. #define LIGHT_CHANNELS 1
  235. #define LIGHT_CH1_PIN 12
  236. #define LIGHT_CH1_INVERSE 0
  237. #elif defined(ITEAD_SONOFF_B1)
  238. #define ESPURNA_IMAGE ESPURNA_MY92XX
  239. // Info
  240. #define LIGHT_CHANNELS 5
  241. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  242. #define MY92XX_CHIPS 2
  243. #define MY92XX_DI_PIN 12
  244. #define MY92XX_DCKI_PIN 14
  245. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  246. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  247. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  248. #elif defined(ITEAD_SONOFF_LED)
  249. #define ESPURNA_IMAGE ESPURNA_DIMMER
  250. // Info
  251. #define LIGHT_CHANNELS 2
  252. #define LIGHT_CH1_PIN 12 // Cold white
  253. #define LIGHT_CH2_PIN 14 // Warm white
  254. #define LIGHT_CH1_INVERSE 0
  255. #define LIGHT_CH2_INVERSE 0
  256. #elif defined(AITHINKER_AI_LIGHT)
  257. #define ESPURNA_IMAGE ESPURNA_MY92XX
  258. // Info
  259. #define LIGHT_CHANNELS 4
  260. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  261. #define MY92XX_CHIPS 1
  262. #define MY92XX_DI_PIN 13
  263. #define MY92XX_DCKI_PIN 15
  264. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  265. #define MY92XX_MAPPING 0, 1, 2, 3
  266. #elif defined(MAGICHOME_LED_CONTROLLER)
  267. #define ESPURNA_IMAGE ESPURNA_DIMMER
  268. // Info
  269. #define DUMMY_RELAY_COUNT 1
  270. #define LIGHT_CHANNELS 4
  271. #define LIGHT_CH1_PIN 14 // RED
  272. #define LIGHT_CH2_PIN 5 // GREEN
  273. #define LIGHT_CH3_PIN 12 // BLUE
  274. #define LIGHT_CH4_PIN 13 // WHITE
  275. #define LIGHT_CH1_INVERSE 0
  276. #define LIGHT_CH2_INVERSE 0
  277. #define LIGHT_CH3_INVERSE 0
  278. #define LIGHT_CH4_INVERSE 0
  279. // IR
  280. #define IR_SUPPORT 1
  281. #define IR_RECEIVER_PIN 4
  282. #define IR_BUTTON_SET 1
  283. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  284. #define ESPURNA_IMAGE ESPURNA_DIMMER
  285. // Info
  286. #define LIGHT_CHANNELS 4
  287. #define LIGHT_CH1_PIN 5 // RED
  288. #define LIGHT_CH2_PIN 12 // GREEN
  289. #define LIGHT_CH3_PIN 13 // BLUE
  290. #define LIGHT_CH4_PIN 15 // WHITE
  291. #define LIGHT_CH1_INVERSE 0
  292. #define LIGHT_CH2_INVERSE 0
  293. #define LIGHT_CH3_INVERSE 0
  294. #define LIGHT_CH4_INVERSE 0
  295. // IR
  296. #define IR_SUPPORT 1
  297. #define IR_RECEIVER_PIN 4
  298. #define IR_BUTTON_SET 1
  299. #elif defined(HUACANXING_H801)
  300. #define ESPURNA_IMAGE ESPURNA_DIMMER
  301. // Info
  302. #define DEBUG_PORT Serial1
  303. #define SERIAL_RX_ENABLED 1
  304. #define LIGHT_CHANNELS 5
  305. #define LIGHT_CH1_PIN 15 // RED
  306. #define LIGHT_CH2_PIN 13 // GREEN
  307. #define LIGHT_CH3_PIN 12 // BLUE
  308. #define LIGHT_CH4_PIN 14 // WHITE1
  309. #define LIGHT_CH5_PIN 4 // WHITE2
  310. #define LIGHT_CH1_INVERSE 0
  311. #define LIGHT_CH2_INVERSE 0
  312. #define LIGHT_CH3_INVERSE 0
  313. #define LIGHT_CH4_INVERSE 0
  314. #define LIGHT_CH5_INVERSE 0
  315. #elif defined(HUACANXING_H802)
  316. #define ESPURNA_IMAGE ESPURNA_DIMMER
  317. // Info
  318. #define DEBUG_PORT Serial1
  319. #define SERIAL_RX_ENABLED 1
  320. #define LIGHT_CHANNELS 4
  321. #define LIGHT_CH1_PIN 12 // RED
  322. #define LIGHT_CH2_PIN 14 // GREEN
  323. #define LIGHT_CH3_PIN 13 // BLUE
  324. #define LIGHT_CH4_PIN 15 // WHITE
  325. #define LIGHT_CH1_INVERSE 0
  326. #define LIGHT_CH2_INVERSE 0
  327. #define LIGHT_CH3_INVERSE 0
  328. #define LIGHT_CH4_INVERSE 0
  329. #elif defined(INTERMITTECH_QUINLED)
  330. #define ESPURNA_IMAGE ESPURNA_DIMMER
  331. // Info
  332. #define LIGHT_CHANNELS 2
  333. #define LIGHT_CH1_PIN 0
  334. #define LIGHT_CH2_PIN 2
  335. #define LIGHT_CH1_INVERSE 0
  336. #define LIGHT_CH2_INVERSE 0
  337. #elif defined(ARILUX_AL_LC01)
  338. #define ESPURNA_IMAGE ESPURNA_DIMMER
  339. // Info
  340. #define LIGHT_CHANNELS 3
  341. #define LIGHT_CH1_PIN 5 // RED
  342. #define LIGHT_CH2_PIN 12 // GREEN
  343. #define LIGHT_CH3_PIN 13 // BLUE
  344. #define LIGHT_CH1_INVERSE 0
  345. #define LIGHT_CH2_INVERSE 0
  346. #define LIGHT_CH3_INVERSE 0
  347. #elif defined(ARILUX_AL_LC02)
  348. #define ESPURNA_IMAGE ESPURNA_DIMMER
  349. // Info
  350. #define LIGHT_CHANNELS 4
  351. #define LIGHT_CH1_PIN 12 // RED
  352. #define LIGHT_CH2_PIN 5 // GREEN
  353. #define LIGHT_CH3_PIN 13 // BLUE
  354. #define LIGHT_CH4_PIN 15 // WHITE1
  355. #define LIGHT_CH1_INVERSE 0
  356. #define LIGHT_CH2_INVERSE 0
  357. #define LIGHT_CH3_INVERSE 0
  358. #define LIGHT_CH4_INVERSE 0
  359. #elif defined(ARILUX_AL_LC06)
  360. #define ESPURNA_IMAGE ESPURNA_DIMMER
  361. // Info
  362. #define LIGHT_CHANNELS 5
  363. #define LIGHT_CH1_PIN 14 // RED
  364. #define LIGHT_CH2_PIN 12 // GREEN
  365. #define LIGHT_CH3_PIN 13 // BLUE
  366. #define LIGHT_CH4_PIN 15 // WHITE1
  367. #define LIGHT_CH5_PIN 5 // WHITE2
  368. #define LIGHT_CH1_INVERSE 0
  369. #define LIGHT_CH2_INVERSE 0
  370. #define LIGHT_CH3_INVERSE 0
  371. #define LIGHT_CH4_INVERSE 0
  372. #define LIGHT_CH5_INVERSE 0
  373. #elif defined(ARILUX_AL_LC11)
  374. #define ESPURNA_IMAGE ESPURNA_DIMMER
  375. // Info
  376. #define LIGHT_CHANNELS 5
  377. #define LIGHT_CH1_PIN 5 // RED
  378. #define LIGHT_CH2_PIN 4 // GREEN
  379. #define LIGHT_CH3_PIN 14 // BLUE
  380. #define LIGHT_CH4_PIN 13 // WHITE1
  381. #define LIGHT_CH5_PIN 12 // WHITE1
  382. #define LIGHT_CH1_INVERSE 0
  383. #define LIGHT_CH2_INVERSE 0
  384. #define LIGHT_CH3_INVERSE 0
  385. #define LIGHT_CH4_INVERSE 0
  386. #define LIGHT_CH5_INVERSE 0
  387. #elif defined(ARILUX_E27)
  388. #define ESPURNA_IMAGE ESPURNA_MY92XX
  389. // Info
  390. #define LIGHT_CHANNELS 4
  391. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  392. #define MY92XX_CHIPS 1
  393. #define MY92XX_DI_PIN 13
  394. #define MY92XX_DCKI_PIN 15
  395. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  396. #define MY92XX_MAPPING 0, 1, 2, 3
  397. #elif defined(AUTHOMETION_LYT8266)
  398. #define ESPURNA_IMAGE ESPURNA_DIMMER
  399. // Info
  400. #define LIGHT_CHANNELS 4
  401. #define LIGHT_CH1_PIN 13 // RED
  402. #define LIGHT_CH2_PIN 12 // GREEN
  403. #define LIGHT_CH3_PIN 14 // BLUE
  404. #define LIGHT_CH4_PIN 2 // WHITE
  405. #define LIGHT_CH1_INVERSE 0
  406. #define LIGHT_CH2_INVERSE 0
  407. #define LIGHT_CH3_INVERSE 0
  408. #define LIGHT_CH4_INVERSE 0
  409. #define LIGHT_ENABLE_PIN 15
  410. #elif defined(GIZWITS_WITTY_CLOUD)
  411. #define ESPURNA_IMAGE ESPURNA_DIMMER
  412. // Info
  413. #define LIGHT_CHANNELS 3
  414. #define LIGHT_CH1_PIN 15 // RED
  415. #define LIGHT_CH2_PIN 12 // GREEN
  416. #define LIGHT_CH3_PIN 13 // BLUE
  417. #define LIGHT_CH1_INVERSE 0
  418. #define LIGHT_CH2_INVERSE 0
  419. #define LIGHT_CH3_INVERSE 0
  420. #define ANALOG_SUPPORT 1 // TODO: specific or generic?
  421. #elif defined(GENERIC_AG_L4)
  422. #define ESPURNA_IMAGE ESPURNA_DIMMER
  423. // Info
  424. #define LIGHT_CHANNELS 3
  425. #define LIGHT_CH1_PIN 14 // RED
  426. #define LIGHT_CH2_PIN 13 // GREEN
  427. #define LIGHT_CH3_PIN 12 // BLUE
  428. #define LIGHT_CH1_INVERSE 0
  429. #define LIGHT_CH2_INVERSE 0
  430. #define LIGHT_CH3_INVERSE 0
  431. // -----------------------------------------------------------------------------
  432. // TEST boards (do not use!!)
  433. // -----------------------------------------------------------------------------
  434. #elif defined(TRAVIS01)
  435. #define ESPURNA_IMAGE ESPURNA_BASIC
  436. // A bit of I2C - pins 3,4
  437. #define I2C_SDA_PIN 3
  438. #define I2C_SCL_PIN 4
  439. // And, as they say in "From Dusk till Dawn":
  440. // This is a sensor blow out!
  441. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  442. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  443. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  444. // C'mon, you want sensor, come on in sensor lovers!
  445. // If we don’t got it, you don't want it!
  446. #define AM2320_SUPPORT 1
  447. #define BH1750_SUPPORT 1
  448. #define BMX280_SUPPORT 1
  449. #define SHT3X_I2C_SUPPORT 1
  450. #define EMON_ADC121_SUPPORT 1
  451. #define EMON_ADS1X15_SUPPORT 1
  452. #define SHT3X_I2C_SUPPORT 1
  453. #define SI7021_SUPPORT 1
  454. #define PMSX003_SUPPORT 1
  455. #define SENSEAIR_SUPPORT 1
  456. // A bit of lights - pin 5
  457. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  458. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  459. #define DUMMY_RELAY_COUNT 1
  460. #define LIGHT_CHANNELS 1
  461. #define LIGHT_CH1_PIN 5
  462. #define LIGHT_CH1_INVERSE 0
  463. // A bit of HLW8012 - pins 6,7,8
  464. #ifndef HLW8012_SUPPORT
  465. #define HLW8012_SUPPORT 1
  466. #endif
  467. #define HLW8012_SEL_PIN 6
  468. #define HLW8012_CF1_PIN 7
  469. #define HLW8012_CF_PIN 8
  470. // A bit of Dallas - pin 9
  471. #ifndef DALLAS_SUPPORT
  472. #define DALLAS_SUPPORT 1
  473. #endif
  474. #define DALLAS_PIN 9
  475. // A bit of ECH1560 - pins 10,11, 12
  476. #ifndef ECH1560_SUPPORT
  477. #define ECH1560_SUPPORT 1
  478. #endif
  479. #define ECH1560_CLK_PIN 10
  480. #define ECH1560_MISO_PIN 11
  481. #define ECH1560_INVERTED 12
  482. #elif defined(TRAVIS02)
  483. #define ESPURNA_IMAGE ESPURNA_BASIC
  484. // A bit of CSE7766 - pin 1
  485. #ifndef CSE7766_SUPPORT
  486. #define CSE7766_SUPPORT 1
  487. #endif
  488. #define CSE7766_PIN 1
  489. // Relay type dual - pins 2,3
  490. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  491. #define RELAY1_PIN 2
  492. #define RELAY2_PIN 3
  493. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  494. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  495. // IR - pin 4
  496. #define IR_SUPPORT 1
  497. #define IR_RECEIVER_PIN 4
  498. #define IR_BUTTON_SET 1
  499. // A bit of DHT - pin 5
  500. #ifndef DHT_SUPPORT
  501. #define DHT_SUPPORT 1
  502. #endif
  503. #define DHT_PIN 5
  504. // A bit of TMP3X (analog)
  505. #define TMP3X_SUPPORT 1
  506. // A bit of EVENTS - pin 10
  507. #define EVENTS_SUPPORT 1
  508. #define EVENTS_PIN 6
  509. // Sonar
  510. #define SONAR_SUPPORT 1
  511. #define SONAR_TRIGGER 7
  512. #define SONAR_ECHO 8
  513. // MHZ19
  514. #define MHZ19_SUPPORT 1
  515. #define MHZ19_RX_PIN 9
  516. #define MHZ19_TX_PIN 10
  517. // PZEM004T
  518. #define PZEM004T_SUPPORT 1
  519. #define PZEM004T_RX_PIN 11
  520. #define PZEM004T_TX_PIN 12
  521. // V9261F
  522. #define V9261F_SUPPORT 1
  523. #define V9261F_PIN 13
  524. // GUVAS12SD
  525. #define GUVAS12SD_SUPPORT 1
  526. #define GUVAS12SD_PIN 14
  527. // Test non-default modules
  528. #define MDNS_CLIENT_SUPPORT 1
  529. #define NOFUSS_SUPPORT 1
  530. #define UART_MQTT_SUPPORT 1
  531. #define INFLUXDB_SUPPORT 1
  532. #define IR_SUPPORT 1
  533. #elif defined(TRAVIS03)
  534. #define ESPURNA_IMAGE ESPURNA_BASIC
  535. // MY9231 Light - pins 1,2
  536. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  537. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  538. #define DUMMY_RELAY_COUNT 1
  539. #define LIGHT_CHANNELS 5
  540. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  541. #define MY92XX_CHIPS 2
  542. #define MY92XX_DI_PIN 1
  543. #define MY92XX_DCKI_PIN 2
  544. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  545. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  546. // A bit of Analog EMON (analog)
  547. #ifndef EMON_ANALOG_SUPPORT
  548. #define EMON_ANALOG_SUPPORT 1
  549. #endif
  550. // Test non-default modules
  551. #define LLMNR_SUPPORT 1
  552. #define NETBIOS_SUPPORT 1
  553. #define SSDP_SUPPORT 1
  554. // -----------------------------------------------------------------------------
  555. // ESPurna Core
  556. // -----------------------------------------------------------------------------
  557. #else
  558. // This is a special device targeted to generate a light-weight binary image
  559. // meant to be able to do two-step-updates:
  560. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  561. #define ESPURNA_IMAGE ESPURNA_CORE
  562. #endif
  563. // -----------------------------------------------------------------------------
  564. // Image definitions
  565. // -----------------------------------------------------------------------------
  566. #if ESPURNA_IMAGE == ESPURNA_CORE
  567. // Disable non-core modules
  568. #define ALEXA_SUPPORT 0
  569. #define BROKER_SUPPORT 0
  570. #define BUTTON_SUPPORT 0
  571. #define DOMOTICZ_SUPPORT 0
  572. #define HOMEASSISTANT_SUPPORT 0
  573. #define I2C_SUPPORT 0
  574. #define MDNS_SERVER_SUPPORT 0
  575. #define MQTT_SUPPORT 0
  576. #define NTP_SUPPORT 0
  577. #define SCHEDULER_SUPPORT 0
  578. #define SENSOR_SUPPORT 0
  579. #define THINGSPEAK_SUPPORT 0
  580. #define WEB_SUPPORT 0
  581. // Extra light-weight image
  582. //#define DEBUG_SERIAL_SUPPORT 0
  583. //#define DEBUG_TELNET_SUPPORT 0
  584. //#define DEBUG_WEB_SUPPORT 0
  585. //#define LED_SUPPORT 0
  586. //#define TELNET_SUPPORT 0
  587. //#define TERMINAL_SUPPORT 0
  588. #elif ESPURNA_IMAGE == ESPURNA_BASIC
  589. #elif ESPURNA_IMAGE == ESPURNA_DIMMER
  590. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  591. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  592. #elif ESPURNA_IMAGE == ESPURNA_MY92XX
  593. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  594. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  595. #elif ESPURNA_IMAGE == ESPURNA_EMON
  596. #ifndef EMON_ANALOG_SUPPORT
  597. #define EMON_ANALOG_SUPPORT 1
  598. #endif
  599. #ifndef EMON_ADC121_SUPPORT
  600. #define EMON_ADC121_SUPPORT 1
  601. #endif
  602. #ifndef EMON_ADS1X15_SUPPORT
  603. #define EMON_ADS1X15_SUPPORT 1
  604. #endif
  605. #elif ESPURNA_IMAGE == ESPURNA_HLW8012
  606. #ifndef HLW8012_SUPPORT
  607. #define HLW8012_SUPPORT 1
  608. #endif
  609. #elif ESPURNA_IMAGE == ESPURNA_CSE77XX
  610. #ifndef CSE7766_SUPPORT
  611. #define CSE7766_SUPPORT 1
  612. #endif
  613. #elif ESPURNA_IMAGE == ESPURNA_V9261F
  614. #ifndef V9261F_SUPPORT
  615. #define V9261F_SUPPORT 1
  616. #endif
  617. #ifndef ALEXA_SUPPORT
  618. #define ALEXA_SUPPORT 0
  619. #endif
  620. #elif ESPURNA_IMAGE == ESPURNA_ECH1560
  621. #ifndef ECH1560_SUPPORT
  622. #define ECH1560_SUPPORT 1
  623. #endif
  624. #ifndef ALEXA_SUPPORT
  625. #define ALEXA_SUPPORT 0
  626. #endif
  627. #elif ESPURNA_IMAGE == ESPURNA_SENSOR
  628. #ifndef ANALOG_SUPPORT
  629. #define ANALOG_SUPPORT 1
  630. #endif
  631. #ifndef DALLAS_SUPPORT
  632. #define DALLAS_SUPPORT 1
  633. #endif
  634. #ifndef DHT_SUPPORT
  635. #define DHT_SUPPORT 1
  636. #endif
  637. #ifndef DIGITAL_SUPPORT
  638. #define DIGITAL_SUPPORT 1
  639. #endif
  640. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_DUAL
  641. #define SERIAL_BAUDRATE 19230
  642. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  643. #define DEBUG_SERIAL_SUPPORT 0
  644. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_RFBRIDGE
  645. #elif ESPURNA_IMAGE == ESPURNA_RFM69
  646. // RFM69GW
  647. #define RFM69_SUPPORT 1
  648. // Disable non-core modules
  649. #define ALEXA_SUPPORT 0
  650. #define DOMOTICZ_SUPPORT 0
  651. #define HOMEASSISTANT_SUPPORT 0
  652. #define I2C_SUPPORT 0
  653. #define SCHEDULER_SUPPORT 0
  654. #define SENSOR_SUPPORT 0
  655. #define THINGSPEAK_SUPPORT 0
  656. #elif ESPURNA_IMAGE == ESPURNA_STM
  657. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  658. #define DEBUG_SERIAL_SUPPORT 0
  659. #elif ESPURNA_IMAGE == ESPURNA_GEIGER
  660. // Enable Geiger Counter
  661. #define GEIGER_SUPPORT 1
  662. // Disable uneeded modules
  663. #define ALEXA_SUPPORT 0
  664. #define SCHEDULER_SUPPORT 0
  665. #endif