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.

149 lines
5.2 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
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_POWER_COUNT 1
  13. //--------------------------------------------------------------------------------
  14. // RELAY
  15. //--------------------------------------------------------------------------------
  16. #define RELAY_MODE_OFF 0
  17. #define RELAY_MODE_ON 1
  18. #define RELAY_MODE_SAME 2
  19. #define RELAY_MODE_TOOGLE 3
  20. #define RELAY_SYNC_ANY 0
  21. #define RELAY_SYNC_NONE_OR_ONE 1
  22. #define RELAY_SYNC_ONE 2
  23. #define RELAY_SYNC_SAME 3
  24. #define RELAY_PULSE_NONE 0
  25. #define RELAY_PULSE_OFF 1
  26. #define RELAY_PULSE_ON 2
  27. // Pulse time in seconds
  28. #define RELAY_PULSE_TIME 1
  29. // 0 means OFF, 1 ON and 2 whatever was before
  30. #define RELAY_MODE RELAY_MODE_OFF
  31. // 0 means ANY, 1 zero or one and 2 one and only one
  32. #define RELAY_SYNC RELAY_SYNC_ANY
  33. // 0 means no pulses, 1 means normally off, 2 normally on
  34. #define RELAY_PULSE_MODE RELAY_PULSE_NONE
  35. //--------------------------------------------------------------------------------
  36. // LED
  37. //--------------------------------------------------------------------------------
  38. // All defined LEDs in the board can be managed through MQTT
  39. // except the first one when LED_AUTO is set to 1.
  40. // If LED_AUTO is set to 1 the board will use first defined LED to show wifi status.
  41. #define LED_AUTO 1
  42. // -----------------------------------------------------------------------------
  43. // WIFI & WEB
  44. // -----------------------------------------------------------------------------
  45. #define WIFI_RECONNECT_INTERVAL 300000
  46. #define WIFI_MAX_NETWORKS 5
  47. #define ADMIN_PASS "fibonacci"
  48. #define HTTP_USERNAME "admin"
  49. #define WS_BUFFER_SIZE 5
  50. #define WS_TIMEOUT 1800000
  51. #define DNS_PORT 53
  52. // -----------------------------------------------------------------------------
  53. // OTA & NOFUSS
  54. // -----------------------------------------------------------------------------
  55. #define OTA_PORT 8266
  56. #define NOFUSS_SERVER ""
  57. #define NOFUSS_INTERVAL 3600000
  58. // -----------------------------------------------------------------------------
  59. // MQTT
  60. // -----------------------------------------------------------------------------
  61. #define MQTT_SERVER ""
  62. #define MQTT_PORT 1883
  63. #define MQTT_TOPIC "/test/switch/{identifier}"
  64. #define MQTT_RETAIN true
  65. #define MQTT_QOS 0
  66. #define MQTT_KEEPALIVE 30
  67. #define MQTT_RECONNECT_DELAY 10000
  68. #define MQTT_SKIP_RETAINED 1
  69. #define MQTT_SKIP_TIME 1000
  70. #define MQTT_ACTION_TOPIC "/action"
  71. #define MQTT_RELAY_TOPIC "/relay"
  72. #define MQTT_LED_TOPIC "/led"
  73. #define MQTT_BUTTON_TOPIC "/button"
  74. #define MQTT_IP_TOPIC "/ip"
  75. #define MQTT_VERSION_TOPIC "/version"
  76. #define MQTT_HEARTBEAT_TOPIC "/status"
  77. #define MQTT_ACTION_RESET "reset"
  78. #define MQTT_CONNECT_EVENT 0
  79. #define MQTT_DISCONNECT_EVENT 1
  80. #define MQTT_MESSAGE_EVENT 2
  81. // Custom get and set postfixes
  82. // Use something like "/status" or "/set", with leading slash
  83. #define MQTT_USE_GETTER ""
  84. #define MQTT_USE_SETTER ""
  85. // -----------------------------------------------------------------------------
  86. // I2C
  87. // -----------------------------------------------------------------------------
  88. #define ENABLE_I2C 1
  89. #define I2C_SDA_PIN 4
  90. #define I2C_SCL_PIN 14
  91. #define I2C_CLOCK_STRETCH_TIME 200
  92. #define I2C_SCL_FREQUENCY 1000
  93. // -----------------------------------------------------------------------------
  94. // DOMOTICZ
  95. // -----------------------------------------------------------------------------
  96. #ifndef ENABLE_DOMOTICZ
  97. #define ENABLE_DOMOTICZ 1
  98. #endif
  99. #define DOMOTICZ_IN_TOPIC "domoticz/in"
  100. #define DOMOTICZ_OUT_TOPIC "domoticz/out"
  101. // -----------------------------------------------------------------------------
  102. // NTP
  103. // -----------------------------------------------------------------------------
  104. #define NTP_SERVER "pool.ntp.org"
  105. #define NTP_TIME_OFFSET 1
  106. #define NTP_DAY_LIGHT true
  107. #define NTP_UPDATE_INTERVAL 1800
  108. // -----------------------------------------------------------------------------
  109. // FAUXMO
  110. // -----------------------------------------------------------------------------
  111. // This setting defines whether Alexa support should be built into the firmware
  112. #ifndef ENABLE_FAUXMO
  113. #define ENABLE_FAUXMO 1
  114. #endif
  115. // This is default value for the fauxmoEnabled setting that defines whether
  116. // this device should be discoberable and respond to Alexa commands.
  117. // Both ENABLE_FAUXMO and fauxmoEnabled should be 1 for Alexa support to work.
  118. #define FAUXMO_ENABLED 1