diff --git a/growbox.yaml b/growbox.yaml index 6748c88b94cdd1eee77b322a4334d0ab790ab5bb..fda0e21b156e9db932f3273c2166cc94b248630d 100644 --- a/growbox.yaml +++ b/growbox.yaml @@ -14,7 +14,6 @@ packages: esp32: !include packages/esp32.yaml time: !include packages/time_schedule.yaml bme280: !include packages/bme280.yaml - yieryi2178: !include packages/yieryi3178.yaml scd40: !include packages/scd40.yaml mlx90614: !include packages/mlx90614.yaml gp8403: !include packages/gp8403.yaml @@ -24,3 +23,7 @@ packages: fan_scripts: !include packages/fan_scripts.yaml light_power: !include packages/light_power.yaml light_settings: !include packages/light_settings.yaml + ads1115: !include packages/ads1115.yaml + ec: !include packages/ec.yaml + ph: !include packages/ph.yaml + sts35: !include packages/sts35.yaml diff --git a/packages/ec.yaml b/packages/ec.yaml index 39494b9ffe1d2703639a5dc720ae6a8cbde489df..bb3918987f11959cf72a1363f141d28ef805118b 100644 --- a/packages/ec.yaml +++ b/packages/ec.yaml @@ -1,5 +1,5 @@ substitutions: - ec_k: '0.992' + ec_k: '0.97090' # ec_ref & ec_res2: https://github.com/DFRobot/DFRobot_EC/blob/master/DFRobot_EC.cpp#L28 // https://www.dfrobot.com/forum/topic/28708 ec_ref: '200.0' ec_res2: '820.0' @@ -18,7 +18,7 @@ sensor: gain: 4.096 # max: 3.4V update_interval: 5s accuracy_decimals: 5 - <<: !include filter.yaml + #<<: !include filter.yaml - platform: template name: "EC: K Value" unit_of_measurement: "K" @@ -32,10 +32,9 @@ sensor: accuracy_decimals: 3 update_interval: 5s lambda: |- - float water_temperature = 20.0; float ec_raw = id(analog_ec).state / ${ec_res2} / ${ec_ref} * 1000.0 * 1000.0; float ec = ec_raw * id(ec_k); - return ec / (1 + (0.0185 * (water_temperature - 25))); // return with temperature correction + return ec / (1 + (0.0185 * (id(water_temperature).state - 25))); // return with temperature correction button: - platform: template @@ -43,13 +42,12 @@ button: on_press: - then: - lambda: |- - float water_temperature = 20.0; float buffer_solution = -1; if (id(ec).state > 0.9 && id(ec).state < 1.9) { // recognize 1.413us/cm buffer solution ESP_LOGI("ec", "Calibrating EC with 1.413 mS/cm solution"); - buffer_solution = 1.413 * (1.0 + 0.0185 * (water_temperature - 25.0)); + buffer_solution = 1.413 * (1.0 + 0.0185 * (id(water_temperature).state - 25.0)); } else if (id(ec).state > 9 && id(ec).state < 16.8) { // recognize 12.88ms/cm buffer solution - buffer_solution = 12.88 * (1.0 + 0.0185 * (water_temperature - 25.0)); + buffer_solution = 12.88 * (1.0 + 0.0185 * (id(water_temperature).state - 25.0)); ESP_LOGI("ec", "Calibrating EC with 12.88 mS/cm solution"); } else { ESP_LOGI("ec", "Not calibrating EC, probe not in 1.413 or 12.88 mS/cm solution"); diff --git a/packages/ph.yaml b/packages/ph.yaml index 358d1d2c240c424ebf950b18a45d7a164b19d7b9..db659fc8646d9498727b76d9acdb9f93c46f3ceb 100644 --- a/packages/ph.yaml +++ b/packages/ph.yaml @@ -1,8 +1,8 @@ substitutions: - ph400_raw: '2.068' - ph686_raw: '1.574' - ph700_raw: '1.555' - ph918_raw: '1.215' + ph400_raw: '2.06785' + ph686_raw: '1.57897' + ph700_raw: '1.54883' + ph918_raw: '1.21447' globals: - id: ph400_raw # raw V value from probe using pH 4.0 calibration solution. @@ -30,7 +30,7 @@ sensor: gain: 4.096 # max: 3.0V update_interval: 5s accuracy_decimals: 5 - <<: !include filter.yaml + #<<: !include filter.yaml - platform: template name: "pH: 4.00 Calibration Value" unit_of_measurement: "V" diff --git a/packages/sts35.yaml b/packages/sts35.yaml new file mode 100644 index 0000000000000000000000000000000000000000..998a8bba8be4a6b2933a5dcb19ec75ed7b8a5c7e --- /dev/null +++ b/packages/sts35.yaml @@ -0,0 +1,14 @@ +sensor: +- platform: sts3x + id: water_temperature + name: "Water: Temperature" + address: 0x4a + update_interval: 5s + accuracy_decimals: 2 + <<: !include filter.yaml + +prometheus: + relabel: + water_temperature: + id: temperature_water + name: "Water: Temperature"