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.

65 lines
2.6 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 300000
  15. #define DHT_TYPE DHT22
  16. #define DHT_TIMING 11
  17. #define DHT_TEMPERATURE_TOPIC "/temperature"
  18. #define DHT_HUMIDITY_TOPIC "/humidity"
  19. //--------------------------------------------------------------------------------
  20. // DS18B20 temperature sensor
  21. // Enable support by passing ENABLE_DS18B20=1 build flag
  22. //--------------------------------------------------------------------------------
  23. #define DS_PIN 14
  24. #define DS_UPDATE_INTERVAL 60000
  25. #define DS_TEMPERATURE_TOPIC "/temperature"
  26. //--------------------------------------------------------------------------------
  27. // Custom current sensor
  28. // Check http://tinkerman.cat/your-laundry-is-done/
  29. // Enable support by passing ENABLE_EMON=1 build flag
  30. //--------------------------------------------------------------------------------
  31. #define EMON_CURRENT_PIN 0
  32. #define EMON_SAMPLES 1000
  33. #define EMON_INTERVAL 10000
  34. #define EMON_MEASUREMENTS 6
  35. #define EMON_ADC_BITS 10
  36. #define EMON_REFERENCE_VOLTAGE 1.0
  37. #define EMON_CURRENT_PRECISION 1
  38. #define EMON_CURRENT_OFFSET 0.25
  39. #define EMON_MAINS_VOLTAGE 230
  40. #define EMON_CURRENT_RATIO 180
  41. #define EMON_POWER_TOPIC "/power"
  42. //--------------------------------------------------------------------------------
  43. // HLW8012 power sensor (Sonoff POW)
  44. // Enable support by passing ENABLE_POW=1 build flag
  45. // Enabled by default when selecting SONOFF_POW hardware
  46. //--------------------------------------------------------------------------------
  47. #define POW_SEL_PIN 5
  48. #define POW_CF1_PIN 13
  49. #define POW_CF_PIN 14
  50. #define POW_SEL_CURRENT HIGH
  51. #define POW_CURRENT_R 0.001
  52. #define POW_VOLTAGE_R_UP ( 5 * 470000 ) // Real: 2280k
  53. #define POW_VOLTAGE_R_DOWN ( 1000 ) // Real 1.009k
  54. #define POW_POWER_TOPIC "/power"
  55. #define POW_UPDATE_INTERVAL 10000
  56. #define POW_REPORT_EVERY 6