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.

196 lines
6.6 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
8 years ago
  1. //------------------------------------------------------------------------------
  2. // GENERAL
  3. //------------------------------------------------------------------------------
  4. #define SERIAL_BAUDRATE 115200
  5. #define HOSTNAME DEVICE
  6. #define BUFFER_SIZE 1024
  7. #define HEARTBEAT_INTERVAL 300000
  8. //--------------------------------------------------------------------------------
  9. // EEPROM
  10. //--------------------------------------------------------------------------------
  11. #define EEPROM_RELAY_STATUS 0
  12. #define EEPROM_ENERGY_COUNT 1
  13. #define EEPROM_DATA_END 5
  14. //--------------------------------------------------------------------------------
  15. // BUTTON
  16. //--------------------------------------------------------------------------------
  17. #define BUTTON_EVENT_NONE 0
  18. #define BUTTON_EVENT_PRESSED 1
  19. #define BUTTON_EVENT_CLICK 2
  20. #define BUTTON_EVENT_DBLCLICK 3
  21. #define BUTTON_EVENT_LNGCLICK 4
  22. #define BUTTON_MODE_NONE 0
  23. #define BUTTON_MODE_TOGGLE 1
  24. #define BUTTON_MODE_AP 2
  25. #define BUTTON_MODE_RESET 3
  26. #define BUTTON_MODE_PULSE 4
  27. #define BUTTON_DEFAULT_MODE BUTTON_MODE_TOGGLE
  28. //--------------------------------------------------------------------------------
  29. // RELAY
  30. //--------------------------------------------------------------------------------
  31. #define RELAY_MODE_OFF 0
  32. #define RELAY_MODE_ON 1
  33. #define RELAY_MODE_SAME 2
  34. #define RELAY_MODE_TOOGLE 3
  35. #define RELAY_SYNC_ANY 0
  36. #define RELAY_SYNC_NONE_OR_ONE 1
  37. #define RELAY_SYNC_ONE 2
  38. #define RELAY_SYNC_SAME 3
  39. #define RELAY_PULSE_NONE 0
  40. #define RELAY_PULSE_OFF 1
  41. #define RELAY_PULSE_ON 2
  42. // Pulse time in seconds
  43. #define RELAY_PULSE_TIME 1
  44. // 0 means OFF, 1 ON and 2 whatever was before
  45. #define RELAY_MODE RELAY_MODE_OFF
  46. // 0 means ANY, 1 zero or one and 2 one and only one
  47. #define RELAY_SYNC RELAY_SYNC_ANY
  48. // 0 means no pulses, 1 means normally off, 2 normally on
  49. #define RELAY_PULSE_MODE RELAY_PULSE_NONE
  50. //--------------------------------------------------------------------------------
  51. // I18N
  52. //--------------------------------------------------------------------------------
  53. #define TMP_CELSIUS 0
  54. #define TMP_FAHRENHEIT 1
  55. #define TMP_UNITS TMP_CELSIUS
  56. //--------------------------------------------------------------------------------
  57. // LED
  58. //--------------------------------------------------------------------------------
  59. // All defined LEDs in the board can be managed through MQTT
  60. // except the first one when LED_AUTO is set to 1.
  61. // If LED_AUTO is set to 1 the board will use first defined LED to show wifi status.
  62. #define LED_AUTO 1
  63. // -----------------------------------------------------------------------------
  64. // WIFI & WEB
  65. // -----------------------------------------------------------------------------
  66. #define WIFI_RECONNECT_INTERVAL 300000
  67. #define WIFI_MAX_NETWORKS 5
  68. #define ADMIN_PASS "fibonacci"
  69. #define FORCE_CHANGE_PASS 1
  70. #define HTTP_USERNAME "admin"
  71. #define WS_BUFFER_SIZE 5
  72. #define WS_TIMEOUT 1800000
  73. #define WEBSERVER_PORT 80
  74. #define DNS_PORT 53
  75. #define ENABLE_MDNS 1
  76. #define WEB_MODE_NORMAL 0
  77. #define WEB_MODE_PASSWORD 1
  78. #define AP_MODE AP_MODE_ALONE
  79. // This option builds the firmware with the web interface embedded.
  80. // You first have to build the data.h file that holds the contents
  81. // of the web interface by running "gulp buildfs_embed"
  82. #ifndef EMBEDDED_WEB
  83. #define EMBEDDED_WEB 0
  84. #endif
  85. // -----------------------------------------------------------------------------
  86. // OTA & NOFUSS
  87. // -----------------------------------------------------------------------------
  88. #define OTA_PORT 8266
  89. #define NOFUSS_SERVER ""
  90. #define NOFUSS_INTERVAL 3600000
  91. // -----------------------------------------------------------------------------
  92. // MQTT
  93. // -----------------------------------------------------------------------------
  94. #define MQTT_USE_ASYNC 0
  95. #define MQTT_SERVER ""
  96. #define MQTT_PORT 1883
  97. #define MQTT_TOPIC "/test/switch/{identifier}"
  98. #define MQTT_RETAIN true
  99. #define MQTT_QOS 0
  100. #define MQTT_KEEPALIVE 30
  101. #define MQTT_RECONNECT_DELAY 10000
  102. #define MQTT_TRY_INTERVAL 30000
  103. #define MQTT_MAX_TRIES 12
  104. #define MQTT_SKIP_RETAINED 1
  105. #define MQTT_SKIP_TIME 1000
  106. #define MQTT_ACTION_TOPIC "/action"
  107. #define MQTT_RELAY_TOPIC "/relay"
  108. #define MQTT_LED_TOPIC "/led"
  109. #define MQTT_BUTTON_TOPIC "/button"
  110. #define MQTT_IP_TOPIC "/ip"
  111. #define MQTT_VERSION_TOPIC "/version"
  112. #define MQTT_HEARTBEAT_TOPIC "/status"
  113. #define MQTT_ACTION_RESET "reset"
  114. #define MQTT_CONNECT_EVENT 0
  115. #define MQTT_DISCONNECT_EVENT 1
  116. #define MQTT_MESSAGE_EVENT 2
  117. // Custom get and set postfixes
  118. // Use something like "/status" or "/set", with leading slash
  119. #define MQTT_USE_GETTER ""
  120. #define MQTT_USE_SETTER ""
  121. // -----------------------------------------------------------------------------
  122. // I2C
  123. // -----------------------------------------------------------------------------
  124. #define ENABLE_I2C 0
  125. #define I2C_SDA_PIN 4
  126. #define I2C_SCL_PIN 14
  127. #define I2C_CLOCK_STRETCH_TIME 200
  128. #define I2C_SCL_FREQUENCY 1000
  129. // -----------------------------------------------------------------------------
  130. // DOMOTICZ
  131. // -----------------------------------------------------------------------------
  132. #ifndef ENABLE_DOMOTICZ
  133. #define ENABLE_DOMOTICZ 1
  134. #endif
  135. #define DOMOTICZ_IN_TOPIC "domoticz/in"
  136. #define DOMOTICZ_OUT_TOPIC "domoticz/out"
  137. // -----------------------------------------------------------------------------
  138. // NTP
  139. // -----------------------------------------------------------------------------
  140. #define NTP_SERVER "pool.ntp.org"
  141. #define NTP_TIME_OFFSET 1
  142. #define NTP_DAY_LIGHT true
  143. #define NTP_UPDATE_INTERVAL 1800
  144. // -----------------------------------------------------------------------------
  145. // FAUXMO
  146. // -----------------------------------------------------------------------------
  147. // This setting defines whether Alexa support should be built into the firmware
  148. #ifndef ENABLE_FAUXMO
  149. #define ENABLE_FAUXMO 1
  150. #endif
  151. // This is default value for the fauxmoEnabled setting that defines whether
  152. // this device should be discoberable and respond to Alexa commands.
  153. // Both ENABLE_FAUXMO and fauxmoEnabled should be 1 for Alexa support to work.
  154. #define FAUXMO_ENABLED 1