Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #41

Merged
merged 10 commits into from
Nov 24, 2023
Merged
10 changes: 8 additions & 2 deletions aquapi_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ substitutions:
name: "aquapi"
friendly_name: "AquaPi"
# App Version - Updated: 8/2023
app_version: "1.3.3"
app_version: "1.3.5"

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
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
Expand Down
18 changes: 18 additions & 0 deletions common/debug.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 1 addition & 3 deletions common/device_base.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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
Expand Down
22 changes: 16 additions & 6 deletions common/ezo_co2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<std::string> v;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 21 additions & 7 deletions common/ezo_ec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,10 +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);
on_custom:
then:
- lambda:
Expand Down Expand Up @@ -81,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"
Expand All @@ -98,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;
Expand Down Expand Up @@ -187,7 +190,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
Expand Down Expand Up @@ -264,6 +275,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
Expand Down
19 changes: 15 additions & 4 deletions common/ezo_hum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -175,6 +183,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
Expand Down
8 changes: 8 additions & 0 deletions common/ezo_ph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down