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.

210 lines
6.2 KiB

  1. //--------------------------------------------------------------------------------
  2. // HARDWARE
  3. // This setting is normally provided by PlatformIO
  4. // Uncomment the appropiate line to build from the Arduino IDE
  5. //--------------------------------------------------------------------------------
  6. //#define NODEMCUV2
  7. //#define SONOFF
  8. //#define SONOFF_TH
  9. //#define SLAMPHER
  10. //#define S20
  11. //#define SONOFF_SV
  12. //#define SONOFF_POW
  13. //#define SONOFF_DUAL
  14. //#define SONOFF_4CH
  15. //#define ESP_RELAY_BOARD
  16. //#define ECOPLUG
  17. //#define ESPURNA
  18. //#define ENABLE_DHT 1
  19. //#define ENABLE_DS18B20 1
  20. //#define ENABLE_EMON 1
  21. //#define ENABLE_HLW8018 1
  22. //#define ENABLE_RF 1
  23. //#define ENABLE_FAUXMO 0
  24. //#define ENABLE_NOFUSS 1
  25. #ifndef ENABLE_FAUXMO
  26. #define ENABLE_FAUXMO 1
  27. #endif
  28. // -----------------------------------------------------------------------------
  29. // Development boards
  30. // -----------------------------------------------------------------------------
  31. #if defined(NODEMCUV2)
  32. #define MANUFACTURER "NODEMCU"
  33. #define DEVICE "LOLIN"
  34. #define BUTTON1_PIN 0
  35. #define RELAY1_PIN 12
  36. #define RELAY1_PIN_INVERSE 0
  37. #define LED1_PIN 2
  38. #define LED1_PIN_INVERSE 1
  39. #elif defined(D1_RELAYSHIELD)
  40. #define MANUFACTURER "WEMOS"
  41. #define DEVICE "D1_MINI"
  42. #define RELAY1_PIN 5
  43. #define RELAY1_PIN_INVERSE 0
  44. #define LED1_PIN 2
  45. #define LED1_PIN_INVERSE 1
  46. // -----------------------------------------------------------------------------
  47. // Itead Studio boards
  48. // -----------------------------------------------------------------------------
  49. #elif defined(SONOFF)
  50. #define MANUFACTURER "ITEAD"
  51. #define DEVICE "SONOFF"
  52. #define BUTTON1_PIN 0
  53. #define RELAY1_PIN 12
  54. #define RELAY1_PIN_INVERSE 0
  55. #define LED1_PIN 13
  56. #define LED1_PIN_INVERSE 1
  57. #elif defined(SONOFF_TH)
  58. #define MANUFACTURER "ITEAD"
  59. #define DEVICE "SONOFF_TH"
  60. #define BUTTON1_PIN 0
  61. #define RELAY1_PIN 12
  62. #define RELAY1_PIN_INVERSE 0
  63. #define LED1_PIN 13
  64. #define LED1_PIN_INVERSE 1
  65. #elif defined(SONOFF_SV)
  66. #define MANUFACTURER "ITEAD"
  67. #define DEVICE "SONOFF_SV"
  68. #define BUTTON1_PIN 0
  69. #define RELAY1_PIN 12
  70. #define RELAY1_PIN_INVERSE 0
  71. #define LED1_PIN 13
  72. #define LED1_PIN_INVERSE 1
  73. #elif defined(SLAMPHER)
  74. #define MANUFACTURER "ITEAD"
  75. #define DEVICE "SLAMPHER"
  76. #define BUTTON1_PIN 0
  77. #define RELAY1_PIN 12
  78. #define RELAY1_PIN_INVERSE 0
  79. #define LED1_PIN 13
  80. #define LED1_PIN_INVERSE 1
  81. #elif defined(S20)
  82. #define MANUFACTURER "ITEAD"
  83. #define DEVICE "S20"
  84. #define BUTTON1_PIN 0
  85. #define RELAY1_PIN 12
  86. #define RELAY1_PIN_INVERSE 0
  87. #define LED1_PIN 13
  88. #define LED1_PIN_INVERSE 1
  89. #elif defined(SONOFF_TOUCH)
  90. #define MANUFACTURER "ITEAD"
  91. #define DEVICE "SONOFF_TOUCH"
  92. #define BUTTON1_PIN 0
  93. #define RELAY1_PIN 12
  94. #define RELAY1_PIN_INVERSE 0
  95. #define LED1_PIN 13
  96. #define LED1_PIN_INVERSE 1
  97. #elif defined(SONOFF_POW)
  98. #define MANUFACTURER "ITEAD"
  99. #define DEVICE "SONOFF_POW"
  100. #define BUTTON1_PIN 0
  101. #define RELAY1_PIN 12
  102. #define RELAY1_PIN_INVERSE 0
  103. #define LED1_PIN 15
  104. #define LED1_PIN_INVERSE 0
  105. #define ENABLE_POW 1
  106. #elif defined(SONOFF_DUAL)
  107. #define MANUFACTURER "ITEAD"
  108. #define DEVICE "SONOFF_DUAL"
  109. #define BUTTON1_PIN 0
  110. #define LED1_PIN 13
  111. #define LED1_PIN_INVERSE 1
  112. #undef SERIAL_BAUDRATE
  113. #define SERIAL_BAUDRATE 19230
  114. #elif defined(SONOFF_4CH)
  115. #define MANUFACTURER "ITEAD"
  116. #define DEVICE "SONOFF_4CH"
  117. #define BUTTON1_PIN 0
  118. #define BUTTON2_PIN 9
  119. #define BUTTON3_PIN 10
  120. #define BUTTON4_PIN 14
  121. #define RELAY1_PIN 12
  122. #define RELAY1_PIN_INVERSE 0
  123. #define RELAY2_PIN 5
  124. #define RELAY2_PIN_INVERSE 0
  125. #define RELAY3_PIN 4
  126. #define RELAY3_PIN_INVERSE 0
  127. #define RELAY4_PIN 15
  128. #define RELAY4_PIN_INVERSE 0
  129. #define LED1_PIN 13
  130. #define LED1_PIN_INVERSE 1
  131. // -----------------------------------------------------------------------------
  132. // Electrodragon boards
  133. // -----------------------------------------------------------------------------
  134. #elif defined(ESP_RELAY_BOARD)
  135. #define MANUFACTURER "ELECTRODRAGON"
  136. #define DEVICE "ESP_RELAY_BOARD"
  137. #define BUTTON1_PIN 0
  138. #define BUTTON2_PIN 2
  139. #define RELAY1_PIN 12
  140. #define RELAY1_PIN_INVERSE 0
  141. #define RELAY2_PIN 13
  142. #define RELAY2_PIN_INVERSE 0
  143. #define LED1_PIN 16
  144. #define LED1_PIN_INVERSE 0
  145. // -----------------------------------------------------------------------------
  146. // WorkChoice ecoPlug
  147. // -----------------------------------------------------------------------------
  148. #elif defined(ECOPLUG)
  149. #define MANUFACTURER "WORKCHOICE"
  150. #define DEVICE "ECOPLUG"
  151. #define BUTTON1_PIN 13
  152. #define RELAY1_PIN 15
  153. #define RELAY1_PIN_INVERSE 0
  154. #define LED1_PIN 2
  155. #define LED1_PIN_INVERSE 0
  156. // -----------------------------------------------------------------------------
  157. // ESPurna board (still beta)
  158. // -----------------------------------------------------------------------------
  159. #elif defined(ESPURNA)
  160. #define MANUFACTURER "TINKERMAN"
  161. #define DEVICE "ESPURNA"
  162. #define BUTTON1_PIN 0
  163. #define RELAY1_PIN 12
  164. #define RELAY1_PIN_INVERSE 0
  165. #define LED1_PIN 13
  166. #define LED1_PIN_INVERSE 0
  167. // -----------------------------------------------------------------------------
  168. // Unknown hardware
  169. // -----------------------------------------------------------------------------
  170. #else
  171. #error "UNSUPPORTED HARDWARE!"
  172. #endif