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.

96 lines
3.8 KiB

  1. // ------------------------------------------------------------------------------
  2. // Example file for custom.h
  3. // Either copy and paste this file then rename removing the .example or create your
  4. // own file: 'custom.h'
  5. // This file allows users to create their own configurations.
  6. // See 'code/espurna/config/general.h' for default settings.
  7. //
  8. // See: https://github.com/xoseperez/espurna/wiki/Software-features#enabling-features
  9. // and 'code/platformio_override.ini.example' for more details.
  10. // ------------------------------------------------------------------------------
  11. // Example of a Sonoff Basic board with some options disabled to reduce firmware size.
  12. #if defined(MY_SONOFF_BUILD01) // This section will be used when src_build_flags contains
  13. // -DMY_SONOFF_BUILD01 in 'platformio_override.ini'
  14. #define MANUFACTURER "ITEAD"
  15. #define DEVICE "SONOFF_BASIC_BUILD01"
  16. // Disable these
  17. #define DEBUG_SERIAL_SUPPORT 0
  18. #define ALEXA_SUPPORT 0
  19. #define DOMOTICZ_SUPPORT 0
  20. #define HOMEASSISTANT_SUPPORT 0
  21. #define THINGSPEAK_SUPPORT 0
  22. // Buttons
  23. #define BUTTON1_PIN 0
  24. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  25. #define BUTTON1_RELAY 1
  26. // Relays
  27. #define RELAY1_PIN 12
  28. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  29. // LEDs
  30. #define LED1_PIN 13
  31. #define LED1_PIN_INVERSE 1
  32. // Example of the Sonoff Basic board above but with two buttons on different GPIOs.
  33. // The two buttons both toggle the one RELAY but ALL button events send MQTT values.
  34. // An MQTT based system can then carry out differnt functions depending on
  35. // the 'DOUBLE CLICK, LONG CLICK OR LONG-LONG CLICK' trigger. A BMX280 environment
  36. // sensor is also connected using I2C on GPIO 1 and 3.
  37. #elif defined(MY_SONOFF_BUILD02) // This section will be used when src_build_flags contains
  38. // -DMY_SONOFF_BUILD02 in 'platformio_override.ini
  39. // Info - Custom Basic with BMX280 I2C on GPIO 1 and 3
  40. #define MANUFACTURER "ITEAD"
  41. #define DEVICE "SONOFF_BASIC_BMX280" // You can use your own name here
  42. // Disable these
  43. #define DEBUG_SERIAL_SUPPORT 0
  44. #define ALEXA_SUPPORT 0
  45. #define DOMOTICZ_SUPPORT 0
  46. #define HOMEASSISTANT_SUPPORT 0
  47. #define THINGSPEAK_SUPPORT 0
  48. // Buttons
  49. #define BUTTON_MQTT_SEND_ALL_EVENTS 1
  50. #define BUTTON1_PIN 0 // Built in button.
  51. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  52. #define BUTTON1_RELAY 1
  53. #define BUTTON1_PRESS BUTTON_MODE_NONE
  54. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  55. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  56. #define BUTTON1_LNGCLICK BUTTON_MODE_OFF
  57. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  58. #define BUTTON2_PIN 2 // External push button connected between IO2 and GND.
  59. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  60. #define BUTTON2_RELAY 1
  61. #define BUTTON2_PRESS BUTTON_MODE_NONE
  62. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  63. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  64. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  65. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  66. // Relays
  67. #define RELAY1_PIN 12
  68. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  69. // LEDs
  70. #define LED1_PIN 13
  71. #define LED1_PIN_INVERSE 1
  72. // Extras
  73. #define BMX280_SUPPORT 1
  74. #define BMX280_ADDRESS 0x76
  75. #define I2C_SDA_PIN 1 //TX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
  76. #define I2C_SCL_PIN 3 //RX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
  77. #endif