From 5255514945e13b42de205820d572045b4fe0ce3f Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 22 Nov 2023 22:26:44 -0500 Subject: [PATCH 01/10] added else statements --- common/ezo_ec.yaml | 3 +++ common/ezo_hum.yaml | 3 +++ common/ezo_ph.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/common/ezo_ec.yaml b/common/ezo_ec.yaml index a9f9f7b3..09e7acba 100644 --- a/common/ezo_ec.yaml +++ b/common/ezo_ec.yaml @@ -264,6 +264,9 @@ button: if (id(select_command_ec).state == "Calibrate CLEAR (WILL RESET CALIBRATION)") { id(ec_ezo).clear_calibration(); } + else { + id(ec_ezo).send_custom("R"); + } select: - platform: template diff --git a/common/ezo_hum.yaml b/common/ezo_hum.yaml index 0914dc1a..d0b38921 100644 --- a/common/ezo_hum.yaml +++ b/common/ezo_hum.yaml @@ -175,6 +175,9 @@ button: if (id(select_command_hum).state == "Check Calibration") { id(hum_ezo).get_calibration(); } + else { + id(hum_ezo).send_custom("R"); + } select: - platform: template diff --git a/common/ezo_ph.yaml b/common/ezo_ph.yaml index a5d56edc..8357d472 100644 --- a/common/ezo_ph.yaml +++ b/common/ezo_ph.yaml @@ -100,6 +100,9 @@ button: if (id(select_command_ph).state == "Calibrate CLEAR (WILL RESET CALIBRATION)") { id(ph_ezo).clear_calibration(); } + else { + id(ph_ezo).send_custom("R"); + } select: - platform: template From 0091f40f4f6c8dc019c48d1d607103302eb64a03 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 00:20:50 -0500 Subject: [PATCH 02/10] updates to sensors --- aquapi_config.yaml | 4 ++-- common/ezo_co2.yaml | 22 ++++++++++++++++------ common/ezo_ec.yaml | 14 +++++++++++--- common/ezo_hum.yaml | 16 ++++++++++++---- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/aquapi_config.yaml b/aquapi_config.yaml index 4af69061..25edde5c 100644 --- a/aquapi_config.yaml +++ b/aquapi_config.yaml @@ -3,12 +3,12 @@ substitutions: name: "aquapi" friendly_name: "AquaPi" # App Version - Updated: 8/2023 - app_version: "1.3.3" + app_version: "1.3.4" packages: device_base: !include common/device_base.yaml dallas: !include common/temperature_dallas.yaml - pins: !include common/binary.yaml + binary: !include common/binary.yaml aquapi: !include common/aquapi.yaml # ezo_command: !include common/ezo_command.yaml ezo_ph: !include common/ezo_ph.yaml diff --git a/common/ezo_co2.yaml b/common/ezo_co2.yaml index ab80b700..7c4c8edd 100644 --- a/common/ezo_co2.yaml +++ b/common/ezo_co2.yaml @@ -3,13 +3,13 @@ substitutions: addCO2: "105" update_co2: "60s" update_button_co2: "60s" - + esphome: on_boot: priority: 200 then: - - button.press: read_co2 - - button.press: send_selected_co2 + - button.press: read_co2 + - button.press: send_selected_co2 interval: # Update Raw CO2 @@ -57,12 +57,11 @@ sensor: name: CO2 Internal Temperature id: sensor_co2_internal_temperature accuracy_decimals: 2 - disabled_by_default: true unit_of_measurement: "°C" update_interval: "${update_co2}" + entity_category: "diagnostic" state_class: "measurement" device_class: "temperature" - entity_category: "diagnostic" lambda: |- std::string str = id(raw_value_co2).state; std::vector v; @@ -107,7 +106,15 @@ button: on_press: then: - lambda: |- - id(co2_ezo).send_custom("R"); + byte error; + Wire.beginTransmission(${addCO2}); + error = Wire.endTransmission(); + if (error == 0) { + id(co2_ezo).send_custom("R"); + } + else { + ESP_LOGW("custom_co2_read", "No Carbon Dioxide sensor detected at address: ${addCO2}!!"); + } # Send Selected EZO Command - CO2 - platform: template @@ -139,6 +146,9 @@ button: if (id(select_command_co2).state == "Check Calibration") { id(co2_ezo).get_calibration(); } + else { + id(co2_ezo).send_custom("R"); + } select: - platform: template diff --git a/common/ezo_ec.yaml b/common/ezo_ec.yaml index 09e7acba..31075f99 100644 --- a/common/ezo_ec.yaml +++ b/common/ezo_ec.yaml @@ -8,8 +8,8 @@ esphome: on_boot: priority: 200 then: - - button.press: read_ec - - button.press: send_selected_ec + - button.press: read_ec + - button.press: send_selected_ec interval: # Update Raw EC @@ -187,7 +187,15 @@ button: on_press: then: - lambda: |- - id(ec_ezo).send_custom("R"); + byte error; + Wire.beginTransmission(${addEC}); + error = Wire.endTransmission(); + if (error == 0) { + id(ec_ezo).send_custom("R"); + } + else { + ESP_LOGW("custom_conductivity_read", "No Conductivity sensor detected at address: ${addEC}!!"); + } # Send Selected EZO Command - Conductitivy - platform: template diff --git a/common/ezo_hum.yaml b/common/ezo_hum.yaml index d0b38921..920d0e1c 100644 --- a/common/ezo_hum.yaml +++ b/common/ezo_hum.yaml @@ -8,8 +8,8 @@ esphome: on_boot: priority: 200 then: - - button.press: read_hum - - button.press: send_selected_hum + - button.press: read_hum + - button.press: send_selected_hum interval: # Update Raw HUM @@ -131,8 +131,16 @@ button: on_press: then: - lambda: |- - id(hum_ezo).send_custom("R"); - + byte error; + Wire.beginTransmission(${addHUM}); + error = Wire.endTransmission(); + if (error == 0) { + id(hum_ezo).send_custom("R"); + } + else { + ESP_LOGW("custom_humidity_read", "No Humidity sensor detected at address: ${addHUM}!!"); + } + # Send Selected EZO Command - HUM - platform: template name: HUM - Command Send Selected From 0c17f00e05cf76c4f171b7e940bbc727cb5b8613 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 00:29:26 -0500 Subject: [PATCH 03/10] Update device_base.yaml removed mac_suffix sub --- common/device_base.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/device_base.yaml b/common/device_base.yaml index 9869f2e2..d71b53a0 100644 --- a/common/device_base.yaml +++ b/common/device_base.yaml @@ -1,8 +1,6 @@ substitutions: # Import Config import_config: "false" - # Add MAC address to name - suffix: "true" # Logger Level - Can use VERBOSE for more information in Logs logger: "DEBUG" @@ -14,7 +12,7 @@ esphome: name: "${name}" friendly_name: "${friendly_name}" # Automatically add the mac address to the name - name_add_mac_suffix: ${suffix} + name_add_mac_suffix: true comment: "AquaPi ESP32 - Aquarium Controller & Monitor" project: name: TheRealFalseReality.aquapi From 7451c026911e76852804f1782bd3497423949728 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 00:36:06 -0500 Subject: [PATCH 04/10] Update ezo_ph.yaml pH log added --- common/ezo_ph.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/ezo_ph.yaml b/common/ezo_ph.yaml index 8357d472..a8677c5c 100644 --- a/common/ezo_ph.yaml +++ b/common/ezo_ph.yaml @@ -61,7 +61,15 @@ button: on_press: then: - lambda: |- + byte error; id(ph_ezo).send_custom("R"); + error = Wire.endTransmission(); + if (error == 0) { + id(ph_ezo).send_custom("R"); + } + else { + ESP_LOGW("custom_ph_read", "No pH sensor detected at address: ${addPH}!!"); + } # Send Selected EZO Command - pH - platform: template @@ -100,9 +108,6 @@ button: if (id(select_command_ph).state == "Calibrate CLEAR (WILL RESET CALIBRATION)") { id(ph_ezo).clear_calibration(); } - else { - id(ph_ezo).send_custom("R"); - } select: - platform: template From 3f2c77109a4d1784ed819e5746c143523741bc72 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 13:42:43 -0500 Subject: [PATCH 05/10] Create debug.yaml added --- common/debug.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 common/debug.yaml diff --git a/common/debug.yaml b/common/debug.yaml new file mode 100644 index 00000000..50ef2cb1 --- /dev/null +++ b/common/debug.yaml @@ -0,0 +1,18 @@ +debug: + update_interval: 5s + +sensor: + - platform: debug + free: + name: "Heap Free" + block: + name: "Heap Max Block" + loop_time: + name: "Loop Time" + +text_sensor: + - platform: debug + device: + name: "Device Info" + reset_reason: + name: "Reset Reason" \ No newline at end of file From 63c97bf41d7e98845440a458a785512c817703c6 Mon Sep 17 00:00:00 2001 From: Nicholas White <106857076+TheRealFalseReality@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:22:47 -0500 Subject: [PATCH 06/10] Update ezo_ec.yaml --- common/ezo_ec.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/ezo_ec.yaml b/common/ezo_ec.yaml index 31075f99..3f447b44 100644 --- a/common/ezo_ec.yaml +++ b/common/ezo_ec.yaml @@ -30,6 +30,9 @@ sensor: accuracy_decimals: 2 update_interval: "${update_ec}" state_class: "measurement" + filters: + lambda: |- + return (x / 1000) on_custom: then: - lambda: From 0cc305439c023ac872a401368d799a2ae337f620 Mon Sep 17 00:00:00 2001 From: Nicholas White <106857076+TheRealFalseReality@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:24:10 -0500 Subject: [PATCH 07/10] Update ezo_ec.yaml --- common/ezo_ec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ezo_ec.yaml b/common/ezo_ec.yaml index 3f447b44..7c3e3eb4 100644 --- a/common/ezo_ec.yaml +++ b/common/ezo_ec.yaml @@ -26,13 +26,13 @@ sensor: name: "Conductivity" id: ec_ezo address: ${addEC} - unit_of_measurement: "uS/cm" + unit_of_measurement: "mS/cm" accuracy_decimals: 2 update_interval: "${update_ec}" state_class: "measurement" filters: - lambda: |- - return (x / 1000) + - lambda: + return (x / 1000); on_custom: then: - lambda: From add137bc740847656ba7985f193de24da665f6b4 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 16:52:59 -0500 Subject: [PATCH 08/10] Update aquapi_config.yaml --- aquapi_config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aquapi_config.yaml b/aquapi_config.yaml index 25edde5c..bf8cc3cb 100644 --- a/aquapi_config.yaml +++ b/aquapi_config.yaml @@ -5,6 +5,12 @@ substitutions: # App Version - Updated: 8/2023 app_version: "1.3.4" + update_do: "never" + update_rtd: "never" + update_pmp: "never" + update_hum: "never" + update_co2: "never" + packages: device_base: !include common/device_base.yaml dallas: !include common/temperature_dallas.yaml From bbbfe5150139fef44354120c1301478b925c3b85 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 17:04:48 -0500 Subject: [PATCH 09/10] Update ezo_ec.yaml mg/L -> g/L --- common/ezo_ec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ezo_ec.yaml b/common/ezo_ec.yaml index 7c3e3eb4..bcd5925b 100644 --- a/common/ezo_ec.yaml +++ b/common/ezo_ec.yaml @@ -84,9 +84,9 @@ sensor: - platform: template name: TDS id: sensor_tds - unit_of_measurement: "mg/L" + unit_of_measurement: "g/L" icon: mdi:water-opacity - accuracy_decimals: 0 + accuracy_decimals: 2 disabled_by_default: true update_interval: "${update_ec}" state_class: "measurement" @@ -101,7 +101,7 @@ sensor: token = strtok (NULL, seps); } if (v.size() == 4) { - return std::stof(v[1]); + return (std::stof(v[1]) / 1000); } else { return NAN; From cf6108c31a2cfb201ae325d3dd207d4fa992af4c Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 Nov 2023 17:05:30 -0500 Subject: [PATCH 10/10] Update aquapi_config.yaml version updated --- aquapi_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aquapi_config.yaml b/aquapi_config.yaml index bf8cc3cb..17e65d7e 100644 --- a/aquapi_config.yaml +++ b/aquapi_config.yaml @@ -3,7 +3,7 @@ substitutions: name: "aquapi" friendly_name: "AquaPi" # App Version - Updated: 8/2023 - app_version: "1.3.4" + app_version: "1.3.5" update_do: "never" update_rtd: "never"