ESP32 / ESP8266 & BME280 / SHT2x sensor with InfluxDB support
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

config.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * config.h
  3. *
  4. * ESP8266 / ESP32 Environmental Sensor
  5. *
  6. * ----------------------------------------------------------------------------
  7. * "THE BEER-WARE LICENSE" (Revision 42):
  8. * <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  9. * you can do whatever you want with this stuff. If we meet some day, and you
  10. * think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  11. * ----------------------------------------------------------------------------
  12. */
  13. #ifndef __ESP_ENV_CONFIG__
  14. #define __ESP_ENV_CONFIG__
  15. // Sketch version
  16. #define ESP_ENV_VERSION "0.5.0"
  17. // location of sensor, used in DB and hostname
  18. //#define SENSOR_LOCATION_LIVINGROOM
  19. //#define SENSOR_LOCATION_BEDROOM
  20. //#define SENSOR_LOCATION_BATHROOM
  21. //#define SENSOR_LOCATION_GREENHOUSE
  22. #define SENSOR_LOCATION_TESTING
  23. // WiFi AP settings
  24. #define WIFI_SSID "WIFI_SSID_HERE"
  25. #define WIFI_PASS "WIFI_PASSWORD_HERE"
  26. // MQTT settings
  27. #define MQTT_HOST "MQTT_IP_HERE"
  28. #define MQTT_PORT 1883
  29. #define MQTT_USER "USERNAME" // undef to disable auth
  30. #define MQTT_PASS "PASSWORD" // undef to disable auth
  31. // InfluxDB settings
  32. #define INFLUXDB_HOST "INFLUX_IP_HERE"
  33. #define INFLUXDB_PORT 8086
  34. #define INFLUXDB_DATABASE "roomsensorsdiy"
  35. // all given in milliseconds
  36. #define SERVER_HANDLE_INTERVAL 10
  37. #define DB_WRITE_INTERVAL (30 * 1000)
  38. #define LED_BLINK_INTERVAL (2 * 1000)
  39. #define LED_INIT_BLINK_INTERVAL 500
  40. #define LED_CONNECT_BLINK_INTERVAL 250
  41. #define LED_ERROR_BLINK_INTERVAL 100
  42. #define MQTT_RECONNECT_INTERVAL (5 * 1000)
  43. #if defined(SENSOR_LOCATION_LIVINGROOM)
  44. #define SENSOR_LOCATION "livingroom"
  45. #elif defined(SENSOR_LOCATION_BEDROOM)
  46. #define SENSOR_LOCATION "bedroom"
  47. #elif defined(SENSOR_LOCATION_BATHROOM)
  48. #define SENSOR_LOCATION "bathroom"
  49. #elif defined(SENSOR_LOCATION_GREENHOUSE)
  50. #define SENSOR_LOCATION "greenhouse"
  51. #elif defined(SENSOR_LOCATION_TESTING)
  52. #define SENSOR_LOCATION "testing"
  53. #else
  54. #define SENSOR_LOCATION "unknown"
  55. #endif
  56. #if defined(RELAIS_SERIAL) || defined(RELAIS_GPIO)
  57. #define FEATURE_RELAIS
  58. #endif
  59. #if defined(MOISTURE_ADC_ESP32) || defined(MOISTURE_ADC_ARDUINO)
  60. #define FEATURE_MOISTURE
  61. #endif
  62. #endif // __ESP_ENV_CONFIG__