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.

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