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 #67

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Test #67

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aquapi_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ packages:
ota_https: !include common/ota_https.yaml
dallas: !include common/temperature_dallas.yaml
binary: !include common/binary.yaml
# ir_receiver: !include common/ir_receiver.yaml
# dht: !include common/dht.yaml
# binary_input: !include common/binary_input.yaml
ezo_ph: !include common/ezo_ph.yaml
ezo_ec: !include common/ezo_ec.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ blueprint:
(Red) and add clean water (Green) daily, in gallons, per month.

**Note, this automation will fail if the calculated flow rate exceeds either of
the EZO Pump''s Max Volume/Time Flow Rates.** [More Info]() (v1.0.1) [Automation]'
the EZO Pump''s Max Volume/Time Flow Rates.** [More Info](https://community.home-assistant.io/t/atlas-scientific-ezo-pmp-peristaltic-pumps/744639/1) (v1.0.1) [Automation]'
domain: automation
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/automation/TheRealFalseReality/aquapi_water_change.yaml
input:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ blueprint:
(Red) and add clean water (Green) daily, in gallons, per month.

**Note, this automation will fail if the calculated flow rate exceeds either of
the EZO Pump''s Max Volume/Time Flow Rates.** [More Info]() (v1.0) [Automation]'
the EZO Pump''s Max Volume/Time Flow Rates.** [More Info](https://community.home-assistant.io/t/atlas-scientific-ezo-pmp-peristaltic-pumps/744639/1) (v1.0) [Automation]'
domain: automation
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/automation/TheRealFalseReality/aquapi_water_change.yaml
input:
Expand Down
2 changes: 1 addition & 1 deletion blueprints/script/TheRealFalseReality/aquapi_dosing.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blueprint:
name: "Aquarium - AquaPi: Dosing"
description: Turn on an AquaPi EZO Pump to dose a specific amount in mL.
[More Info]() (v1) [Script]
[More Info](https://community.home-assistant.io/t/atlas-scientific-ezo-pmp-peristaltic-pumps/744639/1) (v1) [Script]
domain: script
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/script/TheRealFalseReality/aquapi_dosing.yaml
input:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ blueprint:
(Red) and add clean water (Green) daily, in gallons.

**Note, this script will fail if the calculated flow rate exceeds either of the
EZO Pump''s Max Volume/Time Flow Rates.** [More Info]() (v1.0.1) [Script]'
EZO Pump''s Max Volume/Time Flow Rates.** [More Info](https://community.home-assistant.io/t/atlas-scientific-ezo-pmp-peristaltic-pumps/744639/1) (v1.0.1) [Script]'
domain: script
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/script/TheRealFalseReality/aquapi_quick_water_change_script.yaml
input:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
blueprint:
name: 'Aquarium - AquaPi: Water Change [Script]'
description: 'Turn on two AquaPi EZO Pumps to simultaneously remove waste water
(Red) and add clean water (Green) daily, in gallons.

**Note, this script will fail if the calculated flow rate exceeds either of the
EZO Pump''s Max Volume/Time Flow Rates.** [More Info]() (v1.0.1) [Script]'
domain: script
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/script/TheRealFalseReality/aquapi_water_change_script.yaml
input:
condition:
name: Add Condition(s)
description: Add conditions if needed.
default: []
selector:
condition: {}
aquarium_name:
name: Aquarium Name
description: Name of the Aquarium for the water change (Marine Aquarium).
selector:
text:
multiple: false
multiline: false
pump_button:
name: AquaPi Dose Pump for Water Change
description: Select the **Dose Volume for Time** button.
selector:
target:
entity:
- domain:
- button
integration: esphome
pump_volume:
name: AquaPi Dose Pump Volume Input for Water Change
description: Select the **Volume to Dose** input number entity.
selector:
target:
entity:
- domain:
- number
integration: esphome
pump_time:
name: AquaPi Dose Pump Time Input for Water Change
description: Select the **Time to Dose** input number entity.
selector:
target:
entity:
- domain:
- number
integration: esphome
change_volume_monthly:
name: Water Change Volume Montly
description: "Volume to change every month. Max: 100 gallons.\n Recommended
10 - 15% monthly water change.\n ***Example: 120 gallon aquarium at 10% water
change every month. 120gal x 0.10 = 12gal a month.***"
selector:
number:
min: 0.1
max: 100.0
step: 0.1
unit_of_measurement: gal
mode: box
change_time:
name: Water Change Over Time
description: Change the water amount over this time in hours every day.
default: 8
selector:
number:
min: 0.5
max: 23.0
step: 0.5
unit_of_measurement: hours
mode: slider
notify:
name: Persistent Notification
description: Notify Home Assistant when script is executed.
default: true
selector:
boolean: {}
additional_actions:
name: Additional Actions
description: "Add additional actions to the script. Will execute before everything
else.\n- Example: To send to Mobile Device using the official Home Assistant
App:\n\n Notifications -> Send a notification via mobile.YOUR_DEVICE_NAME\n
\ ```\n service: notify.YOUR_DEVICE_NAME\n metadata: {}\n data:\n message:
\"{{ message }}\"\n title: \"{{ title }}\"\n ```\n\n Copy {{ message
}} into `message`. This will switch to \"yaml\" mode. Above is a completed
example.\n"
default: []
selector:
action: {}
variables:
condition: !input condition
pump_button: !input pump_button
pump_volume: !input pump_volume
pump_time: !input pump_time
change_time: !input change_time
change_volume_monthly: !input change_volume_monthly
change_volume: '{{ (change_volume_monthly * 3) / 91 }}'
aquarium_name: !input aquarium_name
additional_actions: !input additional_actions
notify: !input notify
calculated_time: '{{ change_time * 60 }}'
calculated_volume: '{{ change_volume * 3785.41 }}'
calculated_flow_rate: '{{ change_volume / change_time }}'
calculated_flow_rate_metric: '{{ calculated_volume / calculated_time }}'
title: '{{ aquarium_name }} Water Change'
message: 'Changing {{ change_volume | float | round(2, default=2) }} gal of {{ aquarium_name
}} water for {{ change_time }} hours at {{ calculated_flow_rate | float | round(2,
default=2) }} gal/hr ({{ calculated_flow_rate_metric | float | round(2, default=2)}}
mL/min). Monthly Water Change Amount: {{ change_volume_monthly }} gallons.'
title_fail: '{{ aquarium_name }} Water Change Failed'
message_fail: "Failed to dose {{ aquarium_name }} due to conditions not passing.\n
Conditions: {{ condition }}"
title_fail_rate: '{{ aquarium_name }} Water Change Failed'
message_fail_rate: The measured flow rate of {{ calculated_flow_rate_metric | float
| round(2, default=2)}} mL/min exceeds the typical rate of 50 mL/min. To ensure
accuracy, the automation process may be halted.
sequence:
- if:
- condition: !input condition
then:
- choose: []
default: !input additional_actions
- service: number.set_value
target: !input pump_volume
data:
value: '{{ calculated_volume }}'
- service: number.set_value
target: !input pump_time
data:
value: '{{ calculated_time }}'
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- service: button.press
metadata: {}
data: {}
target: !input pump_button
- if:
- condition: template
value_template: '{{ notify }}'
then:
- service: notify.persistent_notification
data:
message: '{{ message }}'
title: '{{ title }}'
- if:
- condition: template
value_template: '{{ calculated_flow_rate_metric > 50 }}'
then:
- service: notify.persistent_notification
data:
message: '{{ message_fail_rate }}'
title: '{{ title_fail_rate }}'
else:
- service: notify.persistent_notification
data:
message: '{{ message_fail }}'
title: '{{ title_fail }}'
mode: single
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ blueprint:
(Red) and add clean water (Green) daily, in gallons.

**Note, this script will fail if the calculated flow rate exceeds either of the
EZO Pump''s Max Volume/Time Flow Rates.** [More Info]() (v1.0.1) [Script]'
EZO Pump''s Max Volume/Time Flow Rates.** [More Info](https://community.home-assistant.io/t/atlas-scientific-ezo-pmp-peristaltic-pumps/744639/1) (v1.0.1) [Script]'
domain: script
source_url: https://github.com/TheRealFalseReality/aquapi/blob/main/blueprints/script/TheRealFalseReality/aquapi_water_change_script.yaml
input:
Expand Down
4 changes: 2 additions & 2 deletions common/device_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ substitutions:
import_config: "false"

# I2C pins
sdaPin: "21" # yellow/TX
sclPin: "22" # blue/RX
sdaPin: "21" # yellow/TX PMP-green
sclPin: "22" # blue/RX PMP-white

esphome:
min_version: 2024.6.0
Expand Down
31 changes: 31 additions & 0 deletions common/dht.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
substitutions:
dhtPin: "25"
update_dht: "60s"

sensor:
# DHT
- platform: dht
pin: ${dhtPin}
# model: DHT11
temperature:
name: "Air Temperature"
id: air_temperature
humidity:
name: "Humidity"
id: relative_humidity
update_interval: "${update_dht}"

- platform: absolute_humidity
name: Absolute Humidity
temperature: air_temperature
humidity: relative_humidity

- platform: template
name: Dew Point
id: dew_point
icon: mdi:thermometer-water
state_class: "measurement"
device_class: "temperature"
unit_of_measurement: "°C"
lambda: |-
return ( id(air_temperature).state - (( 100 - id(relative_humidity).state ) / 5 ) );
8 changes: 4 additions & 4 deletions common/ezo_commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ button:
on_press:
then:
- ezo_pmp.change_i2c_address:
id: ezo_pump
id: ezo_pump_white
address: ${addPMP_default}

- platform: template
name: "Pump(Red) -> ${addPMP_alt1} - Change I2C Address"
on_press:
then:
- ezo_pmp.change_i2c_address:
id: ezo_pump
id: ezo_pump_white
address: ${addPMP_alt1}

- platform: template
name: "Pump(Green) -> ${addPMP_alt2} - Change I2C Address"
on_press:
then:
- ezo_pmp.change_i2c_address:
id: ezo_pump
id: ezo_pump_white
address: ${addPMP_alt2}

- platform: template
name: "Pump(Orange) -> ${addPMP_alt3} - Change I2C Address"
on_press:
then:
- ezo_pmp.change_i2c_address:
id: ezo_pump
id: ezo_pump_white
address: ${addPMP_alt3}
Loading