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.

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