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.

280 lines
9.6 KiB

  1. // -----------------------------------------------------------------------------
  2. // Development boards
  3. // -----------------------------------------------------------------------------
  4. #if defined(NODEMCUV2)
  5. #define MANUFACTURER "NODEMCU"
  6. #define DEVICE "LOLIN"
  7. #define BUTTON1_PIN 0
  8. #define BUTTON1_RELAY 1
  9. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH
  10. #define RELAY1_PIN 12
  11. #define RELAY1_PIN_INVERSE 0
  12. #define LED1_PIN 2
  13. #define LED1_PIN_INVERSE 1
  14. #elif defined(D1_RELAYSHIELD)
  15. #define MANUFACTURER "WEMOS"
  16. #define DEVICE "D1_MINI"
  17. #define RELAY1_PIN 5
  18. #define RELAY1_PIN_INVERSE 0
  19. #define LED1_PIN 2
  20. #define LED1_PIN_INVERSE 1
  21. // -----------------------------------------------------------------------------
  22. // Itead Studio boards
  23. // -----------------------------------------------------------------------------
  24. #elif defined(SONOFF)
  25. #define MANUFACTURER "ITEAD"
  26. #define DEVICE "SONOFF"
  27. #define BUTTON1_PIN 0
  28. #define BUTTON1_RELAY 1
  29. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  30. #define RELAY1_PIN 12
  31. #define RELAY1_PIN_INVERSE 0
  32. #define LED1_PIN 13
  33. #define LED1_PIN_INVERSE 1
  34. #elif defined(SONOFF_TH)
  35. #define MANUFACTURER "ITEAD"
  36. #define DEVICE "SONOFF_TH"
  37. #define BUTTON1_PIN 0
  38. #define BUTTON1_RELAY 1
  39. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  40. #define RELAY1_PIN 12
  41. #define RELAY1_PIN_INVERSE 0
  42. #define LED1_PIN 13
  43. #define LED1_PIN_INVERSE 1
  44. #elif defined(SONOFF_SV)
  45. #define MANUFACTURER "ITEAD"
  46. #define DEVICE "SONOFF_SV"
  47. #define BUTTON1_PIN 0
  48. #define BUTTON1_RELAY 1
  49. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  50. #define RELAY1_PIN 12
  51. #define RELAY1_PIN_INVERSE 0
  52. #define LED1_PIN 13
  53. #define LED1_PIN_INVERSE 1
  54. #elif defined(SLAMPHER)
  55. #define MANUFACTURER "ITEAD"
  56. #define DEVICE "SLAMPHER"
  57. #define BUTTON1_PIN 0
  58. #define BUTTON1_RELAY 1
  59. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  60. #define RELAY1_PIN 12
  61. #define RELAY1_PIN_INVERSE 0
  62. #define LED1_PIN 13
  63. #define LED1_PIN_INVERSE 1
  64. #elif defined(S20)
  65. #define MANUFACTURER "ITEAD"
  66. #define DEVICE "S20"
  67. #define BUTTON1_PIN 0
  68. #define BUTTON1_RELAY 1
  69. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  70. #define RELAY1_PIN 12
  71. #define RELAY1_PIN_INVERSE 0
  72. #define LED1_PIN 13
  73. #define LED1_PIN_INVERSE 1
  74. #elif defined(SONOFF_TOUCH)
  75. #define MANUFACTURER "ITEAD"
  76. #define DEVICE "SONOFF_TOUCH"
  77. #define BUTTON1_PIN 0
  78. #define BUTTON1_RELAY 1
  79. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  80. #define RELAY1_PIN 12
  81. #define RELAY1_PIN_INVERSE 0
  82. #define LED1_PIN 13
  83. #define LED1_PIN_INVERSE 1
  84. #elif defined(SONOFF_POW)
  85. #define MANUFACTURER "ITEAD"
  86. #define DEVICE "SONOFF_POW"
  87. #define BUTTON1_PIN 0
  88. #define BUTTON1_RELAY 1
  89. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  90. #define RELAY1_PIN 12
  91. #define RELAY1_PIN_INVERSE 0
  92. #define LED1_PIN 15
  93. #define LED1_PIN_INVERSE 0
  94. #define ENABLE_POW 1
  95. #elif defined(SONOFF_DUAL)
  96. #define MANUFACTURER "ITEAD"
  97. #define DEVICE "SONOFF_DUAL"
  98. #define BUTTON1_PIN 0
  99. #define LED1_PIN 13
  100. #define LED1_PIN_INVERSE 1
  101. #undef SERIAL_BAUDRATE
  102. #define SERIAL_BAUDRATE 19230
  103. #elif defined(SONOFF_4CH)
  104. #define MANUFACTURER "ITEAD"
  105. #define DEVICE "SONOFF_4CH"
  106. #define BUTTON1_PIN 0
  107. #define BUTTON1_RELAY 1
  108. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  109. #define BUTTON2_PIN 9
  110. #define BUTTON2_RELAY 2
  111. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  112. #define BUTTON3_PIN 10
  113. #define BUTTON3_RELAY 3
  114. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  115. #define BUTTON4_PIN 14
  116. #define BUTTON4_RELAY 4
  117. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  118. #define RELAY1_PIN 12
  119. #define RELAY1_PIN_INVERSE 0
  120. #define RELAY2_PIN 5
  121. #define RELAY2_PIN_INVERSE 0
  122. #define RELAY3_PIN 4
  123. #define RELAY3_PIN_INVERSE 0
  124. #define RELAY4_PIN 15
  125. #define RELAY4_PIN_INVERSE 0
  126. #define LED1_PIN 13
  127. #define LED1_PIN_INVERSE 1
  128. #elif defined(ITEAD_1CH_INCHING)
  129. // Note: definitions for this board are based on third party data
  130. // and have not been fully tested yet. If you have the chance to
  131. // test them, please report back. Thank you.
  132. #define MANUFACTURER "ITEAD"
  133. #define DEVICE "1CH_INCHING"
  134. #define BUTTON1_PIN 0
  135. #define BUTTON1_RELAY 1
  136. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  137. #define BUTTON2_PIN 15
  138. #define BUTTON2_RELAY 0
  139. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  140. #define RELAY1_PIN 12
  141. #define RELAY1_PIN_INVERSE 0
  142. #define LED1_PIN 13
  143. #define LED1_PIN_INVERSE 0
  144. #define LED_PULSE 14
  145. // -----------------------------------------------------------------------------
  146. // Electrodragon boards
  147. // -----------------------------------------------------------------------------
  148. #elif defined(ESP_RELAY_BOARD)
  149. #define MANUFACTURER "ELECTRODRAGON"
  150. #define DEVICE "ESP_RELAY_BOARD"
  151. #define BUTTON1_PIN 0
  152. #define BUTTON1_RELAY 1
  153. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  154. #define BUTTON2_PIN 2
  155. #define BUTTON2_RELAY 2
  156. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  157. #define RELAY1_PIN 12
  158. #define RELAY1_PIN_INVERSE 0
  159. #define RELAY2_PIN 13
  160. #define RELAY2_PIN_INVERSE 0
  161. #define LED1_PIN 16
  162. #define LED1_PIN_INVERSE 0
  163. // -----------------------------------------------------------------------------
  164. // WorkChoice ecoPlug
  165. // -----------------------------------------------------------------------------
  166. #elif defined(ECOPLUG)
  167. #define MANUFACTURER "WORKCHOICE"
  168. #define DEVICE "ECOPLUG"
  169. #define BUTTON1_PIN 13
  170. #define BUTTON1_RELAY 1
  171. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  172. #define RELAY1_PIN 15
  173. #define RELAY1_PIN_INVERSE 0
  174. #define LED1_PIN 2
  175. #define LED1_PIN_INVERSE 0
  176. // -----------------------------------------------------------------------------
  177. // JanGoe Wifi Relay (https://github.com/JanGoe/esp8266-wifi-relay)
  178. // -----------------------------------------------------------------------------
  179. #elif defined(WIFI_RELAY_NC)
  180. #define MANUFACTURER "JANGOE"
  181. #define DEVICE "WIFI_RELAY_NC"
  182. #define BUTTON1_PIN 12
  183. #define BUTTON1_RELAY 1
  184. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  185. #define BUTTON2_PIN 13
  186. #define BUTTON2_RELAY 2
  187. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  188. #define RELAY1_PIN 2
  189. #define RELAY1_PIN_INVERSE 1
  190. #define RELAY2_PIN 14
  191. #define RELAY2_PIN_INVERSE 1
  192. #elif defined(WIFI_RELAY_NO)
  193. #define MANUFACTURER "JANGOE"
  194. #define DEVICE "WIFI_RELAY_NO"
  195. #define BUTTON1_PIN 12
  196. #define BUTTON1_RELAY 1
  197. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  198. #define BUTTON2_PIN 13
  199. #define BUTTON2_RELAY 2
  200. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  201. #define RELAY1_PIN 2
  202. #define RELAY1_PIN_INVERSE 0
  203. #define RELAY2_PIN 14
  204. #define RELAY2_PIN_INVERSE 0
  205. // -----------------------------------------------------------------------------
  206. // ESPurna board (still beta)
  207. // -----------------------------------------------------------------------------
  208. #elif defined(ESPURNA)
  209. #define MANUFACTURER "TINKERMAN"
  210. #define DEVICE "ESPURNA"
  211. #define BUTTON1_PIN 0
  212. #define BUTTON1_RELAY 1
  213. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  214. #define RELAY1_PIN 12
  215. #define RELAY1_PIN_INVERSE 0
  216. #define LED1_PIN 13
  217. #define LED1_PIN_INVERSE 0
  218. // -----------------------------------------------------------------------------
  219. // WiFi MQTT Relay / Thermostat
  220. // -----------------------------------------------------------------------------
  221. #elif defined(MQTT_RELAY)
  222. #define MANUFACTURER "OPENENERGYMONITOR"
  223. #define DEVICE "MQTT_RELAY"
  224. #define BUTTON1_PIN 0
  225. #define BUTTON1_RELAY 1
  226. #define RELAY1_PIN 12
  227. #define RELAY1_PIN_INVERSE 0
  228. #define LED1_PIN 16
  229. #define LED1_PIN_INVERSE 0
  230. // -----------------------------------------------------------------------------
  231. // Unknown hardware
  232. // -----------------------------------------------------------------------------
  233. #else
  234. #error "UNSUPPORTED HARDWARE!"
  235. #endif