Okay, I give up!
I’ve been searching through code to find the cause of this error;
INFO ESPHome 2023.7.0
INFO Reading configuration /config/esphome/irrigation-controller.yaml...
INFO Detected timezone 'America/Toronto'
WARNING GPIO2 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Compiling app...
Processing irrigation-controller (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
|-- Wire @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/src/main.cpp.o
/config/esphome/irrigation-controller.yaml: In function 'void setup()':
/config/esphome/irrigation-controller.yaml:733:80: error: expected ')' before ':' token
^
)
/config/esphome/irrigation-controller.yaml:733:102: error: no matching function for call to 'esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >::GlobalsComponent(<unresolved overloaded function type>)'
^
In file included from src/esphome.h:24,
from src/main.cpp:3:
src/esphome/components/globals/globals_component.h:16:12: note: candidate: 'esphome::globals::GlobalsComponent<T>::GlobalsComponent(std::array<typename std::remove_extent<_Up>::type, std::extent<_Tp>::value>) [with T = std::__cxx11::basic_string<char>; typename std::remove_extent<_Up>::type = std::__cxx11::basic_string<char>]'
explicit GlobalsComponent(std::array<typename std::remove_extent<T>::type, std::extent<T>::value> initial_value) {
^~~~~~~~~~~~~~~~
src/esphome/components/globals/globals_component.h:16:12: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::array<std::__cxx11::basic_string<char>, 0>'
src/esphome/components/globals/globals_component.h:15:12: note: candidate: 'esphome::globals::GlobalsComponent<T>::GlobalsComponent(T) [with T = std::__cxx11::basic_string<char>]'
explicit GlobalsComponent(T initial_value) : value_(initial_value) {}
^~~~~~~~~~~~~~~~
src/esphome/components/globals/globals_component.h:15:12: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::__cxx11::basic_string<char>'
src/esphome/components/globals/globals_component.h:14:12: note: candidate: 'constexpr esphome::globals::GlobalsComponent<T>::GlobalsComponent() [with T = std::__cxx11::basic_string<char>]'
explicit GlobalsComponent() = default;
^~~~~~~~~~~~~~~~
src/esphome/components/globals/globals_component.h:14:12: note: candidate expects 0 arguments, 1 provided
src/esphome/components/globals/globals_component.h:11:28: note: candidate: 'esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >::GlobalsComponent(const esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >&)'
template<typename T> class GlobalsComponent : public Component {
^~~~~~~~~~~~~~~~
src/esphome/components/globals/globals_component.h:11:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >&'
src/esphome/components/globals/globals_component.h:11:28: note: candidate: 'esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >::GlobalsComponent(esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >&&)'
src/esphome/components/globals/globals_component.h:11:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'esphome::globals::GlobalsComponent<std::__cxx11::basic_string<char> >&&'
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib495/libsodium/sodium/codecs.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib495/libsodium/sodium/core.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib495/libsodium/sodium/runtime.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib495/libsodium/sodium/utils.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib459/noise-c/backend/openssl/cipher-aesgcm.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib459/noise-c/backend/ref/cipher-aesgcm.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib459/noise-c/backend/ref/cipher-chachapoly.c.o
Compiling /data/irrigation-controller/.pioenvs/irrigation-controller/lib459/noise-c/backend/ref/dh-curve25519.c.o
*** [/data/irrigation-controller/.pioenvs/irrigation-controller/src/main.cpp.o] Error 1
========================= [FAILED] Took 13.14 seconds =========================
Seems I’m referencing a non-existent function however I don’t see where. The error refers to line 733, however that line in my file is blank. I’m assuming the error occurs prior to that line. I cannot see where and would appreciate any insight you may have to offer.
My code reads as follows;
# Based on ESPHome Sprinkler Controller - https://esphome.io/components/sprinkler.html
# Change Log
#2023 04 23 V31
# Starting Over!!!
# 2023 05 26 V40
# Re-added Substitutions that were removed in version 2023 02 26 v30
# Fix run duration to minutes
# added a NTC temp sensor to monitor enclosure temperature
# 2023 06 06 V41
# Correct inconsistencies in line indentation
# Trouble Shooting Communication Error; Renamed valve_switch_id: from ${devicename}_x to ${zone_x_name}
# Reverted board name and type to original values: esp32dev, arduino
# 2023 06 08 V50
# Trouble Shooting Communication Error; Write Program to New ESP32 Board
# 2023 06 10 V60
# Trouble Shooting Communication Error; Write Program to different brand of ESP32 Board
# Added code to correct divide by zero error in Zone Percentage Remaining calculation
# 2023 06 12 V61
# Improved code for correcting divide by zero error - added global variables
# Removed Cycle Minutes and Percentage from dislay when only one sprinkler is activated.
# 2023 06 14 V62
# Removed redundent code for zone time and zone percent complete.
# 2023 06 14 V64
# Revised method for showing sprinkler status. Utilized code introduced in ESPHome Sprinkler Controller version 2
# 2023 06 23 V70
# Add serial driver for use with LCD Display
# Add Display code
# Add code for displaying Sprinkler Zones, times and status.
# Pins 21 and 22 required for I2C. Reassign switch pins from 21, 22 to 16, 17.
#2023 06 28 V71
# Modify Zone Time Remaining - Test valve for time remaining rather than activity
# Modify zone_time_remaing and cycle_time_remaining - add ability to see remaing time when paused
# Add global variables used to keep track of zone and cycle times.
#2023 06 30 V72
# Change message "Active" to "Running".
# Removed code for "Pause" button. Added a "Pause" switch.
# This change causes the icon on the HA Dashboard to highlight when system is paused.
#2023 07 03 V80
# Configure "zone_active_sensor" as internal only
# Correct cause of "Pause" switch remaining on when Run button is pressed to restart cycle
# Correct cause of incorrect Zone Number being diplayed when controller is paused
#############################
# Establish Substitutions #
#############################
substitutions:
##############################################
# Modify only the following thirteen lines #
##############################################
software_version: Date 2023 07 20, V85
zone_0_name: "Front Lawn"
zone_1_name: "Front Garden"
zone_2_name: "South Garden"
zone_3_name: "Rear Garden"
zone_4_name: "Rear Lawn"
zone_5_name: "North Garden"
zone_6_name: "Drip Line A"
zone_7_name: "Drip Line B"
# State strings [8 Charaters Maximum]
# Auto off string for local display [8 chars max]
auto_advance_string: "Auto Advance"
# Rain string for local display [8 chars max]
rain_string: "Rain"
# Idle state strings for local display [16 chars max]
valves_idle_string: "All Valves OFF"
# Valve overlap time.
# Current and next valves run simultaneously for the specified duration.
# Prevents water hammer effect.
valve_overlap_time: 2s
# Display update frequency
sensor_update_frequency: 1s
log_level: debug # Enable levels logging https://esphome.io/components/logger.html
# none, error, warn, info, debug (default), verbose, very_verbose
############################################
# DO NOT CHANGE ANYTHING BELOW THIS LINE #
############################################
esphome_name: irrigation-controller
esphome_friendly_name: irrigation-controller
esphome_board: esp32dev
esphome_framework_type: arduino
esphome_comment: Eight Valve Irrigation Control
esphome_project_name: RCB.Eight Valve Irrigation Control
esphome_project_version: Irrigation Controller, $software_version
devicename: irrigation_controller
upper_devicename: "Irrigation Controller"
zone_0_valve_id: zone_0_valve
zone_1_valve_id: zone_1_valve
zone_2_valve_id: zone_2_valve
zone_3_valve_id: zone_3_valve
zone_4_valve_id: zone_4_valve
zone_5_valve_id: zone_5_valve
zone_6_valve_id: zone_6_valve
zone_7_valve_id: zone_7_valve
###############################################
# Define Project Deatils and ESP Board Type #
###############################################
esphome:
name: $esphome_name
friendly_name: $esphome_friendly_name
comment: $esphome_comment
project:
name: $esphome_project_name
version: $esphome_project_version
on_boot:
- priority: -100.0
then:
- text_sensor.template.publish:
id: sprinkler_status
state: sprinkler_status_state_string
esp32:
board: $esphome_board
framework:
type: $esphome_framework_type
################
# Enable WiFi #
################
wifi:
ssid: !secret 'wifi_ssid'
password: !secret 'wifi_password'
###################
# Enable Logger #
###################
logger:
level: ${log_level}
logs:
text_sensor: WARN
########################################
# Enable Over The Air Upgrades (OTA) #
########################################
ota:
password: !secret 'ota_password'
#######################
# Enable Web server #
#######################
web_server:
port: 80
###################################
# Sync time with Home Assistant #
###################################
time:
- platform: homeassistant
id: homeassistant_time
###############################
# Enable Home Assistant API #
###############################
api:
encryption:
key: !secret 'api_encryption'
################################
# Initialize Global Variable #
################################
globals:
- id: current_zone_time_remaining
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"0"'
- id: current_cycle_time_remaining
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"0"'
# State strings [8 Charaters Maximum]
- id: idle_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Idle"'
- id: starting_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Strating"'
- id: running_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Running"'
- id: stopping_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Stopping"'
- id: bypass_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Bypass"'
- id: paused_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Paused"'
- id: standby_state_string
type: std::string
restore_value: no # Strings cannot be saved/restored
initial_value: '"Standby"'
- id: sprinkler_status_state_string
type: std::string
restore_value: no
initial_value: 'id:${devicename})standby_state_string'
script:
- id: publish_turn_on_status
then:
- switch.turn_off: sprinkler_pause_resume
- text_sensor.template.publish:
id: sprinkler_status
state: id(running_state_string)
- id: publish_turn_off_status
then:
- if:
condition:
lambda: 'return (id(sprinkler_pause_resume).state);'
then:
- text_sensor.template.publish:
id: sprinkler_status
state: id(paused_state_string)
else:
- delay: 2500ms
- if:
condition:
lambda: 'return (id($devicename).active_valve().has_value());'
then:
- text_sensor.template.publish:
id: sprinkler_status
state: id(running_state_string)
else:
- text_sensor.template.publish:
id: sprinkler_status
state: id(idle_state_string)
#################################
# Enable Serial Communication #
#################################
i2c:
id: dispaly_bus
sda: 21
scl: 22
########################
# Enable LCD Display #
########################
display:
- platform: lcd_pcf8574
id: lcd_display_2004a
dimensions: 20x4
address: 0x27
lambda: |-
switch (id($devicename).active_valve().value_or(-1)) {
case -1:
it.strftime(0, 0, "%a", id(homeassistant_time).now());
it.strftime(4, 0, "%b %d, %Y", id(homeassistant_time).now());
it.strftime(0, 1,"%I:%M:%S %p", id(homeassistant_time).now());
it.printf(0, 3, "Status: %s", id(sprinkler_status).state.c_str());
if (id(sprinkler_status).state == "Paused") {
it.printf(0, 2, "Zone %s", id(zone_active_sensor).state.c_str());
it.printf(10, 2, "T: %s", id(zone_time_remaining).state.c_str());
}
break;
default:
it.printf(0, 0, "Zone %s:", id(zone_active_sensor).state.c_str());
it.printf(8, 0, "%s", id(zone_active_sensor).state.c_str() ? "ON" : "OFF");
it.printf(0, 1, "Time Left: %s", id(zone_time_remaining).state.c_str());
break;
}
#############################################
# Create General information Text Sensors #
#############################################
text_sensor:
- platform: version
name: Version
- platform: wifi_info
ip_address:
name: $devicename IP
ssid:
name: $devicename SSID
bssid:
name: $devicename BSSID
- platform: template
id: sprinkler_status
name: Sprinkler Status
icon: mdi:information-variant
update_interval: $sensor_update_frequency
lambda: |-
if (id($devicename).active_valve().has_value()) {
// the controller is running. Determine which valve is active
auto running_valve = id($devicename).active_valve().value();
return std::string("Running");
} else {
if (id($devicename).paused_valve().has_value()) {
// the contoller is paused
return std::string("Paused");
} else {
// the controller is NOT running.
return std::string("Standby");
}
}
- platform: template
name: "Zone Active Sensor"
internal: true
id: zone_active_sensor
# Valves are numbered from 0-7 internally which is an issue when displaying !
lambda: |-
if(id(sprinkler_status).state == "Standby")
{
int zone_active = id($devicename).active_valve().value_or(NAN);
std::string zone_active_as_string = esphome::to_string(zone_active);
return zone_active_as_string;
}
else
{
int zone_active = id($devicename).active_valve().value_or(NAN) + 1;
std::string zone_active_as_string = esphome::to_string(zone_active);
return zone_active_as_string;
}
update_interval: $sensor_update_frequency
- platform: template
id: zone_time_remaining
name: Zone Time Remaining
update_interval: $sensor_update_frequency
icon: mdi:timer-sand
lambda: !lambda |-
if(id($devicename).time_remaining_active_valve().has_value()){
int seconds = round(id($devicename).time_remaining_active_valve().value_or(0));
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
id(current_zone_time_remaining) = ((days ? String(days) + "d " : "") + (hours ? String(hours) + "h " : "") + (minutes ? String(minutes) + "m " : "") + (String(seconds) + "s")).c_str();
return id(current_zone_time_remaining);
} else {
return id(current_zone_time_remaining);
}
- platform: template
id: zone_percent_complete
name: Zone Percent Complete
update_interval: $sensor_update_frequency
icon: mdi:water-percent
lambda: !lambda |-
if (!id($devicename).active_valve().has_value()) {
return std::string("--");
} else {
if (id($devicename).time_remaining_active_valve() >= 0){
auto active = id($devicename).active_valve();
auto time_remaining_active_valve = id($devicename).time_remaining_active_valve();
auto valve_run_duration_adjusted = id($devicename).valve_run_duration_adjusted(active.value());
return {std::to_string((uint32_t)(100 * (valve_run_duration_adjusted - time_remaining_active_valve.value_or(0))) / valve_run_duration_adjusted) + "%"};
} else {
return std::string("--");
}
}
- platform: template
id: cycle_time_remaining
name: Cycle Time Remaining
update_interval: $sensor_update_frequency
icon: mdi:timer-sand
lambda: !lambda |-
if (id($devicename).time_remaining_current_operation().has_value()){
int seconds = round(id($devicename).time_remaining_current_operation().value_or(0));
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
id(current_cycle_time_remaining) = ((days ? String(days) + "d " : "") + (hours ? String(hours) + "h " : "") + (minutes ? String(minutes) + "m " : "") + (String(seconds) + "s")).c_str();
return id(current_cycle_time_remaining);
} else {
return id(current_cycle_time_remaining);
}
- platform: template
id: cycle_percent_complete
name: Cycle Percent Complete
update_interval: $sensor_update_frequency
icon: mdi:water-percent
lambda: !lambda |-
if (!id($devicename).active_valve().has_value()) {
return std::string("--");
} else {
if (id($devicename).total_cycle_time_enabled_valves() > 0){
auto time_remaining_current_operation = id($devicename).time_remaining_current_operation();
auto total_cycle_time_enabled_valves = id($devicename).total_cycle_time_enabled_valves();
return {std::to_string((uint32_t)(100 * (total_cycle_time_enabled_valves - time_remaining_current_operation.value_or(0))) / total_cycle_time_enabled_valves) + "%"};
} else {
return std::string("--");
}
}
################################
# Enable On-Board Status LED #
################################
light:
- platform: status_led
pin: GPIO2
id: led_status_light
restore_mode: ALWAYS_ON
internal: true
effects:
- strobe:
name: "Slow Blink" # 0.1s on, 2s off
colors:
- state: true
brightness: 100%
duration: 100ms
- state: false
duration: 2s
on_turn_on:
then:
- light.turn_on:
id: led_status_light
effect: "Slow Blink"
sensor:
- platform: uptime
name: $upper_devicename Uptime
- platform: wifi_signal
name: $upper_devicename WiFi Signal
update_interval: 60s
####################################################################################################
# Temperature sensor https://esphome.io/components/sensor/ntc.html using a switch every 1 minute #
# Pull Up GPIO32 (3.3V). prevents self-heating NTC #
####################################################################################################
- platform: ntc
id: ntc_sensor
sensor: resistance_sensor
name: $upper_devicename Temperature
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
- platform: resistance
id: resistance_sensor
sensor: source_sensor
configuration: DOWNSTREAM
resistor: 10kOhm
name: Resistance Sensor
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
- platform: adc
pin: 34
id: source_sensor
update_interval: never
attenuation: auto
interval:
- interval: 60s
then:
- switch.turn_on: ntc_vcc
- lambda: 'id(source_sensor).update();'
- switch.turn_off: ntc_vcc
###############################
# Main Sprinkler Controller #
###############################
sprinkler:
- id: $devicename
main_switch: "Start/Stop"
auto_advance_switch: "Auto Advance"
next_prev_ignore_disabled: true
multiplier_number:
id: run_time_multiplier
name: "Run Time Multiplier"
min_value: 0.1
max_value: 5
step: .1
icon: mdi:multiplication
mode: BOX
restore_value: true
initial_value: .1
valve_overlap: $valve_overlap_time
valves:
###############
# Zone Zero #
###############
- valve_switch:
name: $zone_0_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_0_name
run_duration_number:
id: zone_0_duration
name: $zone_0_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_0_valve_id
##############
# Zone One #
##############
- valve_switch:
name: $zone_1_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_1_name
run_duration_number:
id: zone_1_duration
name: $zone_1_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_1_valve_id
##############
# Zone Two #
##############
- valve_switch:
name: $zone_2_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_2_name
run_duration_number:
id: zone_2_duration
name: $zone_2_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_2_valve_id
################
# Zone Three #
################
- valve_switch:
name: $zone_3_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_3_name
run_duration_number:
id: zone_3_duration
name: $zone_3_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_3_valve_id
###############
# Zone Four #
###############
- valve_switch:
name: $zone_4_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_4_name
run_duration_number:
id: zone_4_duration
name: $zone_4_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_4_valve_id
###############
# Zone Five #
###############
- valve_switch:
name: $zone_5_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_5_name
run_duration_number:
id: zone_5_duration
name: $zone_5_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_5_valve_id
##############
# Zone Six #
##############
- valve_switch:
name: $zone_6_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_6_name
run_duration_number:
id: zone_6_duration
name: $zone_6_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_6_valve_id
################
# Zone Seven #
################
- valve_switch:
name: $zone_7_name
on_turn_on:
then:
- script.execute: publish_turn_on_status
on_turn_off:
then:
- script.execute: publish_turn_off_status
enable_switch: Enable $zone_7_name
run_duration_number:
id: zone_7_duration
name: $zone_7_name Duration
min_value: 1
max_value: 60
step: 1
unit_of_measurement: min
icon: mdi:timer-outline
mode: BOX
restore_value: true
initial_value: 1
valve_switch_id: $zone_7_valve_id
button:
########################################
# Button to restart the ESP32 Devoce #
########################################
- platform: restart
name: "Restart"
disabled_by_default: false
entity_category: diagnostic
device_class: restart
####################################################
# Button to move forward to next Sprinkler Vavle #
####################################################
- platform: template
id: sprinkler_next
name: "Next"
icon: mdi:skip-next
on_press:
then:
- sprinkler.next_valve: $devicename
########################################################
# Button to move back to the previous Sprinkler Vavle #
########################################################
- platform: template
id: sprinkler_previous
name: "Previous"
icon: mdi:skip-previous
on_press:
then:
- sprinkler.previous_valve: $devicename
switch:
##########################
# Pause Set and Resume #
##########################
- platform: template
id: sprinkler_pause_resume
name: "Pause"
icon: mdi:play-pause
optimistic: true
restore_mode: always_off
on_turn_on:
then:
- sprinkler.pause: $devicename
on_turn_off:
then:
- sprinkler.resume: $devicename
# Switch for the NTC https://esphome.io/components/sensor/ntc.html, Prevent self heating by switching the voltage on a GPIO
- platform: gpio
id: ntc_vcc
pin:
number: 32
############################################################
# Hidden I/O Switches to control irrigation valve relays #
############################################################
- platform: gpio
name: Relay Board Pin IN1 - Relay Board A
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_0_valve_id}
pin:
number: 19
inverted: true
- platform: gpio
name: Relay Board Pin IN2 - Relay Board A
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_1_valve_id}
pin:
number: 16
inverted: true
- platform: gpio
name: Relay Board Pin IN3 - Relay Board A
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_2_valve_id}
pin:
number: 17
inverted: true
- platform: gpio
name: Relay Board Pin IN4 - Relay Board A
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_3_valve_id}
pin:
number: 23
inverted: true
- platform: gpio
name: Relay Board Pin IN1 - Relay Board B
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_4_valve_id}
pin:
number: 14
inverted: true
- platform: gpio
name: Relay Board Pin IN2 - Relay Board B
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_5_valve_id}
pin:
number: 27
inverted: true
- platform: gpio
name: Relay Board Pin IN3 - Relay Board B
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_6_valve_id}
pin:
number: 26
inverted: true
- platform: gpio
name: Relay Board Pin IN4 - Relay Board B
restore_mode: RESTORE_DEFAULT_OFF # Prevents GPIO pin from going high during boot
internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
id: ${zone_7_valve_id}
pin:
number: 33
inverted: true
number: []