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.

78 lines
3.1 KiB

  1. //--------------------------------------------------------------------------------
  2. // Custom RF module
  3. // Check http://tinkerman.cat/adding-rf-to-a-non-rf-itead-sonoff/
  4. // Enable support by passing ENABLE_RF=1 build flag
  5. //--------------------------------------------------------------------------------
  6. #define RF_PIN 14
  7. #define RF_CHANNEL 31
  8. #define RF_DEVICE 1
  9. //--------------------------------------------------------------------------------
  10. // DHTXX temperature/humidity sensor
  11. // Enable support by passing ENABLE_DHT=1 build flag
  12. //--------------------------------------------------------------------------------
  13. #define DHT_PIN 14
  14. #define DHT_UPDATE_INTERVAL 60000
  15. #define DHT_TYPE DHT22
  16. #define DHT_TIMING 11
  17. #define DHT_TEMPERATURE_TOPIC "/temperature"
  18. #define DHT_HUMIDITY_TOPIC "/humidity"
  19. #define HUMIDITY_NORMAL 0
  20. #define HUMIDITY_COMFORTABLE 1
  21. #define HUMIDITY_DRY 2
  22. #define HUMIDITY_WET 3
  23. //--------------------------------------------------------------------------------
  24. // DS18B20 temperature sensor
  25. // Enable support by passing ENABLE_DS18B20=1 build flag
  26. //--------------------------------------------------------------------------------
  27. #define DS_PIN 14
  28. #define DS_UPDATE_INTERVAL 60000
  29. #define DS_TEMPERATURE_TOPIC "/temperature"
  30. //--------------------------------------------------------------------------------
  31. // Custom current sensor
  32. // Check http://tinkerman.cat/your-laundry-is-done/
  33. // Enable support by passing ENABLE_EMON=1 build flag
  34. //--------------------------------------------------------------------------------
  35. #define EMON_CURRENT_PIN 0
  36. #define EMON_SAMPLES 1000
  37. #define EMON_INTERVAL 10000
  38. #define EMON_MEASUREMENTS 6
  39. #define EMON_ADC_BITS 10
  40. #define EMON_REFERENCE_VOLTAGE 1.0
  41. #define EMON_CURRENT_PRECISION 1
  42. #define EMON_CURRENT_OFFSET 0.25
  43. #define EMON_MAINS_VOLTAGE 230
  44. #define EMON_CURRENT_RATIO 180
  45. #define EMON_POWER_TOPIC "/power"
  46. #define EMON_ENERGY_TOPIC "/energy"
  47. //--------------------------------------------------------------------------------
  48. // HLW8012 power sensor (Sonoff POW)
  49. // Enable support by passing ENABLE_POW=1 build flag
  50. // Enabled by default when selecting SONOFF_POW hardware
  51. //--------------------------------------------------------------------------------
  52. #define POW_SEL_PIN 5
  53. #define POW_CF1_PIN 13
  54. #define POW_CF_PIN 14
  55. #define POW_USE_INTERRUPTS 1
  56. #define POW_SEL_CURRENT HIGH
  57. #define POW_CURRENT_R 0.001
  58. #define POW_VOLTAGE_R_UP ( 5 * 470000 ) // Real: 2280k
  59. #define POW_VOLTAGE_R_DOWN ( 1000 ) // Real 1.009k
  60. #define POW_POWER_TOPIC "/power"
  61. #define POW_CURRENT_TOPIC "/current"
  62. #define POW_VOLTAGE_TOPIC "/voltage"
  63. #define POW_APOWER_TOPIC "/apower"
  64. #define POW_RPOWER_TOPIC "/rpower"
  65. #define POW_PFACTOR_TOPIC "/pfactor"
  66. #define POW_ENERGY_TOPIC "/energy"
  67. #define POW_UPDATE_INTERVAL 5000
  68. #define POW_REPORT_EVERY 12